From 44336ba2e95e4c42bda26fb8a8974dcc6e30be03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rost=C3=A1s=20L=C3=A1szl=C3=B3?= Date: Fri, 14 Jul 2023 10:54:27 +0200 Subject: [PATCH 1/7] Feat: Add init containers options to helm chart --- helm/chart/router/templates/deployment.yaml | 3 +++ helm/chart/router/values.yaml | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/helm/chart/router/templates/deployment.yaml b/helm/chart/router/templates/deployment.yaml index b1b8018d24..6773517136 100644 --- a/helm/chart/router/templates/deployment.yaml +++ b/helm/chart/router/templates/deployment.yaml @@ -129,6 +129,9 @@ spec: {{- if .Values.extraContainers }} {{- include "common.tplvalues.render" (dict "value" .Values.extraContainers "context" $) | nindent 8 }} {{- end }} + {{- if .Values.initContainers }} + {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} + {{- end }} {{- if or .Values.router.configuration .Values.extraVolumes }} volumes: {{- if .Values.router.configuration }} diff --git a/helm/chart/router/values.yaml b/helm/chart/router/values.yaml index 03baf33f6e..213f4d5f43 100644 --- a/helm/chart/router/values.yaml +++ b/helm/chart/router/values.yaml @@ -86,6 +86,14 @@ containerPorts: # - containerPort: 4001 extraContainers: [] +# -- An array of init containers to include in the router pod +# Example: +# initContainers: +# - name: init-myservice +# image: busybox:1.28 +# command: ["sh"] +initContainers: [] + # -- A map of extra labels to apply to the router deploment and containers # Example: # extraLabels: From c69f1fc80162433f3fd9bbc3efa44cc94ba6b2e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Rost=C3=A1s?= <90799211+laszlorostas@users.noreply.github.com> Date: Mon, 31 Jul 2023 10:29:56 +0200 Subject: [PATCH 2/7] Create feat_add_helm_init_containers.md --- .changesets/feat_add_helm_init_containers.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changesets/feat_add_helm_init_containers.md diff --git a/.changesets/feat_add_helm_init_containers.md b/.changesets/feat_add_helm_init_containers.md new file mode 100644 index 0000000000..87283526c8 --- /dev/null +++ b/.changesets/feat_add_helm_init_containers.md @@ -0,0 +1,5 @@ +### Helm: add init containers to deployemt ([PR #3444](https://github.com/apollographql/router/pull/3444)) + +This is a new option when starting the router, so that before starting another container runs and performs necessary tasks. + +By [@laszlorostas](https://github.com/laszlorostas) in https://github.com/apollographql/router/pull/3444 From 349ada2ffe38ce9419a33fb22ca4f8d566998ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Rost=C3=A1s?= <90799211+laszlorostas@users.noreply.github.com> Date: Mon, 31 Jul 2023 10:32:19 +0200 Subject: [PATCH 3/7] Update feat_add_helm_init_containers.md Change PR to Issue in header --- .changesets/feat_add_helm_init_containers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changesets/feat_add_helm_init_containers.md b/.changesets/feat_add_helm_init_containers.md index 87283526c8..e5d42b65f0 100644 --- a/.changesets/feat_add_helm_init_containers.md +++ b/.changesets/feat_add_helm_init_containers.md @@ -1,4 +1,4 @@ -### Helm: add init containers to deployemt ([PR #3444](https://github.com/apollographql/router/pull/3444)) +### Helm: add init containers to deployemt ([Issue #3248](https://github.com/apollographql/router/issues/3248)) This is a new option when starting the router, so that before starting another container runs and performs necessary tasks. From 92b09e363be40b133cb48becbd5e50199f8714d3 Mon Sep 17 00:00:00 2001 From: Gary Pennington Date: Mon, 31 Jul 2023 13:26:18 +0100 Subject: [PATCH 4/7] Update helm/chart/router/templates/deployment.yaml --- helm/chart/router/templates/deployment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/helm/chart/router/templates/deployment.yaml b/helm/chart/router/templates/deployment.yaml index 6773517136..ae50999844 100644 --- a/helm/chart/router/templates/deployment.yaml +++ b/helm/chart/router/templates/deployment.yaml @@ -130,6 +130,7 @@ spec: {{- include "common.tplvalues.render" (dict "value" .Values.extraContainers "context" $) | nindent 8 }} {{- end }} {{- if .Values.initContainers }} + initContainers: {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} {{- end }} {{- if or .Values.router.configuration .Values.extraVolumes }} From 3c52fa5a31bc4234be66654a3024a9875563f4e7 Mon Sep 17 00:00:00 2001 From: Gary Pennington Date: Mon, 31 Jul 2023 14:09:27 +0100 Subject: [PATCH 5/7] Update deployment.yaml Fix alignment for initContainers --- helm/chart/router/templates/deployment.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helm/chart/router/templates/deployment.yaml b/helm/chart/router/templates/deployment.yaml index ae50999844..36587ea17a 100644 --- a/helm/chart/router/templates/deployment.yaml +++ b/helm/chart/router/templates/deployment.yaml @@ -129,10 +129,10 @@ spec: {{- if .Values.extraContainers }} {{- include "common.tplvalues.render" (dict "value" .Values.extraContainers "context" $) | nindent 8 }} {{- end }} - {{- if .Values.initContainers }} - initContainers: - {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} - {{- end }} + {{- if .Values.initContainers }} + initContainers: + {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} + {{- end }} {{- if or .Values.router.configuration .Values.extraVolumes }} volumes: {{- if .Values.router.configuration }} From 66f2440e50c629d97a2bc28fa4b6caf4054132ad Mon Sep 17 00:00:00 2001 From: Gary Pennington Date: Mon, 31 Jul 2023 14:32:44 +0100 Subject: [PATCH 6/7] Update deployment.yaml BREAK on purpose --- helm/chart/router/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/chart/router/templates/deployment.yaml b/helm/chart/router/templates/deployment.yaml index 36587ea17a..95fb8868da 100644 --- a/helm/chart/router/templates/deployment.yaml +++ b/helm/chart/router/templates/deployment.yaml @@ -129,7 +129,7 @@ spec: {{- if .Values.extraContainers }} {{- include "common.tplvalues.render" (dict "value" .Values.extraContainers "context" $) | nindent 8 }} {{- end }} - {{- if .Values.initContainers }} + {{- if .Values.initContainers }}BREAK initContainers: {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} {{- end }} From 19a33da4019c51e8c3b32cd9a8f17b96a5d8c39a Mon Sep 17 00:00:00 2001 From: Gary Pennington Date: Mon, 31 Jul 2023 14:33:12 +0100 Subject: [PATCH 7/7] Update deployment.yaml Fix again to trick git --- helm/chart/router/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/chart/router/templates/deployment.yaml b/helm/chart/router/templates/deployment.yaml index 95fb8868da..36587ea17a 100644 --- a/helm/chart/router/templates/deployment.yaml +++ b/helm/chart/router/templates/deployment.yaml @@ -129,7 +129,7 @@ spec: {{- if .Values.extraContainers }} {{- include "common.tplvalues.render" (dict "value" .Values.extraContainers "context" $) | nindent 8 }} {{- end }} - {{- if .Values.initContainers }}BREAK + {{- if .Values.initContainers }} initContainers: {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} {{- end }}