Skip to content

Commit

Permalink
Declare extraContainers ahead of the router container (#3633)
Browse files Browse the repository at this point in the history
Currently `extraContainers` are declared after the router container.
Moving the `extraContainers` ahead of the router container will make it
simpler to co-ordinate container startup sequencing and take full
advantage of kubernetes lifecycle hooks.

fixes: #3632

<!-- 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
- [x] Performance impact assessed and acceptable
- Tests added and passing[^3]
    - [ ] Unit Tests
    - [ ] Integration Tests
    - [ ] Manual Tests

**Exceptions**

*Note any exceptions here*

**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: Jesse Rosenberger <git@jro.cc>
Co-authored-by: o0Ignition0o <jeremy.lempereur@gmail.com>
Co-authored-by: Bryn Cooke <BrynCooke@gmail.com>
Co-authored-by: bryn <bryn@apollographql.com>
Co-authored-by: Geoffroy Couprie <apollo@geoffroycouprie.com>
Co-authored-by: Lenny Burdette <lenny@apollographql.com>
Co-authored-by: Maria Elisabeth Schreiber <maria.schreiber@apollographql.com>
Co-authored-by: Lucas Leadbetter <5595530+lleadbet@users.noreply.github.com>
Co-authored-by: Simon Sapin <simon@apollographql.com>
Co-authored-by: Chandrika Srinivasan <chandrikas@users.noreply.github.com>
Co-authored-by: Nicolas Moutschen <nicolas@apollographql.com>
  • Loading branch information
12 people committed Aug 25, 2023
1 parent 5792c2c commit 1a3e677
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changesets/fix_garypen_3632_extras_declared_first.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Declare `extraContainers` ahead of the router container ([Issue #3632](https://github.com/apollographql/router/issues/3632))

Currently `extraContainers` are declared after the router container. Moving the `extraContainers` ahead of the router container will make it simpler to co-ordinate container startup sequencing and take full advantage of kubernetes lifecycle hooks.

By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/3633
9 changes: 4 additions & 5 deletions helm/chart/router/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ spec:
{{- include "router.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- if or .Values.podAnnotations .Values.supergraphFile }}
annotations:
kubectl.kubernetes.io/default-container: {{ .Chart.Name }}
{{- if .Values.supergraphFile }}
checksum/supergraph-config-map: {{ .Values.supergraphFile | sha256sum }}
{{- end }}
{{- if .Values.podAnnotations }}
{{- toYaml .Values.podAnnotations | nindent 8 }}
{{- end }}
{{- end }}
labels:
{{- include "router.selectorLabels" . | nindent 8 }}
{{- if .Values.extraLabels }}
Expand All @@ -46,6 +45,9 @@ spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
{{- if .Values.extraContainers }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraContainers "context" $) | nindent 8 }}
{{- end }}
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
Expand Down Expand Up @@ -127,9 +129,6 @@ spec:
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- end }}
{{- 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 }}
Expand Down

0 comments on commit 1a3e677

Please sign in to comment.