From 02d20b334482a3db0758748a3ea3c3da0a28e2e5 Mon Sep 17 00:00:00 2001 From: Bjoern Weidlich Date: Wed, 16 Aug 2023 05:26:47 -0700 Subject: [PATCH] add lifecycle support to helm chart (#3570) In order to reduce the instances of 502s during deployments I would like to add a preStop hook with a sleep to give sending services enough time to receive DNS updates. This PR exposes the container's lifecycle object to accomplish that. fixes #3563 **Checklist** Complete the checklist (and note appropriate exceptions) before a final PR is raised. - [X] Changes are compatible[^1] - [X] Documentation[^2] completed - [ ] Performance impact assessed and acceptable - Tests added and passing[^3] - [ ] Unit Tests - [ ] Integration Tests - [X] Manual Tests **Exceptions** - unit tests - integration tests Helm changes not applicable to unit/integration tests. Installed the chart into a kind cluster with and without the property. Both worked. **Notes** [^1]. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. [^2]. Configuration is an important part of many changes. Where applicable please try to document configuration examples. [^3]. Tick whichever testing boxes are applicable. If you are adding Manual Tests: - please document the manual testing (extensively) in the Exceptions. - please raise a separate issue to automate the test and label it (or ask for it to be labeled) as `manual test` --------- Co-authored-by: Gary Pennington --- .changesets/feat_add_lifecycle_support_to_helm_chart.md | 5 +++++ helm/chart/router/templates/deployment.yaml | 3 ++- helm/chart/router/values.yaml | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changesets/feat_add_lifecycle_support_to_helm_chart.md diff --git a/.changesets/feat_add_lifecycle_support_to_helm_chart.md b/.changesets/feat_add_lifecycle_support_to_helm_chart.md new file mode 100644 index 0000000000..e6049c9952 --- /dev/null +++ b/.changesets/feat_add_lifecycle_support_to_helm_chart.md @@ -0,0 +1,5 @@ +### Helm: exposes the lifecycle object on the router container ([Issue #3563](https://github.com/apollographql/router/issues/3563)) + +You can now set the kubernetes lifecycle object on the router container in the helm chart. + +By [@bjoernw](https://github.com/bjoernw) in https://github.com/apollographql/router/pull/3570 diff --git a/helm/chart/router/templates/deployment.yaml b/helm/chart/router/templates/deployment.yaml index 36587ea17a..2e5962a509 100644 --- a/helm/chart/router/templates/deployment.yaml +++ b/helm/chart/router/templates/deployment.yaml @@ -102,7 +102,8 @@ spec: containerPort: {{ .Values.containerPorts.metrics }} protocol: TCP {{- end }} - + lifecycle: + {{- toYaml .Values.lifecycle | nindent 12 }} livenessProbe: httpGet: path: "/health?live" diff --git a/helm/chart/router/values.yaml b/helm/chart/router/values.yaml index 6c8d6cd75b..f682a3f933 100644 --- a/helm/chart/router/values.yaml +++ b/helm/chart/router/values.yaml @@ -101,6 +101,14 @@ initContainers: [] # label_two_name: "label_two_value" extraLabels: {} +lifecycle: {} +# preStop: +# exec: +# command: +# - /bin/bash +# - -c +# - sleep 10 + imagePullSecrets: [] nameOverride: "" fullnameOverride: ""