Skip to content

Commit

Permalink
[charts/csi-powermax] Container images in one place (#309)
Browse files Browse the repository at this point in the history
* One place to configure all images
* Fix the csi provisioner to use the full name
* Use latest versions of CSI official sidecars
  • Loading branch information
coulof authored Oct 31, 2023
1 parent 91d94d2 commit 0ceea2a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 82 deletions.
50 changes: 0 additions & 50 deletions charts/csi-powermax/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,53 +1,3 @@
{{/*
Return the appropriate sidecar images based on k8s version
*/}}
{{- define "csi-powermax.attacherImage" -}}
{{- if eq .Capabilities.KubeVersion.Major "1" }}
{{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "23") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "28") -}}
{{- print "registry.k8s.io/sig-storage/csi-attacher:v4.3.0" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- define "csi-powermax.provisionerImage" -}}
{{- if eq .Capabilities.KubeVersion.Major "1" }}
{{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "23") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "28") -}}
{{- print "registry.k8s.io/sig-storage/csi-provisioner:v3.5.0" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- define "csi-powermax.snapshotterImage" -}}
{{- if eq .Capabilities.KubeVersion.Major "1" }}
{{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "23") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "28") -}}
{{- print "registry.k8s.io/sig-storage/csi-snapshotter:v6.2.2" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- define "csi-powermax.resizerImage" -}}
{{- if eq .Capabilities.KubeVersion.Major "1" }}
{{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "23") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "28") -}}
{{- print "registry.k8s.io/sig-storage/csi-resizer:v1.8.0" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- define "csi-powermax.registrarImage" -}}
{{- if eq .Capabilities.KubeVersion.Major "1" }}
{{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "23") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "28") -}}
{{- print "registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.8.0" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- define "csi-powermax.healthmonitorImage" -}}
{{- if eq .Capabilities.KubeVersion.Major "1" }}
{{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "23") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "28") -}}
{{- print "registry.k8s.io/sig-storage/csi-external-health-monitor-controller:v0.9.0" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- define "csi-powermax.isStorageCapacitySupported" -}}
{{- if eq .Values.storageCapacity.enabled true -}}
Expand Down
20 changes: 10 additions & 10 deletions charts/csi-powermax/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ spec:
topologyKey: kubernetes.io/hostname
containers:
- name: attacher
image: {{ required "Must provide the CSI attacher container image." ( include "csi-powermax.attacherImage" . ) }}
image: {{ required "Must provide the CSI attacher container image." .Values.images.attacher }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- "--csi-address=$(ADDRESS)"
Expand All @@ -183,7 +183,7 @@ spec:
- name: socket-dir
mountPath: /var/run/csi
- name: provisioner
image: {{ required "Must provide the CSI provisioner container image." ( include "csi-powermax.provisionerImage" . ) }}
image: {{ required "Must provide the CSI provisioner container image." .Values.images.provisioner }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- "--csi-address=$(ADDRESS)"
Expand Down Expand Up @@ -216,7 +216,7 @@ spec:
{{- if hasKey .Values.controller "snapshot" }}
{{- if eq .Values.controller.snapshot.enabled true }}
- name: snapshotter
image: {{ required "Must provide the CSI snapshotter container image." ( include "csi-powermax.snapshotterImage" . ) }}
image: {{ required "Must provide the CSI snapshotter container image." .Values.images.snapshotter }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- "--csi-address=$(ADDRESS)"
Expand All @@ -235,7 +235,7 @@ spec:
{{- end }}
{{- if eq .Values.replication.enabled true}}
- name: dell-csi-replicator
image: {{ required "Must provide the Dell CSI Replicator Resizer image." .Values.replication.image}}
image: {{ required "Must provide the Dell CSI Replicator Resizer image." .Values.images.replication }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- "--csi-address=$(ADDRESS)"
Expand All @@ -261,7 +261,7 @@ spec:
{{- end }}
{{- if eq .Values.migration.enabled true}}
- name: dell-csi-migrator
image: {{ required "Must provide the Dell CSI Migrator Resizer image." .Values.migration.image}}
image: {{ required "Must provide the Dell CSI Migrator Resizer image." .Values.images.migration }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- "--csi-address=$(ADDRESS)"
Expand All @@ -287,7 +287,7 @@ spec:
{{- if hasKey .Values.controller "resizer" }}
{{- if eq .Values.controller.resizer.enabled true }}
- name: resizer
image: {{ required "Must provide the CSI resizer container image." ( include "csi-powermax.resizerImage" . ) }}
image: {{ required "Must provide the CSI resizer container image." .Values.images.resizer }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- "--csi-address=$(ADDRESS)"
Expand All @@ -306,7 +306,7 @@ spec:
{{- if eq .Values.authorization.enabled true }}
- name: karavi-authorization-proxy
imagePullPolicy: {{ .Values.imagePullPolicy }}
image: {{ required "Must provide the authorization sidecar container image." .Values.authorization.sidecarProxyImage }}
image: {{ required "Must provide the authorization sidecar container image." .Values.images.authorization }}
env:
- name: PROXY_HOST
value: "{{ .Values.authorization.proxyHost }}"
Expand Down Expand Up @@ -337,7 +337,7 @@ spec:
{{- if eq .Values.controller.healthMonitor.enabled true }}
- name: csi-external-health-monitor-controller
imagePullPolicy: {{ .Values.imagePullPolicy }}
image: {{ required "Must provide the CSI external health monitor controller image." ( include "csi-powermax.healthmonitorImage" . ) }}
image: {{ required "Must provide the CSI external health monitor controller image." .Values.images.healthmonitor }}
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
Expand All @@ -355,7 +355,7 @@ spec:
{{- end }}
{{- end }}
- name: driver
image: {{ required "Must provide the PowerMax driver image repository." .Values.images.driverRepository }}/{{ .Chart.Name }}:{{ .Values.version }}
image: {{ required "Must provide the PowerMax driver image repository." .Values.images.driver }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
command: [ "/csi-powermax.sh" ]
args:
Expand Down Expand Up @@ -459,7 +459,7 @@ spec:
mountPath: /powermax-config-params
{{- if eq .Values.csireverseproxy.deployAsSidecar true }}
- name: reverseproxy
image: {{ required "Must provided an image for reverseproxy container." .Values.csireverseproxy.image }}
image: {{ required "Must provided an image for reverseproxy container." .Values.images.csireverseproxy }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
env:
- name: X_CSI_REVPROXY_CONFIG_DIR
Expand Down
2 changes: 1 addition & 1 deletion charts/csi-powermax/templates/csidriver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
{{- if eq .Values.customDriverName.enabled true}}
name: {{ printf "%s-%s" .Release.Namespace .Values.customDriverName.value }}
{{- else }}
name: csi-powermax
name: csi-powermax.dellemc.com
{{- end }}
spec:
podInfoOnMount: true
Expand Down
8 changes: 4 additions & 4 deletions charts/csi-powermax/templates/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ spec:
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: {{ required "Must provide the PowerMax driver image repository." .Values.images.driverRepository }}/{{ .Chart.Name }}:{{ .Values.version }}
image: {{ required "Must provide the PowerMax driver image repository." .Values.images.driver }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
command: [ "/csi-powermax.sh" ]
env:
Expand Down Expand Up @@ -245,7 +245,7 @@ spec:
{{- end }}
{{- end }}
- name: registrar
image: {{ required "Must provide the CSI node registrar container image." ( include "csi-powermax.registrarImage" . ) }}
image: {{ required "Must provide the CSI node registrar container image." .Values.images.registrar }}
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
Expand Down Expand Up @@ -275,7 +275,7 @@ spec:
add: [ "SYS_ADMIN" ]
allowPrivilegeEscalation: true
imagePullPolicy: {{ .Values.imagePullPolicy }}
image: {{ required "Must provide the node rescanner sidecar container image." .Values.migration.nodeRescanSidecarImage }}
image: {{ required "Must provide the node rescanner sidecar container image." .Values.images.noderescan }}
args:
- "--csi-address=$(ADDRESS)"
- "--retry-interval-start=1s"
Expand Down Expand Up @@ -313,7 +313,7 @@ spec:
{{- if eq .Values.authorization.enabled true }}
- name: karavi-authorization-proxy
imagePullPolicy: {{ .Values.imagePullPolicy }}
image: {{ required "Must provide the authorization sidecar container image." .Values.authorization.sidecarProxyImage }}
image: {{ required "Must provide the authorization sidecar container image." .Values.images.authorization }}
env:
- name: PROXY_HOST
value: "{{ .Values.authorization.proxyHost }}"
Expand Down
35 changes: 18 additions & 17 deletions charts/csi-powermax/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,26 @@ global:
# Don't modify this value as this value will be used by the install script
version: "v2.8.0"

# "images" defines every container images used for the driver and its sidecars.
# To use your own images, or a private registry, change the values here.
images:
# "driver" defines the container image, used for the driver container.
driverRepository: dellemc
driver: dellemc/csi-powermax:v2.8.0
csireverseproxy: dellemc/csipowermax-reverseproxy:v2.7.0
# CSI sidecars
attacher: registry.k8s.io/sig-storage/csi-attacher:v4.4.0
provisioner: registry.k8s.io/sig-storage/csi-provisioner:v3.6.0
snapshotter: registry.k8s.io/sig-storage/csi-snapshotter:v6.3.0
resizer: registry.k8s.io/sig-storage/csi-resizer:v1.9.0
registrar: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.9.0
healthmonitor: registry.k8s.io/sig-storage/csi-external-health-monitor-controller:v0.10.0
# CSM sidecars
replication: dellemc/dell-csi-replicator:v1.6.0
authorization: dellemc/csm-authorization-sidecar:v1.8.0
migration: dellemc/dell-csi-migrator:v1.2.0
# Node rescan sidecar does a rescan on nodes for identifying new paths
# Default value: dellemc/dell-csi-node-rescanner:v1.0.1
noderescan: dellemc/dell-csi-node-rescanner:v1.1.0
## K8S/DRIVER ATTRIBUTES
########################
# customDriverName: If enabled, sets the driver name to the
Expand Down Expand Up @@ -260,10 +277,6 @@ enableCHAP: false

# csireverseproxy: Refers to the subchart csireverseproxy
csireverseproxy:
# image: Define the container images used for the reverse proxy
# Default value: None
# Example: "csipowermax-reverseproxy:v2.7.0"
image: dellemc/csipowermax-reverseproxy:v2.7.0
# "tlsSecret" defines the TLS secret that is created with certificate
# and its associated key
# Default value: None
Expand Down Expand Up @@ -380,9 +393,6 @@ openshift: false
# Default value: "false"
replication:
enabled: false
# Change this to use any specific version of the dell-csi-replicator sidecar
# Default value: None
image: dellemc/dell-csi-replicator:v1.6.0
# replicationContextPrefix enables side cars to read
# required information from the volume context
# Default value: "powermax"
Expand All @@ -401,12 +411,6 @@ replication:
# Default value: "false"
migration:
enabled: false
# Change this to use any specific version of the dell-csi-migrator sidecar
# Default value: None
image: dellemc/dell-csi-migrator:v1.2.0
# Node rescan sidecar does a rescan on nodes for identifying new paths
# Default value: None
nodeRescanSidecarImage: dellemc/dell-csi-node-rescanner:v1.1.0
# migrationPrefix: Determine if migration is enabled
# Default value: "migration.storage.dell.com"
# Examples: "migration.storage.dell.com"
Expand All @@ -421,9 +425,6 @@ migration:
# Default value: "false"
authorization:
enabled: false
# sidecarProxyImage: the container image used for the csm-authorization-sidecar.
# Default value: dellemc/csm-authorization-sidecar:v1.8.0
sidecarProxyImage: dellemc/csm-authorization-sidecar:v1.8.0
# proxyHost: hostname of the csm-authorization server
# Default value: None
proxyHost:
Expand Down

0 comments on commit 0ceea2a

Please sign in to comment.