Skip to content

Commit

Permalink
Add initContainers and container command to common chart (#260)
Browse files Browse the repository at this point in the history
* Add initContainers and container command to common chart

* revert autolint
  • Loading branch information
alvicsam committed Jun 26, 2023
1 parent 448453d commit 952bff7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
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.6
version: 0.6.7
maintainers:
- name: Parity
url: https://github.com/paritytech/helm-charts
9 changes: 9 additions & 0 deletions charts/common/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
11 changes: 11 additions & 0 deletions charts/common/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ image:
##
args: []

## Override default container command
##
command: []

## Number of replicas for the pod
##
replicaCount: 1
Expand All @@ -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/
##
Expand Down

0 comments on commit 952bff7

Please sign in to comment.