Skip to content

Commit

Permalink
feat(helm): allow setting extra pod volumes via chart values (#744)
Browse files Browse the repository at this point in the history
This adds the ability to set `extraVolumes` and `extraVolumeMounts` via
helm to the pod. It can be used to mount extra files, to persist files
inside the container or to allow usage of the CSI Secret Driver.
It does not introduce breaking changes since the default for both is
an empty array, so no volumes or volumeMounts are created when not
explicitly set.

Fixed #743

Signed-off-by: Henrik Gerdes <[email protected]>
  • Loading branch information
hegerdes authored Sep 16, 2024
1 parent a299730 commit ad43445
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions chart/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,13 @@ spec:
{{- end }}
resources:
{{- toYaml $.Values.resources | nindent 12 }}
{{- with .Values.extraVolumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
priorityClassName: system-cluster-critical
{{- with .Values.extraVolumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,13 @@ spec:
{{- end }}
resources:
{{- toYaml $.Values.resources | nindent 12 }}
{{- with .Values.extraVolumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
priorityClassName: system-cluster-critical
{{- with .Values.extraVolumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
16 changes: 16 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,19 @@ robot:
podLabels: {}

podAnnotations: {}

# Mounts the specified volume to the hcloud-cloud-controller-manager container.
extraVolumeMounts: []
# # Example
# extraVolumeMounts:
# - name: token-volume
# readOnly: true
# mountPath: /var/run/secrets/hcloud

# Adds extra volumes to the pod.
extraVolumes: []
# # Example
# extraVolumes:
# - name: token-volume
# secret:
# secretName: hcloud-token

0 comments on commit ad43445

Please sign in to comment.