Skip to content

Commit 103b8ed

Browse files
author
dtumkursreenivas
committed
updating doc
1 parent d2e539a commit 103b8ed

File tree

1 file changed

+108
-92
lines changed

1 file changed

+108
-92
lines changed

docs/deploy-1.17-and-later.md

Lines changed: 108 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -61,64 +61,75 @@ You should see an output similar to the following printed on the terminal showin
6161
result of deploying the hostpath driver, external provisioner, external attacher and snapshotter components. Note that the following output is from Kubernetes 1.17:
6262

6363
```shell
64+
csi-driver-host-path % deploy/kubernetes-latest/deploy.sh
6465
applying RBAC rules
65-
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-provisioner/v1.5.0/deploy/kubernetes/rbac.yaml
66+
curl https://raw.githubusercontent.com/kubernetes-csi/external-provisioner/v5.2.0/deploy/kubernetes/rbac.yaml --output /var/folders/42/l7fg3dk55xn7jm24ld4bpkyw0000gn/T/tmp.ZKWrXmZPJ9/rbac.yaml --silent --location
67+
kubectl apply --kustomize /var/folders/42/l7fg3dk55xn7jm24ld4bpkyw0000gn/T/tmp.ZKWrXmZPJ9
6668
serviceaccount/csi-provisioner created
67-
clusterrole.rbac.authorization.k8s.io/external-provisioner-runner created
68-
clusterrolebinding.rbac.authorization.k8s.io/csi-provisioner-role created
6969
role.rbac.authorization.k8s.io/external-provisioner-cfg created
70+
clusterrole.rbac.authorization.k8s.io/external-provisioner-runner created
7071
rolebinding.rbac.authorization.k8s.io/csi-provisioner-role-cfg created
71-
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-attacher/v2.1.0/deploy/kubernetes/rbac.yaml
72+
clusterrolebinding.rbac.authorization.k8s.io/csi-provisioner-role created
73+
curl https://raw.githubusercontent.com/kubernetes-csi/external-attacher/v4.8.0/deploy/kubernetes/rbac.yaml --output /var/folders/42/l7fg3dk55xn7jm24ld4bpkyw0000gn/T/tmp.ZKWrXmZPJ9/rbac.yaml --silent --location
74+
kubectl apply --kustomize /var/folders/42/l7fg3dk55xn7jm24ld4bpkyw0000gn/T/tmp.ZKWrXmZPJ9
7275
serviceaccount/csi-attacher created
73-
clusterrole.rbac.authorization.k8s.io/external-attacher-runner created
74-
clusterrolebinding.rbac.authorization.k8s.io/csi-attacher-role created
7576
role.rbac.authorization.k8s.io/external-attacher-cfg created
77+
clusterrole.rbac.authorization.k8s.io/external-attacher-runner created
7678
rolebinding.rbac.authorization.k8s.io/csi-attacher-role-cfg created
77-
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/v2.0.1/deploy/kubernetes/csi-snapshotter/rbac-csi-snapshotter.yaml
79+
clusterrolebinding.rbac.authorization.k8s.io/csi-attacher-role created
80+
curl https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/v8.2.0/deploy/kubernetes/csi-snapshotter/rbac-csi-snapshotter.yaml --output /var/folders/42/l7fg3dk55xn7jm24ld4bpkyw0000gn/T/tmp.ZKWrXmZPJ9/rbac.yaml --silent --location
81+
kubectl apply --kustomize /var/folders/42/l7fg3dk55xn7jm24ld4bpkyw0000gn/T/tmp.ZKWrXmZPJ9
7882
serviceaccount/csi-snapshotter created
79-
clusterrole.rbac.authorization.k8s.io/external-snapshotter-runner created
80-
clusterrolebinding.rbac.authorization.k8s.io/csi-snapshotter-role created
8183
role.rbac.authorization.k8s.io/external-snapshotter-leaderelection created
84+
clusterrole.rbac.authorization.k8s.io/external-snapshotter-runner created
8285
rolebinding.rbac.authorization.k8s.io/external-snapshotter-leaderelection created
83-
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-resizer/v0.4.0/deploy/kubernetes/rbac.yaml
86+
clusterrolebinding.rbac.authorization.k8s.io/csi-snapshotter-role created
87+
curl https://raw.githubusercontent.com/kubernetes-csi/external-resizer/v1.13.1/deploy/kubernetes/rbac.yaml --output /var/folders/42/l7fg3dk55xn7jm24ld4bpkyw0000gn/T/tmp.ZKWrXmZPJ9/rbac.yaml --silent --location
88+
kubectl apply --kustomize /var/folders/42/l7fg3dk55xn7jm24ld4bpkyw0000gn/T/tmp.ZKWrXmZPJ9
8489
serviceaccount/csi-resizer created
85-
clusterrole.rbac.authorization.k8s.io/external-resizer-runner created
86-
clusterrolebinding.rbac.authorization.k8s.io/csi-resizer-role created
8790
role.rbac.authorization.k8s.io/external-resizer-cfg created
91+
clusterrole.rbac.authorization.k8s.io/external-resizer-runner created
8892
rolebinding.rbac.authorization.k8s.io/csi-resizer-role-cfg created
93+
clusterrolebinding.rbac.authorization.k8s.io/csi-resizer-role created
94+
curl https://raw.githubusercontent.com/kubernetes-csi/external-health-monitor/v0.14.0/deploy/kubernetes/external-health-monitor-controller/rbac.yaml --output /var/folders/42/l7fg3dk55xn7jm24ld4bpkyw0000gn/T/tmp.ZKWrXmZPJ9/rbac.yaml --silent --location
95+
kubectl apply --kustomize /var/folders/42/l7fg3dk55xn7jm24ld4bpkyw0000gn/T/tmp.ZKWrXmZPJ9
96+
serviceaccount/csi-external-health-monitor-controller created
97+
role.rbac.authorization.k8s.io/external-health-monitor-controller-cfg created
98+
clusterrole.rbac.authorization.k8s.io/external-health-monitor-controller-runner created
99+
rolebinding.rbac.authorization.k8s.io/csi-external-health-monitor-controller-role-cfg created
100+
clusterrolebinding.rbac.authorization.k8s.io/csi-external-health-monitor-controller-role created
89101
deploying hostpath components
90-
deploy/kubernetes-latest/hostpath/csi-hostpath-attacher.yaml
91-
using image: quay.io/k8scsi/csi-attacher:v2.1.0
92-
service/csi-hostpath-attacher created
93-
statefulset.apps/csi-hostpath-attacher created
94-
deploy/kubernetes-latest/hostpath/csi-hostpath-driverinfo.yaml
102+
/Users/csi-driver-host-path/deploy/kubernetes-latest/hostpath/csi-hostpath-driverinfo.yaml
95103
csidriver.storage.k8s.io/hostpath.csi.k8s.io created
96-
deploy/kubernetes-latest/hostpath/csi-hostpath-plugin.yaml
97-
using image: quay.io/k8scsi/csi-node-driver-registrar:v1.2.0
98-
using image: quay.io/k8scsi/hostpathplugin:v1.3.0
99-
using image: quay.io/k8scsi/livenessprobe:v1.1.0
100-
service/csi-hostpathplugin created
104+
/Users/csi-driver-host-path/deploy/kubernetes-latest/hostpath/csi-hostpath-plugin.yaml
105+
using image: registry.k8s.io/sig-storage/hostpathplugin:v1.15.0
106+
using image: registry.k8s.io/sig-storage/csi-external-health-monitor-controller:v0.14.0
107+
using image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.13.0
108+
using image: registry.k8s.io/sig-storage/livenessprobe:v2.15.0
109+
using image: registry.k8s.io/sig-storage/csi-attacher:v4.8.0
110+
using image: registry.k8s.io/sig-storage/csi-provisioner:v5.2.0
111+
using image: registry.k8s.io/sig-storage/csi-resizer:v1.13.1
112+
using image: registry.k8s.io/sig-storage/csi-snapshotter:v8.2.0
113+
serviceaccount/csi-hostpathplugin-sa created
114+
clusterrolebinding.rbac.authorization.k8s.io/csi-hostpathplugin-attacher-cluster-role created
115+
clusterrolebinding.rbac.authorization.k8s.io/csi-hostpathplugin-health-monitor-controller-cluster-role created
116+
clusterrolebinding.rbac.authorization.k8s.io/csi-hostpathplugin-provisioner-cluster-role created
117+
clusterrolebinding.rbac.authorization.k8s.io/csi-hostpathplugin-resizer-cluster-role created
118+
clusterrolebinding.rbac.authorization.k8s.io/csi-hostpathplugin-snapshotter-cluster-role created
119+
clusterrolebinding.rbac.authorization.k8s.io/csi-hostpathplugin-snapshot-metadata-cluster-role created
120+
rolebinding.rbac.authorization.k8s.io/csi-hostpathplugin-attacher-role created
121+
rolebinding.rbac.authorization.k8s.io/csi-hostpathplugin-health-monitor-controller-role created
122+
rolebinding.rbac.authorization.k8s.io/csi-hostpathplugin-provisioner-role created
123+
rolebinding.rbac.authorization.k8s.io/csi-hostpathplugin-resizer-role created
124+
rolebinding.rbac.authorization.k8s.io/csi-hostpathplugin-snapshotter-role created
101125
statefulset.apps/csi-hostpathplugin created
102-
deploy/kubernetes-latest/hostpath/csi-hostpath-provisioner.yaml
103-
using image: quay.io/k8scsi/csi-provisioner:v1.5.0
104-
service/csi-hostpath-provisioner created
105-
statefulset.apps/csi-hostpath-provisioner created
106-
deploy/kubernetes-latest/hostpath/csi-hostpath-resizer.yaml
107-
using image: quay.io/k8scsi/csi-resizer:v0.4.0
108-
service/csi-hostpath-resizer created
109-
statefulset.apps/csi-hostpath-resizer created
110-
deploy/kubernetes-latest/hostpath/csi-hostpath-snapshotter.yaml
111-
using image: quay.io/k8scsi/csi-snapshotter:v2.0.1
112-
service/csi-hostpath-snapshotter created
113-
statefulset.apps/csi-hostpath-snapshotter created
114-
deploy/kubernetes-latest/hostpath/csi-hostpath-testing.yaml
115-
using image: alpine/socat:1.0.3
126+
/Users/csi-driver-host-path/deploy/kubernetes-latest/hostpath/csi-hostpath-snapshotclass.yaml
127+
volumesnapshotclass.snapshot.storage.k8s.io/csi-hostpath-snapclass unchanged
128+
/Users/csi-driver-host-path/deploy/kubernetes-latest/hostpath/csi-hostpath-testing.yaml
129+
using image: registry.k8s.io/sig-storage/hostpathplugin:v1.15.0
116130
service/hostpath-service created
117131
statefulset.apps/csi-hostpath-socat created
118-
11:37:57 waiting for hostpath deployment to complete, attempt #0
119-
11:38:07 waiting for hostpath deployment to complete, attempt #1
120-
deploying snapshotclass based on snapshotter version
121-
volumesnapshotclass.snapshot.storage.k8s.io/csi-hostpath-snapclass created
132+
13:49:11 waiting for hostpath deployment to complete, attempt #0
122133
```
123134

