Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initContainers and container command to common chart #260

Merged
merged 2 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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