Skip to content

Commit e5584fd

Browse files
committed
Update deploy specs for expansion support
1 parent 365a296 commit e5584fd

File tree

3 files changed

+60
-4
lines changed

3 files changed

+60
-4
lines changed

deploy/kubernetes-1.15/hostpath/csi-hostpath-plugin.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ spec:
6363
name: csi-data-dir
6464

6565
- name: hostpath
66-
image: quay.io/k8scsi/hostpathplugin:v1.1.0
66+
image: quay.io/k8scsi/hostpathplugin:v1.2.0-rc5
6767
args:
6868
- "--drivername=hostpath.csi.k8s.io"
6969
- "--v=5"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
kind: Service
2+
apiVersion: v1
3+
metadata:
4+
name: csi-hostpath-resizer
5+
labels:
6+
app: csi-hostpath-resizer
7+
spec:
8+
selector:
9+
app: csi-hostpath-resizer
10+
ports:
11+
- name: dummy
12+
port: 12345
13+
14+
---
15+
kind: StatefulSet
16+
apiVersion: apps/v1
17+
metadata:
18+
name: csi-hostpath-resizer
19+
spec:
20+
serviceName: "csi-hostpath-resizer"
21+
replicas: 1
22+
selector:
23+
matchLabels:
24+
app: csi-hostpath-resizer
25+
template:
26+
metadata:
27+
labels:
28+
app: csi-hostpath-resizer
29+
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
40+
serviceAccountName: csi-resizer
41+
containers:
42+
- name: csi-resizer
43+
image: quay.io/k8scsi/csi-resizer:v0.2.0
44+
args:
45+
- -v=5
46+
- -csi-address=/csi/csi.sock
47+
volumeMounts:
48+
- mountPath: /csi
49+
name: socket-dir
50+
volumes:
51+
- hostPath:
52+
path: /var/lib/kubelet/plugins/csi-hostpath
53+
type: DirectoryOrCreate
54+
name: socket-dir

deploy/util/deploy-hostpath.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# authoritative and all updates for this process should be
66
# done here and referenced elsewhere.
77

8-
# The script assumes that kubectl is available on the OS path
8+
# The script assumes that kubectl is available on the OS path
99
# where it is executed.
1010

1111
set -e
@@ -79,6 +79,8 @@ CSI_ATTACHER_RBAC_YAML="https://raw.githubusercontent.com/kubernetes-csi/externa
7979
: ${CSI_ATTACHER_RBAC:=https://raw.githubusercontent.com/kubernetes-csi/external-attacher/$(rbac_version "${BASE_DIR}/hostpath/csi-hostpath-attacher.yaml" csi-attacher "${UPDATE_RBAC_RULES}")/deploy/kubernetes/rbac.yaml}
8080
CSI_SNAPSHOTTER_RBAC_YAML="https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(rbac_version "${BASE_DIR}/hostpath/csi-hostpath-snapshotter.yaml" csi-snapshotter false)/deploy/kubernetes/rbac.yaml"
8181
: ${CSI_SNAPSHOTTER_RBAC:=https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(rbac_version "${BASE_DIR}/hostpath/csi-hostpath-snapshotter.yaml" csi-snapshotter "${UPDATE_RBAC_RULES}")/deploy/kubernetes/rbac.yaml}
82+
CSI_RESIZER_RBAC_YAML="https://raw.githubusercontent.com/kubernetes-csi/external-resizer/$(rbac_version "${BASE_DIR}/hostpath/csi-hostpath-resizer.yaml" csi-resizer false)/deploy/kubernetes/rbac.yaml"
83+
: ${CSI_RESIZER_RBAC:=https://raw.githubusercontent.com/kubernetes-csi/external-resizer/$(rbac_version "${BASE_DIR}/hostpath/csi-hostpath-resizer.yaml" csi-resizer "${UPDATE_RBAC_RULES}")/deploy/kubernetes/rbac.yaml}
8284

8385
INSTALL_CRD=${INSTALL_CRD:-"false"}
8486

@@ -95,7 +97,7 @@ run () {
9597

9698
# rbac rules
9799
echo "applying RBAC rules"
98-
for component in CSI_PROVISIONER CSI_ATTACHER CSI_SNAPSHOTTER; do
100+
for component in CSI_PROVISIONER CSI_ATTACHER CSI_SNAPSHOTTER CSI_RESIZER; do
99101
eval current="\${${component}_RBAC}"
100102
eval original="\${${component}_RBAC_YAML}"
101103
if [ "$current" != "$original" ]; then
@@ -147,7 +149,7 @@ done
147149
# Wait until all pods are running. We have to make some assumptions
148150
# about the deployment here, otherwise we wouldn't know what to wait
149151
# for: the expectation is that we run attacher, provisioner,
150-
# snapshotter, socat and hostpath plugin in the default namespace.
152+
# snapshotter, resizer, socat and hostpath plugin in the default namespace.
151153
cnt=0
152154
while [ $(kubectl get pods 2>/dev/null | grep '^csi-hostpath.* Running ' | wc -l) -lt 5 ] || ! kubectl describe volumesnapshotclasses.snapshot.storage.k8s.io 2>/dev/null >/dev/null; do
153155
if [ $cnt -gt 30 ]; then

0 commit comments

Comments
 (0)