124135
The [livenessprobe side-container](https://github.com/kubernetes-csi/livenessprobe) provided by the CSI community is deployed with the CSI driver to provide the liveness checking of the CSI services.
@@ -133,13 +144,14 @@ Replace external-resizer-runner to the role you want to modify
133144

134145
## Run example application and validate
135146

136-
Next, validate the deployment. First, ensure all expected pods are running properly including the external attacher, provisioner, snapshotter and the actual hostpath driver plugin:
147+
Next, validate the deployment.
148+
First, ensure all expected pods are running properly including the external attacher, provisioner, snapshotter and the actual hostpath driver plugin:
137149

138150
```shell
139151
$ kubectl get pods
140152
NAME READY STATUS RESTARTS AGE
141-
csi-hostpath-socat-0 1/1 Running 0 42m
142-
csi-hostpathplugin-0 8/8 Running 0 42m
153+
csi-hostpath-socat-0 1/1 Running 0 8m8s
154+
csi-hostpathplugin-0 8/8 Running 0 8m9s
143155
```
144156

145157
From the root directory, deploy the application pods including a storage class, a PVC, and a pod which mounts a volume using the Hostpath driver found in directory `./examples`:
@@ -166,71 +178,76 @@ csi-pvc Bound pvc-ad827273-8d08-430b-9d5a-e60e05a2bc3e 1Gi RWO
166178
Finally, inspect the application pod `my-csi-app` which mounts a Hostpath volume:
167179

168180
```shell
169-
$ kubectl describe pods/my-csi-app
170-
Name: my-csi-app
171-
Namespace: default
172-
Priority: 0
173-
Node: csi-prow-worker/172.17.0.2
174-
Start Time: Mon, 09 Mar 2020 14:38:05 -0700
175-
Labels: <none>
176-
Annotations: kubectl.kubernetes.io/last-applied-configuration:
177-
{"apiVersion":"v1","kind":"Pod","metadata":{"annotations":{},"name":"my-csi-app","namespace":"default"},"spec":{"containers":[{"command":[...
178-
Status: Running
179-
IP: 10.244.2.52
181+
kubectl describe pods/my-csi-app
182+
Name: my-csi-app
183+
Namespace: default
184+
Priority: 0
185+
Service Account: default
186+
Node: kind-control-plane/172.19.0.2
187+
Start Time: Sat, 29 Mar 2025 13:59:51 -0700
188+
Labels: <none>
189+
Annotations: <none>
190+
Status: Running
191+
IP: 10.244.0.22
180192
IPs:
181-
IP: 10.244.2.52
193+
IP: 10.244.0.22
182194
Containers:
183195
my-frontend:
184-
Container ID: containerd://bf82f1a3e46a29dc6507a7217f5a5fc33b4ee471d9cc09ec1e680a1e8e2fd60a
196+
Container ID: containerd://6ec737ab0ef8510a2d8c4fcbaa869a6e58785fe7bc53e8fd83740aa0244a969a
185197
Image: busybox
186-
Image ID: docker.io/library/busybox@sha256:6915be4043561d64e0ab0f8f098dc2ac48e077fe23f488ac24b665166898115a
198+
Image ID: docker.io/library/busybox@sha256:37f7b378a29ceb4c551b1b5582e27747b855bbfaa73fa11914fe0df028dc581f
187199
Port: <none>
188200
Host Port: <none>
189201
Command:
190202
sleep
191203
1000000
192204
State: Running
193-
Started: Mon, 09 Mar 2020 14:38:12 -0700
205+
Started: Sat, 29 Mar 2025 14:00:02 -0700
194206
Ready: True
195207
Restart Count: 0
196208
Environment: <none>
197209
Mounts:
198210
/data from my-csi-volume (rw)
199-
/var/run/secrets/kubernetes.io/serviceaccount from default-token-46lvh (ro)
211+
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-kwlwh (ro)
200212
Conditions:
201-
Type Status
202-
Initialized True
203-
Ready True
204-
ContainersReady True
205-
PodScheduled True
213+
Type Status
214+
PodReadyToStartContainers True
215+
Initialized True
216+
Ready True
217+
ContainersReady True
218+
PodScheduled True
206219
Volumes:
207220
my-csi-volume:
208221
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
209222
ClaimName: csi-pvc
210223
ReadOnly: false
211-
default-token-46lvh:
212-
Type: Secret (a volume populated by a Secret)
213-
SecretName: default-token-46lvh
214-
Optional: false
215-
QoS Class: BestEffort
216-
Node-Selectors: <none>
217-
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
218-
node.kubernetes.io/unreachable:NoExecute for 300s
224+
kube-api-access-kwlwh:
225+
Type: Projected (a volume that contains injected data from multiple sources)
226+
TokenExpirationSeconds: 3607
227+
ConfigMapName: kube-root-ca.crt
228+
ConfigMapOptional: <nil>
229+
DownwardAPI: true
230+
QoS Class: BestEffort
231+
Node-Selectors: <none>
232+
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
233+
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
219234
Events:
220-
Type Reason Age From Message
221-
---- ------ ---- ---- -------
222-
Normal Scheduled 106s default-scheduler Successfully assigned default/my-csi-app to csi-prow-worker
223-
Normal SuccessfulAttachVolume 106s attachdetach-controller AttachVolume.Attach succeeded for volume "pvc-ad827273-8d08-430b-9d5a-e60e05a2bc3e"
224-
Normal Pulling 102s kubelet, csi-prow-worker Pulling image "busybox"
225-
Normal Pulled 99s kubelet, csi-prow-worker Successfully pulled image "busybox"
226-
Normal Created 99s kubelet, csi-prow-worker Created container my-frontend
227-
Normal Started 99s kubelet, csi-prow-worker Started container my-frontend
235+
Type Reason Age From Message
236+
---- ------ ---- ---- -------
237+
Normal Scheduled 67s default-scheduler Successfully assigned default/my-csi-app to kind-control-plane
238+
Normal SuccessfulAttachVolume 66s attachdetach-controller AttachVolume.Attach succeeded for volume "pvc-80c31c4e-27d1-45ef-b302-8b29704f3415"
239+
Normal Pulling 57s kubelet Pulling image "busybox"
240+
Normal Pulled 56s kubelet Successfully pulled image "busybox" in 807ms (807ms including waiting). Image size: 1855985 bytes.
241+
Normal Created 56s kubelet Created container: my-frontend
242+
Normal Started 56s kubelet Started container my-frontend
228243
```
229244

230245
## Confirm Hostpath driver works
231-
The Hostpath driver is configured to create new volumes under `/csi-data-dir` inside the hostpath container that is specified in the plugin StatefulSet found [here](../deploy/kubernetes-1.22-test/hostpath/csi-hostpath-plugin.yaml). This path persist as long as the StatefulSet pod is up and running.
246+
The Hostpath driver is configured to create new volumes under `/csi-data-dir` inside the hostpath container that is specified in the plugin StatefulSet found [here](../deploy/kubernetes-1.22-test/hostpath/csi-hostpath-plugin.yaml).
247+
This path persist as long as the StatefulSet pod is up and running.
232248

233-
A file written in a properly mounted Hostpath volume inside an application should show up inside the Hostpath container. The following steps confirms that Hostpath is working properly. First, create a file from the application pod as shown:
249+
A file written in a properly mounted Hostpath volume inside an application should show up inside the Hostpath container.
250+
The following steps confirms that Hostpath is working properly. First, create a file from the application pod as shown:
234251

235252
```shell
236253
$ kubectl exec -it my-csi-app /bin/sh
@@ -247,32 +264,31 @@ Then, use the following command to locate the file. If everything works OK you s
247264

248265
```shell
249266
/ # find / -name hello-world
250-
/var/lib/kubelet/pods/34bbb561-d240-4483-a56c-efcc6504518c/volumes/kubernetes.io~csi/pvc-ad827273-8d08-430b-9d5a-e60e05a2bc3e/mount/hello-world
251-
/csi-data-dir/42bdc1e0-624e-11ea-beee-42d40678b2d1/hello-world
267+
/var/lib/kubelet/pods/907ee44d-582f-401a-bf87-8c7d42de619d/volumes/kubernetes.io~csi/pvc-80c31c4e-27d1-45ef-b302-8b29704f3415/mount/hello-world
268+
/csi-data-dir/5f8cc66b-0c52-11f0-ae3c-12a0ddb447ec/hello-world
252269
/ # exit
253270
```
254271

255272
## Confirm the creation of the VolumeAttachment object
256273
An additional way to ensure the driver is working properly is by inspecting the VolumeAttachment API object created that represents the attached volume:
257274

258275
```shell
259-
$ kubectl describe volumeattachment
260-
Name: csi-5f182b564c52cd52e04e148a1feef00d470155e051924893d3aee8c3b26b8471
276+
$ kubectl describe volumeattachment
277+
Name: csi-76020859ca347da4de55748c73810c3b1f9bbb9721651fabfacee8992a903aeb
261278
Namespace:
262279
Labels: <none>
263280
Annotations: <none>
264281
API Version: storage.k8s.io/v1
265282
Kind: VolumeAttachment
266283
Metadata:
267-
Creation Timestamp: 2020-03-09T21:38:05Z
268-
Resource Version: 10119
269-
Self Link: /apis/storage.k8s.io/v1/volumeattachments/csi-5f182b564c52cd52e04e148a1feef00d470155e051924893d3aee8c3b26b8471
270-
UID: 2d28d7e4-cda1-4ba9-a8fc-56fe081d71e9
284+
Creation Timestamp: 2025-03-29T20:59:51Z
285+
Resource Version: 131288
286+
UID: 464a73bc-b296-4d6f-8324-ec2cde6bfc41
271287
Spec:
272288
Attacher: hostpath.csi.k8s.io
273-
Node Name: csi-prow-worker
289+
Node Name: kind-control-plane
274290
Source:
275-
Persistent Volume Name: pvc-ad827273-8d08-430b-9d5a-e60e05a2bc3e
291+
Persistent Volume Name: pvc-80c31c4e-27d1-45ef-b302-8b29704f3415
276292
Status:
277293
Attached: true
278294
Events: <none>

0 commit comments

Comments
 (0)