Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/standalone helm installer #128

Merged
merged 9 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions dell-csi-helm-installer/csi-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ PROG="${0}"
NODE_VERIFY=1
VERIFY=1
MODE="install"
DEFAULT_DRIVER_VERSION="2.0.0"
DEFAULT_DRIVER_VERSION="v2.0.0"
spriya-m marked this conversation as resolved.
Show resolved Hide resolved
WATCHLIST=""

# export the name of the debug log, so child processes will see it
Expand Down Expand Up @@ -147,8 +147,6 @@ function install_driver() {
HELMOUTPUT="/tmp/csi-install.$$.out"
run_command helm ${1} \
--set openshift=${OPENSHIFT} \
--values "${DRIVERDIR}/${DRIVER}/k8s-${kMajorVersion}.${kMinorVersion}-values.yaml" \
--values "${DRIVERDIR}/${DRIVER}/driver-image.yaml" \
--values "${VALUES}" \
--namespace ${NS} "${RELEASE}" \
"${DRIVERDIR}/${DRIVER}" >"${HELMOUTPUT}" 2>&1
Expand Down
4 changes: 2 additions & 2 deletions helm/csi-powerstore/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: csi-powerstore
apiVersion: v2
version: 2.3.0
appVersion: 2.3.0
appVersion: "2.3.0"
kubeVersion: ">= 1.21.0 <= 1.24.0"
description: |
PowerStore CSI (Container Storage Interface) driver Kubernetes
integration. This chart includes everything required to provision via CSI as
Expand All @@ -14,4 +15,3 @@ sources:
- https://github.com/dell/csi-powerstore
maintainers:
- name: DellEMC
engine: gotpl
6 changes: 0 additions & 6 deletions helm/csi-powerstore/driver-image.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions helm/csi-powerstore/k8s-1.21-values.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions helm/csi-powerstore/k8s-1.22-values.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions helm/csi-powerstore/k8s-1.23-values.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions helm/csi-powerstore/k8s-1.24-values.yaml

This file was deleted.

50 changes: 50 additions & 0 deletions helm/csi-powerstore/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{{/*
Return the appropriate sidecar images based on k8s version
*/}}
{{- define "csi-powerstore.attacherImage" -}}
{{- if eq .Capabilities.KubeVersion.Major "1" }}
{{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "21") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "24") -}}
{{- print "k8s.gcr.io/sig-storage/csi-attacher:v3.4.0" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- define "csi-powerstore.provisionerImage" -}}
{{- if eq .Capabilities.KubeVersion.Major "1" }}
{{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "21") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "24") -}}
{{- print "k8s.gcr.io/sig-storage/csi-provisioner:v3.1.0" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- define "csi-powerstore.snapshotterImage" -}}
{{- if eq .Capabilities.KubeVersion.Major "1" }}
{{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "21") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "24") -}}
{{- print "k8s.gcr.io/sig-storage/csi-snapshotter:v5.0.1" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- define "csi-powerstore.resizerImage" -}}
{{- if eq .Capabilities.KubeVersion.Major "1" }}
{{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "21") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "24") -}}
{{- print "k8s.gcr.io/sig-storage/csi-resizer:v1.4.0" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- define "csi-powerstore.registrarImage" -}}
{{- if eq .Capabilities.KubeVersion.Major "1" }}
{{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "21") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "24") -}}
{{- print "k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.5.1" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- define "csi-powerstore.healthmonitorImage" -}}
{{- if eq .Capabilities.KubeVersion.Major "1" }}
{{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "21") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "24") -}}
{{- print "gcr.io/k8s-staging-sig-storage/csi-external-health-monitor-controller:v0.5.0" -}}
{{- end -}}
{{- end -}}
{{- end -}}
14 changes: 7 additions & 7 deletions helm/csi-powerstore/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ spec:
{{ if .Values.dev.enableTracing }}{{- include "pstore.tracing" . | nindent 8 }}{{ end }}
{{- end }}
- name: attacher
image: {{ required "Must provide the CSI attacher container image." .Values.images.attacher }}
image: {{ required "Must provide the CSI attacher container image." ( include "csi-powerstore.attacherImage" . ) }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- "--csi-address=$(ADDRESS)"
Expand All @@ -168,7 +168,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." .Values.images.resizer }}
image: {{ required "Must provide the CSI resizer container image." ( include "csi-powerstore.resizerImage" . ) }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- "--csi-address=$(ADDRESS)"
Expand All @@ -183,7 +183,7 @@ spec:
{{end}}
{{end}}
- name: provisioner
image: {{ required "Must provide the CSI provisioner container image." .Values.images.provisioner }}
image: {{ required "Must provide the CSI provisioner container image." ( include "csi-powerstore.provisionerImage" . ) }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- "--csi-address=$(ADDRESS)"
Expand All @@ -203,7 +203,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." .Values.images.snapshotter }}
image: {{ required "Must provide the CSI snapshotter container image." ( include "csi-powerstore.snapshotterImage" . ) }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- "--csi-address=$(ADDRESS)"
Expand Down Expand Up @@ -262,7 +262,7 @@ spec:
{{- if hasKey .Values.controller "healthMonitor" }}
{{- if eq .Values.controller.healthMonitor.enabled true}}
- name: csi-external-health-monitor-controller
image: {{ required "Must provide the CSI external health monitor controller image." .Values.images.externalhealthmonitorcontroller}}
image: {{ required "Must provide the CSI external health monitor controller image." ( include "csi-powerstore.healthmonitorImage" . ) }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- "--v=5"
Expand All @@ -281,7 +281,7 @@ spec:
{{- end }}
{{- end }}
- name: csi-metadata-retriever
image: {{ required "Must provide the CSI Metadata retriever container image." .Values.images.metadataretriever }}
image: {{ required "Must provide the CSI Metadata retriever container image." .Values.controller.metadataretriever }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
command: [ "/csi-metadata-retriever" ]
env:
Expand All @@ -296,7 +296,7 @@ spec:
- name: socket-dir
mountPath: /var/run/csi
- name: driver
image: {{ required "Must provide the PowerStore driver container image." .Values.images.driver }}
image: {{ required "Must provide the Powerstore driver image repository." .Values.images.driverRepository }}/{{ .Chart.Name }}:{{ .Values.version }}
harishp8889 marked this conversation as resolved.
Show resolved Hide resolved
imagePullPolicy: {{ .Values.imagePullPolicy }}
command: [ "/csi-powerstore" ]
env:
Expand Down
4 changes: 2 additions & 2 deletions helm/csi-powerstore/templates/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ spec:
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: {{ required "Must provide the PowerStore driver container image." .Values.images.driver }}
image: {{ required "Must provide the Powerstore driver image repository." .Values.images.driverRepository }}/{{ .Chart.Name }}:{{ .Values.version }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
command: [ "/csi-powerstore" ]
env:
Expand Down Expand Up @@ -170,7 +170,7 @@ spec:
- name: powerstore-config-params
mountPath: /powerstore-config-params
- name: registrar
image: {{ required "Must provide the CSI node registrar container image." .Values.images.registrar }}
image: {{ required "Must provide the CSI node registrar container image." ( include "csi-powerstore.registrarImage" . ) }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- "--v=5"
Expand Down
10 changes: 10 additions & 0 deletions helm/csi-powerstore/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
# Default value: None
driverName: "csi-powerstore.dellemc.com"

# Driver version required to pull the latest driver image
version: "v2.3.0"

# Specify kubelet config dir path.
# Ensure that the config.yaml file is present at this path.
# Default value: None
Expand Down Expand Up @@ -138,6 +141,9 @@ controller:
# Default value: replication.storage.dell.com
replicationPrefix: "replication.storage.dell.com"

# Image for csi-metadata-retriever
metadataretriever: dellemc/csi-metadata-retriever:v1.0.0

# nodeSelector: Define node selection constraints for controller pods.
# For the pod to be eligible to run on a node, the node must have each
# of the indicated key-value pairs as labels.
Expand Down Expand Up @@ -235,3 +241,7 @@ logFormat: "JSON"

# Following modes are supported: None, File and ReadWriteOnceWithFSType
fsGroupPolicy: ReadWriteOnceWithFSType

images:
# "driver" defines the container image, used for the driver container.
driverRepository: dellemc