Skip to content

Commit 874de40

Browse files
author
Denys Kondratenko
committed
add multi-node cluster doc for the csi hostpath driver
1 parent 76ccf5c commit 874de40

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

site/content/en/docs/handbook/persistent_volumes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,5 @@ In addition, minikube implements a very simple, canonical implementation of dyna
5151
The default [Storage Provisioner Controller](https://github.com/kubernetes/minikube/blob/master/pkg/storage/storage_provisioner.go) is managed internally, in the minikube codebase, demonstrating how easy it is to plug a custom storage controller into kubernetes as a storage component of the system, and provides pods with dynamically, to test your pod's behaviour when persistent storage is mapped to it.
5252
5353
Note that this is not a CSI based storage provider, rather, it simply declares a PersistentVolume object of type hostpath dynamically when the controller see's that there is an outstanding storage request.
54+
55+
There is also [CSI Hostpath Driver]({{< ref "/docs/tutorials/volume_snapshots_and_csi" >}}) addon that enables dynamic provisioning and supports multi-node clusters as well as snapshots.

site/content/en/docs/tutorials/multi_node.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ date: 2019-11-24
1414
- minikube 1.10.1 or higher
1515
- kubectl
1616

17+
## Caveat
18+
19+
Default [host-path volume provisioner]({{< ref "/docs/handbook/persistent_volumes" >}}) doesn't support multi-node clusters ([#12360](https://github.com/kubernetes/minikube/issues/12360)). To be able to provision or claim volumes in multi-node clusters, you could use [CSI Hostpath Driver]({{< ref "/docs/tutorials/volume_snapshots_and_csi" >}}) addon.
20+
1721
## Tutorial
1822

1923
- Start a cluster with 2 nodes in the driver of your choice:

site/content/en/docs/tutorials/volume_snapshots_and_csi.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ Once both addons are enabled, you can create persistent volumes and snapshots us
4646
volume snapshots, you can find some example yaml files along with a step-by-step [here](https://kubernetes-csi.github.io/docs/snapshot-restore-feature.html)).
4747
The driver stores all persistent volumes in the `/var/lib/csi-hostpath-data/` directory of minikube's host.
4848

49+
## Multi-Node Clusters
50+
51+
`csi-hostpath-driver` addon supports [Multi-Node Clusters]({{< ref "/docs/tutorials/multi_node" >}}) volume provisioning. It deploys `DaemonSet` that runs `hostpath` on each node to provision and claim volumes (See [#12360](https://github.com/kubernetes/minikube/issues/12360) for more details).
52+
4953
## Tutorial
5054

5155
In this tutorial, you use `volumesnapshots` addon(1) and `csi-hostpath-driver` addon(2a).
@@ -65,6 +69,13 @@ minikube addons enable volumesnapshots
6569
minikube addons enable csi-hostpath-driver
6670
```
6771

72+
Optionally you could use it as a default storage class for the dynamic volume claims:
73+
```shell
74+
minikube addons disable storage-provisioner
75+
minikube addons disable default-storageclass
76+
kubectl patch storageclass csi-hostpath-sc -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
77+
```
78+
6879
<h2 class="step"><span class="fa-stack fa-1x"><i class="fa fa-circle fa-stack-2x"></i><strong class="fa-stack-1x text-primary">3</strong></span>Check volume snapshot class</h2>
6980

7081
When you create the volume snapshot, you have to register [Volume Snapshot Classes](https://kubernetes.io/docs/concepts/storage/volume-snapshot-classes/) to your cluster.

0 commit comments

Comments
 (0)