Skip to content

Commit

Permalink
add lifecycle support to helm chart (#3570)
Browse files Browse the repository at this point in the history
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 

<!-- start metadata -->

**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 <[email protected]>
  • Loading branch information
bjoernw and garypen authored Aug 16, 2023
1 parent f76cede commit 02d20b3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changesets/feat_add_lifecycle_support_to_helm_chart.md
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion helm/chart/router/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ spec:
containerPort: {{ .Values.containerPorts.metrics }}
protocol: TCP
{{- end }}

lifecycle:
{{- toYaml .Values.lifecycle | nindent 12 }}
livenessProbe:
httpGet:
path: "/health?live"
Expand Down
8 changes: 8 additions & 0 deletions helm/chart/router/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ initContainers: []
# label_two_name: "label_two_value"
extraLabels: {}

lifecycle: {}
# preStop:
# exec:
# command:
# - /bin/bash
# - -c
# - sleep 10

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
Expand Down

0 comments on commit 02d20b3

Please sign in to comment.