diff --git a/charts/common/Chart.yaml b/charts/common/Chart.yaml index 9737d8df..67e4f26c 100644 --- a/charts/common/Chart.yaml +++ b/charts/common/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: common description: A generic helm chart for Kubernetes type: application -version: 0.6.6 +version: 0.6.7 maintainers: - name: Parity url: https://github.com/paritytech/helm-charts diff --git a/charts/common/templates/deployment.yaml b/charts/common/templates/deployment.yaml index 73f826e8..ae00e491 100644 --- a/charts/common/templates/deployment.yaml +++ b/charts/common/templates/deployment.yaml @@ -40,12 +40,21 @@ spec: serviceAccountName: {{ include "common.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- if .Values.initContainers}} + initContainers: + - name: {{ .Values.initContainers.name }} + image: {{ .Values.initContainers.image }} + command: {{ .Values.initContainers.command }} + {{- end }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.containerSecurityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.command }} + command: {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.args }} args: {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/common/values.yaml b/charts/common/values.yaml index a997e7cf..83fc3aca 100644 --- a/charts/common/values.yaml +++ b/charts/common/values.yaml @@ -29,6 +29,10 @@ image: ## args: [] +## Override default container command +## +command: [] + ## Number of replicas for the pod ## replicaCount: 1 @@ -38,6 +42,13 @@ replicaCount: 1 ## imagePullSecrets: [] +## Define init container +## ref: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ +# initContainers: +# - name: init-container +# image: busybox:1.28 +# command: ['sh', '-c', "sleep 30"] + ## Service account for the pod to use ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ ##