Skip to content

Commit c748ba2

Browse files
committed
Added deployment of snapshotter to example deploy script
Having snapshotter deployed makes the example hostpath deployment more complete by also showing how to do snapshotting with it. Snapshotter pod gets similar pod-affinity as were added in previously made deployment change commit.
1 parent b2a219c commit c748ba2

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,18 @@ clusterrole.rbac.authorization.k8s.io/external-attacher-runner created
2828
clusterrolebinding.rbac.authorization.k8s.io/csi-attacher-role created
2929
role.rbac.authorization.k8s.io/external-attacher-cfg created
3030
rolebinding.rbac.authorization.k8s.io/csi-attacher-role-cfg created
31+
serviceaccount/csi-snapshotter created
32+
clusterrole.rbac.authorization.k8s.io/external-snapshotter-runner created
33+
clusterrolebinding.rbac.authorization.k8s.io/csi-snapshotter-role created
3134
deploying hostpath components
3235
service/csi-hostpath-attacher created
3336
statefulset.apps/csi-hostpath-attacher created
3437
statefulset.apps/csi-hostpathplugin created
3538
service/csi-hostpath-provisioner created
3639
statefulset.apps/csi-hostpath-provisioner created
40+
deploying snapshotter
41+
service/csi-hostpath-snapshotter created
42+
statefulset.apps/csi-hostpath-snapshotter created
3743
```
3844

3945
The script can also install CRDs that are needed for alpha features,
@@ -50,6 +56,7 @@ $ kubectl get pods
5056
NAME READY STATUS RESTARTS AGE
5157
csi-hostpath-attacher-0 1/1 Running 0 5m47s
5258
csi-hostpath-provisioner-0 1/1 Running 0 5m47s
59+
csi-hostpath-snapshotter-0 1/1 Running 0 5m47s
5360
csi-hostpathplugin-0 2/2 Running 0 5m45s
5461
```
5562

deploy/deploy-hostpath.sh

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ BASE_DIR=$(dirname "$0")
2323
K8S_RELEASE=${K8S_RELEASE:-"release-1.13"}
2424
PROVISIONER_RELEASE=${PROVISIONER_RELEASE:-$(image_version "${BASE_DIR}/hostpath/csi-hostpath-provisioner.yaml" csi-provisioner)}
2525
ATTACHER_RELEASE=${ATTACHER_RELEASE:-$(image_version "${BASE_DIR}/hostpath/csi-hostpath-attacher.yaml" csi-attacher)}
26+
SNAPSHOTTER_RELEASE=${SNAPSHOTTER_RELEASE:-$(image_version "${BASE_DIR}/snapshotter/csi-hostpath-snpshotter.yaml" csi-snapshotter)}
2627
INSTALL_CRD=${INSTALL_CRD:-"false"}
2728

2829
# apply CSIDriver and CSINodeInfo API objects
@@ -36,7 +37,12 @@ fi
3637
echo "applying RBAC rules"
3738
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-provisioner/${PROVISIONER_RELEASE}/deploy/kubernetes/rbac.yaml
3839
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-attacher/${ATTACHER_RELEASE}/deploy/kubernetes/rbac.yaml
40+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/${SNAPSHOTTER_RELEASE}/deploy/kubernetes/rbac.yaml
3941

4042
# deploy hostpath plugin and registrar sidecar
4143
echo "deploying hostpath components"
4244
kubectl apply -f ${BASE_DIR}/hostpath
45+
46+
# deploy snapshotter
47+
echo "deploying snapshotter"
48+
kubectl apply -f ${BASE_DIR}/snapshotter

deploy/snapshotter/csi-hostpath-snpshotter.yaml

+11-1
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,20 @@ spec:
2727
labels:
2828
app: csi-hostpath-snapshotter
2929
spec:
30+
affinity:
31+
podAffinity:
32+
requiredDuringSchedulingIgnoredDuringExecution:
33+
- labelSelector:
34+
matchExpressions:
35+
- key: app
36+
operator: In
37+
values:
38+
- csi-hostpathplugin
39+
topologyKey: kubernetes.io/hostname
3040
serviceAccount: csi-snapshotter
3141
containers:
3242
- name: csi-snapshotter
33-
image: quay.io/k8scsi/csi-snapshotter:v0.4.1
43+
image: quay.io/k8scsi/csi-snapshotter:v1.0.1
3444
args:
3545
- "--csi-address=$(ADDRESS)"
3646
- "--connection-timeout=15s"

0 commit comments

Comments
 (0)