Skip to content

Commit

Permalink
Improve initContainers template in common chart (#261)
Browse files Browse the repository at this point in the history
* Improve initContainers template in common chart

* add comment
  • Loading branch information
alvicsam committed Jun 27, 2023
1 parent 952bff7 commit 13bf2ca
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: common
description: A generic helm chart for Kubernetes
type: application
version: 0.6.7
version: 0.6.8
maintainers:
- name: Parity
url: https://github.com/paritytech/helm-charts
15 changes: 11 additions & 4 deletions charts/common/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,18 @@ spec:
serviceAccountName: {{ include "common.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if .Values.initContainers}}
{{- if .Values.initContainers }}
initContainers:
- name: {{ .Values.initContainers.name }}
image: {{ .Values.initContainers.image }}
command: {{ .Values.initContainers.command }}
{{- range $initContainer := .Values.initContainers }}
- name: {{ $initContainer.name }}
image: {{ $initContainer.image }}
command:
{{- toYaml $initContainer.command | nindent 12 }}
{{- with $initContainer.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
Expand Down
3 changes: 3 additions & 0 deletions charts/common/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ imagePullSecrets: []
# - name: init-container
# image: busybox:1.28
# command: ['sh', '-c', "sleep 30"]
# volumeMounts:
# - name: name
# mountPath: "/path"

## Service account for the pod to use
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
Expand Down

0 comments on commit 13bf2ca

Please sign in to comment.