Skip to content

Commit

Permalink
update helm chart to pass env vars and volumes (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulait authored Jan 14, 2025
1 parent 1c3663a commit 2602994
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
11 changes: 10 additions & 1 deletion helm-chart/csi-driver/templates/csi-linode-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ spec:
- name: CSI_ENDPOINT
value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
- name: LINODE_URL
value: https://api.linode.com/v4
value: https://api.linode.com
- name: LINODE_VOLUME_LABEL_PREFIX
value: {{ .Values.volumeLabelPrefix | default "" | quote }}
- name: NODE_NAME
Expand All @@ -112,6 +112,9 @@ spec:
value: {{.Values.enableTracing | quote}}
- name: OTEL_TRACING_PORT
value: {{.Values.tracingPort | quote}}
{{- with .Values.csiLinodePlugin.env }}
{{- toYaml . | nindent 12 }}
{{- end }}
image: {{ .Values.csiLinodePlugin.image }}:{{ .Values.csiLinodePlugin.tag | default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.csiLinodePlugin.pullPolicy }}
name: csi-linode-plugin
Expand All @@ -122,6 +125,9 @@ spec:
name: get-linode-id
- mountPath: /var/lib/csi/sockets/pluginproxy/
name: socket-dir
{{- with .Values.csiLinodePlugin.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
initContainers:
- command:
- /scripts/get-linode-id.sh
Expand Down Expand Up @@ -167,3 +173,6 @@ spec:
path: /dev
type: Directory
name: dev
{{- with .Values.csiLinodePlugin.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
11 changes: 10 additions & 1 deletion helm-chart/csi-driver/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock
- name: LINODE_URL
value: https://api.linode.com/v4
value: https://api.linode.com
- name: NODE_NAME
valueFrom:
fieldRef:
Expand All @@ -56,6 +56,9 @@ spec:
value: {{ .Values.enableMetrics | quote}}
- name: METRICS_PORT
value: {{ .Values.metricsPort | quote}}
{{- with .Values.csiLinodePlugin.env }}
{{- toYaml . | nindent 8 }}
{{- end }}
image: {{ .Values.csiLinodePlugin.image }}:{{ .Values.csiLinodePlugin.tag | default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.csiLinodePlugin.pullPolicy }}
name: csi-linode-plugin
Expand All @@ -79,6 +82,9 @@ spec:
name: device-dir
- mountPath: /tmp
name: tmp
{{- with .Values.csiLinodePlugin.volumeMounts }}
{{- toYaml . | nindent 8 }}
{{- end }}
hostNetwork: true
initContainers:
- command:
Expand Down Expand Up @@ -158,3 +164,6 @@ spec:
path: /tmp
type: Directory
name: tmp
{{- with .Values.csiLinodePlugin.volumes }}
{{- toYaml . | nindent 6 }}
{{- end }}
13 changes: 13 additions & 0 deletions helm-chart/csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ csiLinodePlugin:
tag: # only set if required, defaults to .Chart.AppVersion set during release or "latest" by default
pullPolicy: IfNotPresent
podsMountDir: /var/lib/kubelet
# This section adds the ability to pass environment variables to adjust CSI defaults
env:
# - name: EXAMPLE_ENV_VAR
# value: "true"
# This section adds the ability to pass volumes to the DaemonSet
volumes:
# - name: test-volume
# emptyDir:
# sizeLimit: 500Mi
# this section adds the ability to pass volumeMounts to the container
volumeMounts:
# - mountPath: /tmp/
# name: test-volume

kubectl:
image: alpine/k8s # This needs to be alpine based and have both kubectl and curl installed.
Expand Down

0 comments on commit 2602994

Please sign in to comment.