forked from hpe-storage/co-deployments
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhpecv-flexvolume-driver.yaml
284 lines (273 loc) · 7.45 KB
/
hpecv-flexvolume-driver.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
---
#### HPE Dynamic Provisioner ###
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: hpe-dynamic-provisioner
namespace: kube-system
labels:
app: hpe-dynamic-provisioner
spec:
strategy:
type: RollingUpdate
template:
metadata:
labels:
daemon: hpe-dynamic-provisioner-daemon
name: hpe-dynamic-provisioner
spec:
restartPolicy: Always
serviceAccountName: hpe-dynamic-provisioner-sa
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
containers:
-
image: hpestorage/k8s-dynamic-provisioner:canary
imagePullPolicy: Always
name: hpe-dynamic-provisioner
volumeMounts:
- name: k8s
mountPath: /etc/kubernetes
- name: flexvolumedriver
mountPath: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
- name: hpeconfig
mountPath: /etc/hpe-storage
- name: varlog
mountPath: /var/log
securityContext:
privileged: true
volumes:
- name: k8s
hostPath:
path: /etc/kubernetes
- name: flexvolumedriver
hostPath:
path: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
- name: hpeconfig
hostPath:
path: /etc/hpe-storage
- name: varlog
hostPath:
path: /var/log
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: hpe-dynamic-provisioner-sa
namespace: kube-system
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: hpe-dynamic-provisioner-role
namespace: kube-system
rules:
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete", "update"]
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: hpe-dynamic-provisioner-binding
subjects:
- kind: ServiceAccount
name: hpe-dynamic-provisioner-sa
namespace: kube-system
roleRef:
kind: ClusterRole
name: hpe-dynamic-provisioner-role
apiGroup: rbac.authorization.k8s.io
---
### Flexvolume Driver ###
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: hpe-flexvolume-driver
namespace: kube-system
labels:
k8s-app: hpe-flexvolume-driver
spec:
selector:
matchLabels:
name: hpe-flexvolume-driver
template:
metadata:
labels:
name: hpe-flexvolume-driver
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: nimblevolumed
image: hpestorage/flexvolume-driver:canary
imagePullPolicy: "Always"
lifecycle:
preStop:
# create empty file to let plugin signal handler to perform cleanup of config/cert/dory files
exec:
command: [ "/bin/sh", "-c", "touch /etc/hpe-storage/remove" ]
env:
- name: LOG_LEVEL
value: debug
- name: PROVIDER_SERVICE
valueFrom:
secretKeyRef:
name: hpe-secret
key: serviceName
- name: PROVIDER_USERNAME
valueFrom:
secretKeyRef:
name: hpe-secret
key: username
- name: PROVIDER_PASSWORD
valueFrom:
secretKeyRef:
name: hpe-secret
key: password
- name: PROVIDER_PORT
valueFrom:
secretKeyRef:
name: hpe-secret
key: servicePort
- name: SERVICE_NAME
valueFrom:
secretKeyRef:
name: hpe-secret
key: serviceName
- name: PROTOCOL
value: iscsi
- name: SCOPE
value: global
- name: PLUGIN_TYPE
value: cv
volumeMounts:
- name: podsmountdir
mountPath: /var/lib/kubelet
mountPropagation: Bidirectional
- name: ocpmountsdir
mountPath: /var/lib/origin
mountPropagation: Bidirectional
- name: legacymounts
mountPath: /opt/nimble
mountPropagation: Bidirectional
- name: dev
mountPath: /dev
- name: libmodules
mountPath: /lib/modules
- name: var-log
mountPath: /var/log
- name: var-lib-iscsi
mountPath: /var/lib/iscsi
- name: exec
mountPath: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
- name: runlock
mountPath: /run/lock
- name: etc-iscsi
mountPath: /etc/iscsi
- name: etc-multipath
mountPath: /etc/multipath
- name: etc-multipath-conf
mountPath: /etc/multipath.conf
- name: etc-redhat-release
mountPath: /etc/redhat-release
- name: etc-os-release
mountPath: /etc/os-release
- name: etc-hpe-storage-dir
mountPath: /etc/hpe-storage
- name: sys
mountPath: /sys
- name: iscsiadm
mountPath: /sbin/iscsiadm
- name: config-file
mountPath: /etc/hpe-storage/volume-driver.json
subPath: volume-driver.json
- name: runsystemd
mountPath: /run/systemd
- name: libsystemd
mountPath: /lib/systemd/system
- name: usrlocal
mountPath: /usr_local
securityContext:
privileged: true
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
volumes:
- name: podsmountdir
hostPath:
path: /var/lib/kubelet
- name: ocpmountsdir
hostPath:
path: /var/lib/origin
# required to handle legacy mounts from NLT based plugin. Remove this for CoreOS
- name: legacymounts
hostPath:
path: /opt/nimble
- name: dev
hostPath:
path: /dev
- name: libmodules
hostPath:
path: /lib/modules
- name: var-log
hostPath:
path: /var/log
- name: var-lib-iscsi
hostPath:
path: /var/lib/iscsi
- name: exec
hostPath:
path: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
- name: runlock
hostPath:
path: /run/lock
- name: etc-iscsi
hostPath:
path: /etc/iscsi
- name: etc-multipath
hostPath:
path: /etc/multipath
- name: etc-multipath-conf
hostPath:
path: /etc/multipath.conf
type: FileOrCreate
- name: etc-redhat-release
hostPath:
path: /etc/redhat-release
type: FileOrCreate
- name: etc-os-release
hostPath:
path: /etc/os-release
type: FileOrCreate
- name: etc-hpe-storage-dir
hostPath:
path: /etc/hpe-storage
- name: sys
hostPath:
path: /sys
- name: iscsiadm
hostPath:
path: /sbin/iscsiadm
type: FileOrCreate
- name: config-file
configMap:
name: hpe-config
- name: runsystemd
hostPath:
path: /run/systemd
- name: libsystemd
hostPath:
path: /lib/systemd/system
- name: usrlocal
hostPath:
path: /usr