Skip to content

Commit c6d1fea

Browse files
committed
feat(chart): add extraInitContainers, extraContainers, extraVolumeMounts, extraVolumes support
Add four extension points to the Helm chart deployment template, allowing users to inject custom init containers, sidecar containers, volume mounts, and volumes without modifying the chart itself. - extraInitContainers: runs before the main container - extraContainers: sidecar containers alongside the main container - extraVolumeMounts: additional mounts in the main container - extraVolumes: additional volumes for the pod
1 parent 6d590ac commit c6d1fea

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

charts/openab/templates/deployment.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ spec:
2929
securityContext:
3030
{{- toYaml . | nindent 8 }}
3131
{{- end }}
32+
{{- with $cfg.extraInitContainers }}
33+
initContainers:
34+
{{- toYaml . | nindent 8 }}
35+
{{- end }}
3236
containers:
3337
- name: openab
3438
image: {{ include "openab.agentImage" $d | quote }}
@@ -101,6 +105,12 @@ spec:
101105
{{- end }}
102106
- name: tmp
103107
mountPath: /tmp
108+
{{- with $cfg.extraVolumeMounts }}
109+
{{- toYaml . | nindent 12 }}
110+
{{- end }}
111+
{{- with $cfg.extraContainers }}
112+
{{- toYaml . | nindent 8 }}
113+
{{- end }}
104114
{{- with $cfg.nodeSelector }}
105115
nodeSelector:
106116
{{- toYaml . | nindent 8 }}
@@ -124,5 +134,8 @@ spec:
124134
{{- end }}
125135
- name: tmp
126136
emptyDir: {}
137+
{{- with $cfg.extraVolumes }}
138+
{{- toYaml . | nindent 8 }}
139+
{{- end }}
127140
{{- end }}
128141
{{- end }}

charts/openab/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,11 @@ agents:
170170
nodeSelector: {}
171171
tolerations: []
172172
affinity: {}
173+
# extraInitContainers adds init containers to the pod (runs before the main container)
174+
extraInitContainers: []
175+
# extraContainers adds sidecar containers to the pod
176+
extraContainers: []
177+
# extraVolumeMounts adds additional volume mounts to the main container
178+
extraVolumeMounts: []
179+
# extraVolumes adds additional volumes to the pod
180+
extraVolumes: []

0 commit comments

Comments
 (0)