Skip to content

Commit f696763

Browse files
authored
Merge pull request #98 from xing-yang/snapshot_beta
Add snapshot beta CRD deployment for 1.17
2 parents c9ce4f3 + c10d111 commit f696763

15 files changed

+615
-14
lines changed

deploy/kubernetes-1.17/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The deployment for Kubernetes 1.17 uses VolumeSnapshot Beta CRDs and thus is imcompatible
2+
with Kubernetes < 1.17 when the VolumeSnapshot CRDs were Alpha.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: snapshot.storage.k8s.io/v1beta1
2+
kind: VolumeSnapshotClass
3+
metadata:
4+
name: csi-hostpath-snapclass
5+
driver: hostpath.csi.k8s.io #csi-hostpath
6+
deletionPolicy: Delete
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../util/deploy-hostpath.sh
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
kind: Service
2+
apiVersion: v1
3+
metadata:
4+
name: csi-hostpath-attacher
5+
labels:
6+
app: csi-hostpath-attacher
7+
spec:
8+
selector:
9+
app: csi-hostpath-attacher
10+
ports:
11+
- name: dummy
12+
port: 12345
13+
14+
---
15+
kind: StatefulSet
16+
apiVersion: apps/v1
17+
metadata:
18+
name: csi-hostpath-attacher
19+
spec:
20+
serviceName: "csi-hostpath-attacher"
21+
replicas: 1
22+
selector:
23+
matchLabels:
24+
app: csi-hostpath-attacher
25+
template:
26+
metadata:
27+
labels:
28+
app: csi-hostpath-attacher
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-attacher
41+
containers:
42+
- name: csi-attacher
43+
image: quay.io/k8scsi/csi-attacher:v2.0.0
44+
args:
45+
- --v=5
46+
- --csi-address=/csi/csi.sock
47+
volumeMounts:
48+
- mountPath: /csi
49+
name: socket-dir
50+
51+
volumes:
52+
- hostPath:
53+
path: /var/lib/kubelet/plugins/csi-hostpath
54+
type: DirectoryOrCreate
55+
name: socket-dir
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: storage.k8s.io/v1beta1
2+
kind: CSIDriver
3+
metadata:
4+
name: hostpath.csi.k8s.io
5+
spec:
6+
# Supports persistent and ephemeral inline volumes.
7+
volumeLifecycleModes:
8+
- Persistent
9+
- Ephemeral
10+
# To determine at runtime which mode a volume uses, pod info and its
11+
# "csi.storage.k8s.io/ephemeral" entry are needed.
12+
podInfoOnMount: true
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# Service defined here, plus serviceName below in StatefulSet,
2+
# are needed only because of condition explained in
3+
# https://github.com/kubernetes/kubernetes/issues/69608
4+
5+
kind: Service
6+
apiVersion: v1
7+
metadata:
8+
name: csi-hostpathplugin
9+
labels:
10+
app: csi-hostpathplugin
11+
spec:
12+
selector:
13+
app: csi-hostpathplugin
14+
ports:
15+
- name: dummy
16+
port: 12345
17+
---
18+
kind: StatefulSet
19+
apiVersion: apps/v1
20+
metadata:
21+
name: csi-hostpathplugin
22+
spec:
23+
serviceName: "csi-hostpathplugin"
24+
# One replica only:
25+
# Host path driver only works when everything runs
26+
# on a single node. We achieve that by starting it once and then
27+
# co-locate all other pods via inter-pod affinity
28+
replicas: 1
29+
selector:
30+
matchLabels:
31+
app: csi-hostpathplugin
32+
template:
33+
metadata:
34+
labels:
35+
app: csi-hostpathplugin
36+
spec:
37+
hostNetwork: true
38+
containers:
39+
- name: node-driver-registrar
40+
image: quay.io/k8scsi/csi-node-driver-registrar:v1.2.0
41+
lifecycle:
42+
preStop:
43+
exec:
44+
command: ["/bin/sh", "-c", "rm -rf /registration/csi-hostpath /registration/csi-hostpath-reg.sock"]
45+
args:
46+
- --v=5
47+
- --csi-address=/csi/csi.sock
48+
- --kubelet-registration-path=/var/lib/kubelet/plugins/csi-hostpath/csi.sock
49+
securityContext:
50+
privileged: true
51+
env:
52+
- name: KUBE_NODE_NAME
53+
valueFrom:
54+
fieldRef:
55+
apiVersion: v1
56+
fieldPath: spec.nodeName
57+
volumeMounts:
58+
- mountPath: /csi
59+
name: socket-dir
60+
- mountPath: /registration
61+
name: registration-dir
62+
- mountPath: /csi-data-dir
63+
name: csi-data-dir
64+
65+
- name: hostpath
66+
image: quay.io/k8scsi/hostpathplugin:v1.2.0
67+
args:
68+
- "--drivername=hostpath.csi.k8s.io"
69+
- "--v=5"
70+
- "--endpoint=$(CSI_ENDPOINT)"
71+
- "--nodeid=$(KUBE_NODE_NAME)"
72+
env:
73+
- name: CSI_ENDPOINT
74+
value: unix:///csi/csi.sock
75+
- name: KUBE_NODE_NAME
76+
valueFrom:
77+
fieldRef:
78+
apiVersion: v1
79+
fieldPath: spec.nodeName
80+
securityContext:
81+
privileged: true
82+
ports:
83+
- containerPort: 9898
84+
name: healthz
85+
protocol: TCP
86+
livenessProbe:
87+
failureThreshold: 5
88+
httpGet:
89+
path: /healthz
90+
port: healthz
91+
initialDelaySeconds: 10
92+
timeoutSeconds: 3
93+
periodSeconds: 2
94+
volumeMounts:
95+
- mountPath: /csi
96+
name: socket-dir
97+
- mountPath: /var/lib/kubelet/pods
98+
mountPropagation: Bidirectional
99+
name: mountpoint-dir
100+
- mountPath: /var/lib/kubelet/plugins
101+
mountPropagation: Bidirectional
102+
name: plugins-dir
103+
- mountPath: /csi-data-dir
104+
name: csi-data-dir
105+
- mountPath: /dev
106+
name: dev-dir
107+
- name: liveness-probe
108+
volumeMounts:
109+
- mountPath: /csi
110+
name: socket-dir
111+
image: quay.io/k8scsi/livenessprobe:v1.1.0
112+
args:
113+
- --csi-address=/csi/csi.sock
114+
- --connection-timeout=3s
115+
- --health-port=9898
116+
117+
volumes:
118+
- hostPath:
119+
path: /var/lib/kubelet/plugins/csi-hostpath
120+
type: DirectoryOrCreate
121+
name: socket-dir
122+
- hostPath:
123+
path: /var/lib/kubelet/pods
124+
type: DirectoryOrCreate
125+
name: mountpoint-dir
126+
- hostPath:
127+
path: /var/lib/kubelet/plugins_registry
128+
type: Directory
129+
name: registration-dir
130+
- hostPath:
131+
path: /var/lib/kubelet/plugins
132+
type: Directory
133+
name: plugins-dir
134+
- hostPath:
135+
# 'path' is where PV data is persisted on host.
136+
# using /tmp is also possible while the PVs will not available after plugin container recreation or host reboot
137+
path: /var/lib/csi-hostpath-data/
138+
type: DirectoryOrCreate
139+
name: csi-data-dir
140+
- hostPath:
141+
path: /dev
142+
type: Directory
143+
name: dev-dir
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
kind: Service
2+
apiVersion: v1
3+
metadata:
4+
name: csi-hostpath-provisioner
5+
labels:
6+
app: csi-hostpath-provisioner
7+
spec:
8+
selector:
9+
app: csi-hostpath-provisioner
10+
ports:
11+
- name: dummy
12+
port: 12345
13+
14+
---
15+
kind: StatefulSet
16+
apiVersion: apps/v1
17+
metadata:
18+
name: csi-hostpath-provisioner
19+
spec:
20+
serviceName: "csi-hostpath-provisioner"
21+
replicas: 1
22+
selector:
23+
matchLabels:
24+
app: csi-hostpath-provisioner
25+
template:
26+
metadata:
27+
labels:
28+
app: csi-hostpath-provisioner
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-provisioner
41+
containers:
42+
- name: csi-provisioner
43+
image: quay.io/k8scsi/csi-provisioner:v1.5.0-rc1
44+
args:
45+
- -v=5
46+
- --csi-address=/csi/csi.sock
47+
- --feature-gates=Topology=true
48+
volumeMounts:
49+
- mountPath: /csi
50+
name: socket-dir
51+
volumes:
52+
- hostPath:
53+
path: /var/lib/kubelet/plugins/csi-hostpath
54+
type: DirectoryOrCreate
55+
name: socket-dir
Lines changed: 54 additions & 0 deletions
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.3.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
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
kind: Service
2+
apiVersion: v1
3+
metadata:
4+
name: csi-hostpath-snapshotter
5+
labels:
6+
app: csi-hostpath-snapshotter
7+
spec:
8+
selector:
9+
app: csi-hostpath-snapshotter
10+
ports:
11+
- name: dummy
12+
port: 12345
13+
14+
---
15+
kind: StatefulSet
16+
apiVersion: apps/v1
17+
metadata:
18+
name: csi-hostpath-snapshotter
19+
spec:
20+
serviceName: "csi-hostpath-snapshotter"
21+
replicas: 1
22+
selector:
23+
matchLabels:
24+
app: csi-hostpath-snapshotter
25+
template:
26+
metadata:
27+
labels:
28+
app: csi-hostpath-snapshotter
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+
serviceAccount: csi-snapshotter
41+
containers:
42+
- name: csi-snapshotter
43+
# TODO: change to official image when released
44+
image: quay.io/k8scsi/csi-snapshotter:v2.0.0-rc2
45+
imagePullPolicy: IfNotPresent
46+
args:
47+
- -v=5
48+
- --csi-address=/csi/csi.sock
49+
volumeMounts:
50+
- mountPath: /csi
51+
name: socket-dir
52+
volumes:
53+
- hostPath:
54+
path: /var/lib/kubelet/plugins/csi-hostpath
55+
type: DirectoryOrCreate
56+
name: socket-dir

0 commit comments

Comments
 (0)