Skip to content

Commit

Permalink
add support for providing additional volumes and adding init containers
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Nelson <jesse@swirldslabs.com>
Signed-off-by: Niladri Halder <niladri.halder26@gmail.com>
  • Loading branch information
jnels124 authored and niladrih committed Jul 26, 2023
1 parent 66f7754 commit d9a1757
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelogs/unreleased/454-jnels124.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add support to deployment yaml to allower user to specify additional volumes and init containers
13 changes: 13 additions & 0 deletions deploy/helm/charts/templates/zfs-contoller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ spec:
priorityClassName: {{ template "zfslocalpv.zfsController.priorityClassName" . }}
{{- end }}
serviceAccountName: {{ .Values.serviceAccount.zfsController.name }}
{{- if .Values.zfsController.initContainers }}
initContainers:
{{- range $key, $value := .Values.zfsController.initContainers }}
- name: {{ $key }}
{{ toYaml $value | indent 10 }}
{{- end }}
{{- end }}
containers:
- name: {{ .Values.zfsController.resizer.name }}
image: "{{ .Values.zfsController.resizer.image.registry }}{{ .Values.zfsController.resizer.image.repository }}:{{ .Values.zfsController.resizer.image.tag }}"
Expand Down Expand Up @@ -121,6 +128,12 @@ spec:
volumes:
- name: socket-dir
emptyDir: {}
{{- if .Values.zfsController.additionalVolumes }}
{{- range $name, $config := .Values.zfsController.additionalVolumes }}
- name: {{ $name }}
{{- tpl (toYaml $config) $ | nindent 10 }}
{{- end }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
Expand Down
13 changes: 13 additions & 0 deletions deploy/helm/charts/templates/zfs-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ spec:
{{- end }}
serviceAccountName: {{ .Values.serviceAccount.zfsNode.name }}
hostNetwork: true
{{- if .Values.zfsNode.initContainers }}
initContainers:
{{- range $key, $value := .Values.zfsNode.initContainers }}
- name: {{ $key }}
{{ toYaml $value | indent 10 }}
{{- end }}
{{- end }}
containers:
- name: {{ .Values.zfsNode.driverRegistrar.name }}
image: "{{ .Values.zfsNode.driverRegistrar.image.registry }}{{ .Values.zfsNode.driverRegistrar.image.repository }}:{{ .Values.zfsNode.driverRegistrar.image.tag }}"
Expand Down Expand Up @@ -132,6 +139,12 @@ spec:
hostPath:
path: {{ .Values.zfsNode.kubeletDir }}
type: Directory
{{- if .Values.zfsNode.additionalVolumes }}
{{- range $name, $config := .Values.zfsNode.additionalVolumes }}
- name: {{ $name }}
{{- tpl (toYaml $config) $ | nindent 10 }}
{{- end }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
Expand Down

0 comments on commit d9a1757

Please sign in to comment.