Skip to content

Commit

Permalink
Merge branch 'release-v1.8.0' into remove-replication-init-container
Browse files Browse the repository at this point in the history
  • Loading branch information
santhoshatdell authored Jul 31, 2023
2 parents f2ca259 + 19e445d commit 83862b4
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
8 changes: 8 additions & 0 deletions charts/csi-powermax/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,11 @@ Return the appropriate sidecar images based on k8s version
{{- end -}}
{{- end -}}
{{- end -}}

{{- define "csi-powermax.isStorageCapacitySupported" -}}
{{- if eq .Values.storageCapacity.enabled true -}}
{{- if and (eq .Capabilities.KubeVersion.Major "1") (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "24") -}}
{{- true -}}
{{- end -}}
{{- end -}}
{{- end -}}
27 changes: 25 additions & 2 deletions charts/csi-powermax/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,19 @@ rules:
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["create", "delete", "get", "list", "watch", "update", "patch"]
{{- end}}
{{- end}}
# Permissions for Storage Capacity
{{- if eq (include "csi-powermax.isStorageCapacitySupported" .) "true" }}
- apiGroups: ["storage.k8s.io"]
resources: ["csistoragecapacities"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get"]
- apiGroups: ["apps"]
resources: ["replicasets"]
verbs: ["get"]
{{- end }}
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand Down Expand Up @@ -184,9 +196,20 @@ spec:
- "--leader-election"
- "--extra-create-metadata"
- "--feature-gates=Topology=true"
- "--enable-capacity={{ (include "csi-powermax.isStorageCapacitySupported" .) | default false }}"
- "--capacity-ownerref-level=2"
- "--capacity-poll-interval={{ .Values.storageCapacity.pollInterval | default "5m" }}"
env:
- name: ADDRESS
value: /var/run/csi/csi.sock
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
volumeMounts:
- name: socket-dir
mountPath: /var/run/csi
Expand Down Expand Up @@ -487,4 +510,4 @@ spec:
secret:
secretName: proxy-server-root-certificate
{{ end }}
{{ end }}
{{ end }}
4 changes: 3 additions & 1 deletion charts/csi-powermax/templates/csidriver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ metadata:
name: csi-powermax
{{- end }}
spec:
podInfoOnMount: true
attachRequired: true
fsGroupPolicy: {{ .Values.fsGroupPolicy }}
storageCapacity: {{ (include "csi-powermax.isStorageCapacitySupported" .) | default false }}
fsGroupPolicy: {{ .Values.fsGroupPolicy }}
14 changes: 14 additions & 0 deletions charts/csi-powermax/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,20 @@ authorization:
# Default value: "true"
skipCertificateValidation: true

# Storage Capacity Tracking
# Note: Capacity tracking is supported in kubernetes v1.24 and above, this feature will be automatically disabled in older versions.
storageCapacity:
# enabled : Enable/Disable storage capacity tracking
# Allowed values:
# true: enable storage capacity tracking
# false: disable storage capacity tracking
# Default value: true
enabled: true
# pollInterval : Configure how often external-provisioner polls the driver to detect changed capacity
# Allowed values: 1m,2m,3m,...,10m,...,60m etc
# Default value: 5m
pollInterval: 5m

# VMware/vSphere virtualization support
# set enable to true, if you to enable VMware virtualized environment support via RDM
# Allowed Values:
Expand Down

0 comments on commit 83862b4

Please sign in to comment.