-
Notifications
You must be signed in to change notification settings - Fork 17
/
node.yaml
429 lines (429 loc) · 14.7 KB
/
node.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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Release.Name }}-node
namespace: {{ .Release.Namespace }}
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ .Release.Name }}-node
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["create", "delete", "get", "list", "watch", "update"]
- apiGroups: [""]
resources: ["persistentvolumesclaims"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["security.openshift.io"]
resourceNames: ["privileged"]
resources: ["securitycontextconstraints"]
verbs: ["use"]
{{- if hasKey .Values "podmon" }}
{{- if eq .Values.podmon.enabled true }}
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch", "update", "delete"]
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]
{{ end }}
{{ end }}
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ .Release.Name }}-node
subjects:
- kind: ServiceAccount
name: {{ .Release.Name }}-node
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ .Release.Name }}-node
apiGroup: rbac.authorization.k8s.io
---
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: {{ .Release.Name }}-node
namespace: {{ .Release.Namespace }}
{{- if hasKey .Values "authorization" }}
{{- if eq .Values.authorization.enabled true }}
annotations:
com.dell.karavi-authorization-proxy: "true"
{{ end }}
{{ end }}
spec:
selector:
matchLabels:
app: {{ .Release.Name }}-node
template:
metadata:
labels:
app: {{ .Release.Name }}-node
{{- if eq .Values.podmon.enabled true }}
driver.dellemc.com: dell-storage
{{- end }}
annotations:
kubectl.kubernetes.io/default-container: "driver"
spec:
{{- if .Values.node.nodeSelector }}
nodeSelector:
{{- toYaml .Values.node.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.node.tolerations }}
tolerations:
{{- toYaml .Values.node.tolerations | nindent 6 }}
{{- end }}
serviceAccount: {{ .Release.Name }}-node
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: true
{{- if and .Values.monitor.enabled .Values.monitor.hostPID }}
hostPID: true
{{- else }}
hostPID: false
{{- end }}
containers:
{{- if hasKey .Values "podmon" }}
{{- if eq .Values.podmon.enabled true }}
- name: podmon
securityContext:
privileged: true
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: {{ required "Must provide the podmon container image." .Values.images.podmon }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
{{- toYaml .Values.podmon.node.args | nindent 12 }}
env:
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: X_CSI_PRIVATE_MOUNT_DIR
value: "{{ .Values.kubeletConfigDir }}/plugins/vxflexos.emc.dell.com/disks"
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MY_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
volumeMounts:
- name: kubelet-pods
mountPath: {{ .Values.kubeletConfigDir }}/pods
mountPropagation: "Bidirectional"
- name: driver-path
mountPath: {{ .Values.kubeletConfigDir }}/plugins/vxflexos.emc.dell.com
mountPropagation: "Bidirectional"
- name: usr-bin
mountPath: /usr-bin
- name: var-run
mountPath: /var/run
- name: vxflexos-config-params
mountPath: /vxflexos-config-params
{{- end }}
{{- end }}
{{- if hasKey .Values "authorization" }}
{{- if eq .Values.authorization.enabled true }}
- name: karavi-authorization-proxy
image: {{ required "Must provide the authorization sidecar container image." .Values.images.authorization }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
env:
- name: PROXY_HOST
value: "{{ .Values.authorization.proxyHost }}"
- name: SKIP_CERTIFICATE_VALIDATION
value: "{{ .Values.authorization.skipCertificateValidation }}"
- name: PLUGIN_IDENTIFIER
value: powerflex
- name: ACCESS_TOKEN
valueFrom:
secretKeyRef:
name: proxy-authz-tokens
key: access
- name: REFRESH_TOKEN
valueFrom:
secretKeyRef:
name: proxy-authz-tokens
key: refresh
volumeMounts:
- name: karavi-authorization-config
mountPath: /etc/karavi-authorization/config
- name: proxy-server-root-certificate
mountPath: /etc/karavi-authorization/root-certificates
- name: vxflexos-config-params
mountPath: /etc/karavi-authorization
{{ end }}
{{ end }}
- name: driver
securityContext:
privileged: true
allowPrivilegeEscalation: true
capabilities:
add: ["SYS_ADMIN"]
image: "{{ required "Must provide the driver image repository." .Values.images.driver }}"
imagePullPolicy: {{ .Values.imagePullPolicy }}
command: [ "/csi-vxflexos.sh" ]
args:
- "--array-config=/vxflexos-config/config"
- "--driver-config-params=/vxflexos-config-params/driver-config-params.yaml"
env:
- name: CSI_ENDPOINT
value: unix://{{ .Values.kubeletConfigDir }}/plugins/vxflexos.emc.dell.com/csi_sock
- name: X_CSI_MODE
value: node
- name: X_CSI_PRIVATE_MOUNT_DIR
value: "{{ .Values.kubeletConfigDir }}/plugins/vxflexos.emc.dell.com/disks"
- name: X_CSI_ALLOW_RWO_MULTI_POD_ACCESS
value: "{{ required "Must provide a true/false string to allow RWO multi pod access." .Values.allowRWOMultiPodAccess }}"
- name: X_CSI_MAX_VOLUMES_PER_NODE
value: "{{ .Values.maxVxflexosVolumesPerNode }}"
- name: SSL_CERT_DIR
value: /certs
{{- if hasKey .Values.node "healthMonitor" }}
- name: X_CSI_HEALTH_MONITOR_ENABLED
value: "{{ .Values.node.healthMonitor.enabled }}"
{{- end }}
{{- if hasKey .Values.node "approveSDC" }}
- name: X_CSI_APPROVE_SDC_ENABLED
value: "{{ .Values.node.approveSDC.enabled }}"
{{- end }}
{{- if hasKey .Values.node "renameSDC" }}
- name: X_CSI_RENAME_SDC_ENABLED
value: "{{ .Values.node.renameSDC.enabled }}"
{{- if eq .Values.node.renameSDC.enabled true }}
- name: X_CSI_RENAME_SDC_PREFIX
value: "{{ .Values.node.renameSDC.prefix }}"
{{- end }}
{{- end }}
- name: X_CSI_POWERFLEX_KUBE_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
volumeMounts:
- name: driver-path
mountPath: {{ .Values.kubeletConfigDir }}/plugins/vxflexos.emc.dell.com
- name: volumedevices-path
mountPath: {{ .Values.kubeletConfigDir }}/plugins/kubernetes.io/csi/volumeDevices
mountPropagation: "Bidirectional"
- name: pods-path
mountPath: {{ .Values.kubeletConfigDir }}/pods
mountPropagation: "Bidirectional"
- name: noderoot
mountPath: /noderoot
- name: dev
mountPath: /dev
- name: vxflexos-config
mountPath: /vxflexos-config
- name: vxflexos-config-params
mountPath: /vxflexos-config-params
{{- if ge (int .Values.certSecretCount) 1 }}
- name: certs
mountPath: /certs
readOnly: true
{{- end}}
- name: registrar
image: {{ required "Must provide the CSI registrar container image." .Values.images.registrar }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
- --kubelet-registration-path={{ .Values.kubeletConfigDir }}/plugins/vxflexos.emc.dell.com/csi_sock
env:
- name: ADDRESS
value: /csi/csi_sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
volumeMounts:
- name: registration-dir
mountPath: /registration
- name: driver-path
mountPath: /csi
{{- if eq .Values.monitor.enabled true }}
- name: sdc-monitor
securityContext:
privileged: true
image: {{ required "Must provide the PowerFlex SDC container image." .Values.images.powerflexSdc }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
env:
{{ if eq .Values.monitor.hostPID true }}
- name: HOST_PID
value: "1"
{{ else }}
- name: HOST_PID
value: "0"
{{ end }}
- name: HOST_NET
value: "1"
- name: NODENAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: MDM
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-config
key: MDM
- name: MODE
value: "monitoring"
volumeMounts:
- name: dev
mountPath: /dev
- name: os-release
mountPath: /host-os-release
- name: sdc-storage
mountPath: /storage
- name: udev-d
mountPath: /rules.d
- name: host-opt-emc-path
mountPath: /host_opt_emc_path
{{- end }}
initContainers:
- name: sdc
securityContext:
privileged: true
image: {{ required "Must provide the PowerFlex SDC container image." .Values.images.powerflexSdc }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
env:
- name: NODENAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: MODE
value: "config"
- name: MDM
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-config
key: MDM
- name: HOST_DRV_CFG_PATH
value: /opt/emc/scaleio/sdc/bin
volumeMounts:
- name: dev
mountPath: /dev
- name: os-release
mountPath: /host-os-release
- name: host-opt-emc-path
mountPath: /host_opt_emc_path
- name: sdc-storage
mountPath: /storage
- name: udev-d
mountPath: /rules.d
- name: scaleio-path-opt
mountPath: /host_drv_cfg_path
volumes:
- name: registration-dir
hostPath:
path: {{ .Values.kubeletConfigDir }}/plugins_registry/
type: DirectoryOrCreate
- name: driver-path
hostPath:
path: {{ .Values.kubeletConfigDir }}/plugins/vxflexos.emc.dell.com
type: DirectoryOrCreate
- name: volumedevices-path
hostPath:
path: {{ .Values.kubeletConfigDir }}/plugins/kubernetes.io/csi/volumeDevices
type: DirectoryOrCreate
- name: pods-path
hostPath:
path: {{ .Values.kubeletConfigDir }}/pods
type: Directory
- name: noderoot
hostPath:
path: /
type: Directory
- name: dev
hostPath:
path: /dev
type: Directory
- name: scaleio-path-opt
hostPath:
path: /opt/emc/scaleio/sdc/bin
type: DirectoryOrCreate
- name: sdc-storage
hostPath:
path: /var/emc-scaleio
type: DirectoryOrCreate
- name: udev-d
hostPath:
path: /etc/udev/rules.d
type: Directory
- name: os-release
hostPath:
path: /etc/os-release
type: File
- name: host-opt-emc-path
hostPath:
path: /opt/emc
type: Directory
- name: vxflexos-config
secret:
secretName: {{ .Release.Name }}-config
- name: vxflexos-config-params
configMap:
name: {{ .Release.Name }}-config-params
{{- if ge (int .Values.certSecretCount) 1 }}
- name: certs
projected:
sources:
{{- range $i, $e := until (int .Values.certSecretCount ) }}
- secret:
name: {{ print $.Release.Name "-certs-" $e }}
items:
- key: cert-{{ $e }}
path: cert-{{ $e }}
{{- end }}
{{- end }}
{{- if hasKey .Values "authorization" }}
{{- if eq .Values.authorization.enabled true }}
- name: karavi-authorization-config
secret:
secretName: karavi-authorization-config
- name: proxy-server-root-certificate
secret:
secretName: proxy-server-root-certificate
{{ end }}
{{ end }}
{{- if hasKey .Values "podmon" }}
{{- if eq .Values.podmon.enabled true }}
- name: usr-bin
hostPath:
path: /usr/bin
type: Directory
- name: kubelet-pods
hostPath:
path: /var/lib/kubelet/pods
type: Directory
- name: var-run
hostPath:
path: /var/run
type: Directory
{{- end }}
{{- end }}