Skip to content

Commit acbcc3d

Browse files
authored
Powermax resiliency changes (#421)
1 parent 43a51be commit acbcc3d

File tree

3 files changed

+214
-17
lines changed

3 files changed

+214
-17
lines changed

charts/csi-powermax/templates/controller.yaml

Lines changed: 62 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ rules:
2121
verbs: ["list", "watch", "create", "update", "patch"]
2222
- apiGroups: [""]
2323
resources: ["nodes"]
24-
verbs: ["get", "list", "watch"]
24+
{{- if eq .Values.podmon.enabled true }}
25+
verbs: [ "get", "list", "watch", "patch" ]
26+
{{- else }}
27+
verbs: [ "get", "list", "watch" ]
28+
{{- end }}
2529
- apiGroups: [""]
2630
resources: ["persistentvolumes"]
2731
verbs: ["get", "list", "watch", "create", "delete", "update", "patch" ]
@@ -34,9 +38,13 @@ rules:
3438
- apiGroups: [""]
3539
resources: ["persistentvolumeclaims/status"]
3640
verbs: ["update", "patch"]
37-
- apiGroups: ["storage.k8s.io"]
38-
resources: ["volumeattachments"]
39-
verbs: ["get", "list", "watch", "update", "patch" ]
41+
- apiGroups: [ "storage.k8s.io" ]
42+
resources: [ "volumeattachments" ]
43+
{{- if eq .Values.podmon.enabled true }}
44+
verbs: [ "get", "list", "watch", "update", "patch", "delete" ]
45+
{{- else }}
46+
verbs: [ "get", "list", "watch", "update", "patch" ]
47+
{{- end }}
4048
- apiGroups: ["storage.k8s.io"]
4149
resources: ["csinodes"]
4250
verbs: ["get", "list", "watch", "update"]
@@ -46,9 +54,15 @@ rules:
4654
- apiGroups: ["csi.storage.k8s.io"]
4755
resources: ["csinodeinfos"]
4856
verbs: ["get", "list", "watch"]
49-
- apiGroups: [""]
50-
resources: ["pods"]
51-
verbs: ["get", "list", "watch"]
57+
- apiGroups: [ "" ]
58+
resources: [ "pods" ]
59+
{{- if hasKey .Values "podmon" }}
60+
{{- if eq .Values.podmon.enabled true }}
61+
verbs: [ "get", "list", "watch", "update", "delete" ]
62+
{{- else }}
63+
verbs: [ "get", "list", "watch" ]
64+
{{- end }}
65+
{{- end }}
5266
# below for snapshotter
5367
- apiGroups: [""]
5468
resources: ["secrets"]
@@ -97,9 +111,6 @@ rules:
97111
- apiGroups: ["storage.k8s.io"]
98112
resources: ["csistoragecapacities"]
99113
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
100-
- apiGroups: [""]
101-
resources: ["pods"]
102-
verbs: ["get"]
103114
- apiGroups: ["apps"]
104115
resources: ["replicasets"]
105116
verbs: ["get"]
@@ -169,6 +180,33 @@ spec:
169180
- {{ .Release.Name }}-controller
170181
topologyKey: kubernetes.io/hostname
171182
containers:
183+
{{- if hasKey .Values "podmon" }}
184+
{{- if eq .Values.podmon.enabled true }}
185+
- name: podmon
186+
image: {{ required "Must provide the podmon container image." .Values.images.podmon }}
187+
imagePullPolicy: {{ .Values.imagePullPolicy }}
188+
args:
189+
{{- toYaml .Values.podmon.controller.args | nindent 12 }}
190+
env:
191+
- name: MY_NODE_NAME
192+
valueFrom:
193+
fieldRef:
194+
fieldPath: spec.nodeName
195+
- name: MY_POD_NAME
196+
valueFrom:
197+
fieldRef:
198+
fieldPath: metadata.name
199+
- name: MY_POD_NAMESPACE
200+
valueFrom:
201+
fieldRef:
202+
fieldPath: metadata.namespace
203+
volumeMounts:
204+
- name: socket-dir
205+
mountPath: /var/run/csi
206+
- name: powermax-config-params
207+
mountPath: /powermax-config-params
208+
{{- end }}
209+
{{- end }}
172210
- name: attacher
173211
image: {{ required "Must provide the CSI attacher container image." .Values.images.attacher }}
174212
imagePullPolicy: {{ .Values.imagePullPolicy }}
@@ -449,6 +487,20 @@ spec:
449487
name: {{ .Values.vSphere.vCenterCredSecret }}
450488
key: password
451489
{{- end }}
490+
{{- if hasKey .Values "podmon" }}
491+
- name: X_CSI_PODMON_ENABLED
492+
value: "{{ .Values.podmon.enabled }}"
493+
{{- if eq .Values.podmon.enabled true }}
494+
{{- range $key, $value := .Values.podmon.controller.args }}
495+
{{- if contains "--arrayConnectivityPollRate" $value }}
496+
- name: X_CSI_PODMON_ARRAY_CONNECTIVITY_POLL_RATE
497+
value: "{{ (split "=" $value)._1 }}"
498+
{{- end }}
499+
{{- end }}
500+
{{- end }}
501+
{{- end }}
502+
- name: X_CSI_PODMON_API_PORT
503+
value: "{{ .Values.podmon.podmonAPIPort }}"
452504
volumeMounts:
453505
- name: socket-dir
454506
mountPath: /var/run/csi

charts/csi-powermax/templates/node.yaml

Lines changed: 118 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
---
12
apiVersion: v1
23
kind: ServiceAccount
34
metadata:
4-
name: {{ .Release.Name }}-node
5-
namespace: {{ .Release.Namespace }}
5+
name: {{.Release.Name}}-node
6+
namespace: {{.Release.Namespace}}
67
---
78
kind: ClusterRole
89
apiVersion: rbac.authorization.k8s.io/v1
@@ -16,6 +17,21 @@ rules:
1617
- apiGroups: [""]
1718
resources: ["nodes"]
1819
verbs: ["get", "list", "watch", "update", "patch"]
20+
- apiGroups: [ "" ]
21+
resources: [ "persistentvolumes" ]
22+
verbs: [ "create", "delete", "get", "list", "watch", "update" ]
23+
- apiGroups: [ "" ]
24+
resources: [ "persistentvolumesclaims" ]
25+
verbs: [ "get", "list", "watch", "update" ]
26+
- apiGroups: [ "" ]
27+
resources: [ "events" ]
28+
verbs: [ "get", "list", "watch", "create", "update", "patch" ]
29+
- apiGroups: [ "storage.k8s.io" ]
30+
resources: [ "volumeattachments" ]
31+
verbs: [ "get", "list", "watch", "update" ]
32+
- apiGroups: [ "storage.k8s.io" ]
33+
resources: [ "storageclasses" ]
34+
verbs: [ "get", "list", "watch" ]
1935
{{- if eq .Values.openshift true }}
2036
- apiGroups: ["security.openshift.io"]
2137
resources: ["securitycontextconstraints"]
@@ -40,6 +56,14 @@ rules:
4056
resources: [ "pods" ]
4157
verbs: [ "get", "list", "watch", "update", "patch" ]
4258
{{- end}}
59+
#below for podmon
60+
{{- if hasKey .Values "podmon" }}
61+
{{- if eq .Values.podmon.enabled true }}
62+
- apiGroups: [ "" ]
63+
resources: [ "pods" ]
64+
verbs: [ "get", "list", "watch", "update", "delete" ]
65+
{{- end }}
66+
{{- end }}
4367
---
4468
kind: ClusterRoleBinding
4569
apiVersion: rbac.authorization.k8s.io/v1
@@ -83,6 +107,9 @@ spec:
83107
kubectl.kubernetes.io/default-container: "driver"
84108
labels:
85109
app: {{ .Release.Name }}-node
110+
{{- if .Values.podmon.enabled }}
111+
driver.dellemc.com: dell-storage
112+
{{- end }}
86113
spec:
87114
serviceAccountName: {{ .Release.Name }}-node
88115
{{ if .Values.node.nodeSelector }}
@@ -168,7 +195,7 @@ spec:
168195
{{- end }}
169196
- name: X_CSI_POWERMAX_PROXY_SERVICE_NAME
170197
value: {{ .Release.Name }}-reverseproxy
171-
- name: X_CSI_ISCSI_CHROOT
198+
- name: X_CSI_NODE_CHROOT
172199
value: {{ .Values.ISCSIChroot | default "/noderoot" }}
173200
- name: X_CSI_GRPC_MAX_THREADS
174201
value: "50"
@@ -218,12 +245,29 @@ spec:
218245
name: {{ .Values.vSphere.vCenterCredSecret }}
219246
key: password
220247
{{- end }}
248+
{{- if hasKey .Values "podmon" }}
249+
- name: X_CSI_PODMON_ENABLED
250+
value: "{{ .Values.podmon.enabled }}"
251+
{{- if eq .Values.podmon.enabled true }}
252+
{{- range $key, $value := .Values.podmon.node.args }}
253+
{{- if contains "--arrayConnectivityPollRate" $value }}
254+
- name: X_CSI_PODMON_ARRAY_CONNECTIVITY_POLL_RATE
255+
value: "{{ (split "=" $value)._1 }}"
256+
{{- end }}
257+
{{- end }}
258+
{{- end }}
259+
{{- end }}
260+
- name: X_CSI_PODMON_API_PORT
261+
value: "{{ .Values.podmon.podmonAPIPort }}"
221262
volumeMounts:
222263
- name: driver-path
223264
mountPath: {{ .Values.kubeletConfigDir }}/plugins/powermax.emc.dell.com
224265
- name: volumedevices-path
225266
mountPath: {{ .Values.kubeletConfigDir }}/plugins/kubernetes.io/csi/volumeDevices
226267
mountPropagation: "Bidirectional"
268+
- name: csi-path
269+
mountPath: {{ .Values.kubeletConfigDir }}/plugins/kubernetes.io/csi
270+
mountPropagation: "Bidirectional"
227271
- name: pods-path
228272
mountPath: {{ .Values.kubeletConfigDir }}/pods
229273
mountPropagation: "Bidirectional"
@@ -342,6 +386,58 @@ spec:
342386
mountPath: /etc/karavi-authorization
343387
{{ end }}
344388
{{ end }}
389+
{{- if hasKey .Values "podmon" }}
390+
{{- if eq .Values.podmon.enabled true }}
391+
- name: podmon
392+
securityContext:
393+
privileged: true
394+
capabilities:
395+
add: [ "SYS_ADMIN" ]
396+
allowPrivilegeEscalation: true
397+
image: {{ required "Must provide the podmon container image." .Values.images.podmon }}
398+
imagePullPolicy: {{ .Values.imagePullPolicy }}
399+
args:
400+
{{- toYaml .Values.podmon.node.args | nindent 12 }}
401+
env:
402+
- name: KUBE_NODE_NAME
403+
valueFrom:
404+
fieldRef:
405+
apiVersion: v1
406+
fieldPath: spec.nodeName
407+
- name: X_CSI_PRIVATE_MOUNT_DIR
408+
value: {{ .Values.kubeletConfigDir }}
409+
- name: MY_NODE_NAME
410+
valueFrom:
411+
fieldRef:
412+
fieldPath: spec.nodeName
413+
- name: MY_POD_NAME
414+
valueFrom:
415+
fieldRef:
416+
fieldPath: metadata.name
417+
- name: MY_POD_NAMESPACE
418+
valueFrom:
419+
fieldRef:
420+
fieldPath: metadata.namespace
421+
volumeMounts:
422+
- name: kubelet-pods
423+
mountPath: {{ .Values.kubeletConfigDir }}/pods
424+
mountPropagation: "Bidirectional"
425+
- name: driver-path
426+
mountPath: {{ .Values.kubeletConfigDir }}/plugins/powermax.emc.dell.com
427+
mountPropagation: "Bidirectional"
428+
- name: csi-path
429+
mountPath: {{ .Values.kubeletConfigDir }}/plugins/kubernetes.io/csi
430+
mountPropagation: "Bidirectional"
431+
- name: dev
432+
mountPath: /dev
433+
- name: usr-bin
434+
mountPath: /usr-bin
435+
- name: var-run
436+
mountPath: /var/run
437+
- name: powermax-config-params
438+
mountPath: /powermax-config-params
439+
{{- end }}
440+
{{- end }}
345441
volumes:
346442
- name: registration-dir
347443
hostPath:
@@ -359,6 +455,9 @@ spec:
359455
hostPath:
360456
path: {{ .Values.kubeletConfigDir }}/pods
361457
type: Directory
458+
- name: csi-path
459+
hostPath:
460+
path: {{ .Values.kubeletConfigDir }}/plugins/kubernetes.io/csi
362461
- name: dev
363462
hostPath:
364463
path: /dev
@@ -378,17 +477,17 @@ spec:
378477
- name: powermax-config-params
379478
configMap:
380479
name: {{ .Release.Name }}-config-params
480+
- name: certs
481+
secret:
482+
secretName: {{ .Release.Name }}-certs
483+
optional: true
381484
{{- if hasKey .Values.node "topologyControl" }}
382485
{{- if eq .Values.node.topologyControl.enabled true }}
383486
- name: node-topology-config
384487
configMap:
385488
name: node-topology-config
386489
{{- end }}
387490
{{- end }}
388-
- name: certs
389-
secret:
390-
secretName: {{ .Release.Name }}-certs
391-
optional: true
392491
{{- if hasKey .Values "authorization" }}
393492
{{- if eq .Values.authorization.enabled true }}
394493
- name: karavi-authorization-config
@@ -399,3 +498,15 @@ spec:
399498
secretName: proxy-server-root-certificate
400499
{{ end }}
401500
{{ end }}
501+
- name: usr-bin
502+
hostPath:
503+
path: /usr/bin
504+
type: Directory
505+
- name: kubelet-pods
506+
hostPath:
507+
path: /var/lib/kubelet/pods
508+
type: Directory
509+
- name: var-run
510+
hostPath:
511+
path: /var/run
512+
type: Directory

charts/csi-powermax/values.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ images:
6767
replication: dellemc/dell-csi-replicator:v1.9.0
6868
authorization: dellemc/csm-authorization-sidecar:v1.11.0
6969
migration: dellemc/dell-csi-migrator:v1.4.0
70+
podmon: dellemc/podmon:v1.10.0
7071
# Node rescan sidecar does a rescan on nodes for identifying new paths
7172
# Default value: dellemc/dell-csi-node-rescanner:v1.3.0
7273
noderescan: dellemc/dell-csi-node-rescanner:v1.3.0
@@ -463,3 +464,36 @@ vSphere:
463464
vCenterHost: "00.000.000.00"
464465
# vCenterCredSecret: secret name for the vCenter credentials
465466
vCenterCredSecret: vcenter-creds
467+
468+
469+
# Enable this feature only after contact support for additional information
470+
podmon:
471+
# podmonAPIPort: Defines the port to be used within the kubernetes cluster
472+
# Allowed values:
473+
# Any valid and free port.
474+
# Default value: 8083
475+
podmonAPIPort: 8083
476+
enabled: false
477+
controller:
478+
args:
479+
- "--csisock=unix:/var/run/csi/csi.sock"
480+
- "--labelvalue=csi-powermax"
481+
- "--arrayConnectivityPollRate=60"
482+
- "--driverPath=csi-powermax.dellemc.com"
483+
- "--mode=controller"
484+
- "--skipArrayConnectionValidation=false"
485+
- "--driver-config-params=/powermax-config-params/driver-config-params.yaml"
486+
- "--driverPodLabelValue=dell-storage"
487+
- "--ignoreVolumelessPods=false"
488+
489+
node:
490+
args:
491+
- "--csisock=unix:/var/lib/kubelet/plugins/powermax.emc.dell.com/csi_sock"
492+
- "--labelvalue=csi-powermax"
493+
- "--arrayConnectivityPollRate=60"
494+
- "--driverPath=csi-powermax.dellemc.com"
495+
- "--mode=node"
496+
- "--leaderelection=false"
497+
- "--driver-config-params=/powermax-config-params/driver-config-params.yaml"
498+
- "--driverPodLabelValue=dell-storage"
499+
- "--ignoreVolumelessPods=false"

0 commit comments

Comments
 (0)