From 2c15d6617c7a2cd3178725d145c5dc2ab5594597 Mon Sep 17 00:00:00 2001 From: Drew Date: Fri, 25 Sep 2020 23:33:12 -0700 Subject: [PATCH 1/4] [media-common] Add initContainers I think this is all thats needed to get this working --- charts/media-common/Chart.yaml | 2 +- charts/media-common/templates/deployment.yaml | 2 ++ charts/media-common/templates/statefulset.yaml | 2 ++ charts/media-common/values.yaml | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/charts/media-common/Chart.yaml b/charts/media-common/Chart.yaml index 040fddcb..296c63bc 100644 --- a/charts/media-common/Chart.yaml +++ b/charts/media-common/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: media-common description: Common dependancy chart for media ecosystem containers type: application -version: 1.1.1 +version: 1.2.1 keywords: - media-common home: https://github.com/k8s-at-home/charts/tree/master/charts/media-common diff --git a/charts/media-common/templates/deployment.yaml b/charts/media-common/templates/deployment.yaml index aeb31bfb..36bd4612 100644 --- a/charts/media-common/templates/deployment.yaml +++ b/charts/media-common/templates/deployment.yaml @@ -27,6 +27,8 @@ spec: securityContext: {{- toYaml . | nindent 8 }} {{- end }} + initContainers: + {{- include "media-common.initContainers" . | nindent 8 }} containers: - name: {{ template "media-common.fullname" . }} {{- with .Values.securityContext }} diff --git a/charts/media-common/templates/statefulset.yaml b/charts/media-common/templates/statefulset.yaml index d004b3a0..e51b34ab 100644 --- a/charts/media-common/templates/statefulset.yaml +++ b/charts/media-common/templates/statefulset.yaml @@ -28,6 +28,8 @@ spec: securityContext: {{- toYaml . | nindent 8 }} {{- end }} + initContainers: + {{- include "media-common.initContainers" . | nindent 8 }} containers: - name: {{ template "media-common.fullname" . }} {{- with .Values.securityContext }} diff --git a/charts/media-common/values.yaml b/charts/media-common/values.yaml index 25ce4fc2..e6141dd9 100644 --- a/charts/media-common/values.yaml +++ b/charts/media-common/values.yaml @@ -113,6 +113,8 @@ persistence: ## Do not delete the pvc upon helm uninstall skipuninstall: false +initContainers: [] + additionalContainers: [] additionalVolumes: [] From e63dbd08d10d3895fbe8103da6d58d1346732e37 Mon Sep 17 00:00:00 2001 From: Drew Date: Fri, 25 Sep 2020 23:50:05 -0700 Subject: [PATCH 2/4] [media-common] Forgot this Not sure if this is why the lint is angry but lets give her a try --- charts/media-common/templates/_helpers.tpl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/charts/media-common/templates/_helpers.tpl b/charts/media-common/templates/_helpers.tpl index b45e490b..7f0301f3 100644 --- a/charts/media-common/templates/_helpers.tpl +++ b/charts/media-common/templates/_helpers.tpl @@ -51,6 +51,15 @@ app.kubernetes.io/name: {{ include "media-common.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} +{{/* +Init Containers +*/}} +{{- define "media-common.initContainers" -}} +{{- if .Values.initContainers }} +{{- toYaml .Values.initContainers }} +{{- end }} +{{- end -}} + {{/* Additional Containers */}} From 374b098436173e524c14e79b11b94958a88f76ae Mon Sep 17 00:00:00 2001 From: Drew Date: Fri, 25 Sep 2020 23:58:35 -0700 Subject: [PATCH 3/4] [media-common] Fix version --- charts/media-common/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/media-common/Chart.yaml b/charts/media-common/Chart.yaml index 296c63bc..6e8e8ce6 100644 --- a/charts/media-common/Chart.yaml +++ b/charts/media-common/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: media-common description: Common dependancy chart for media ecosystem containers type: application -version: 1.2.1 +version: 1.2.0 keywords: - media-common home: https://github.com/k8s-at-home/charts/tree/master/charts/media-common From 3ee806f563c04f9f48dbe97993b5828fd127bec5 Mon Sep 17 00:00:00 2001 From: Drew Date: Sat, 26 Sep 2020 18:36:54 -0700 Subject: [PATCH 4/4] [media-common] Wrap in conditional statement Had a feeling I needed this! --- charts/media-common/templates/deployment.yaml | 4 +++- charts/media-common/templates/statefulset.yaml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/charts/media-common/templates/deployment.yaml b/charts/media-common/templates/deployment.yaml index 36bd4612..a391cbde 100644 --- a/charts/media-common/templates/deployment.yaml +++ b/charts/media-common/templates/deployment.yaml @@ -27,8 +27,10 @@ spec: securityContext: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.initContainers }} initContainers: - {{- include "media-common.initContainers" . | nindent 8 }} + {{- include "media-common.initContainers" . | nindent 8 }} + {{- end }} containers: - name: {{ template "media-common.fullname" . }} {{- with .Values.securityContext }} diff --git a/charts/media-common/templates/statefulset.yaml b/charts/media-common/templates/statefulset.yaml index e51b34ab..d0c094e9 100644 --- a/charts/media-common/templates/statefulset.yaml +++ b/charts/media-common/templates/statefulset.yaml @@ -28,8 +28,10 @@ spec: securityContext: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.initContainers }} initContainers: - {{- include "media-common.initContainers" . | nindent 8 }} + {{- include "media-common.initContainers" . | nindent 8 }} + {{- end }} containers: - name: {{ template "media-common.fullname" . }} {{- with .Values.securityContext }}