Skip to content

Commit 2d2e8b9

Browse files
Add an init container to ensure ambient mode networking is up. (#344)
1 parent fc46f2a commit 2d2e8b9

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

deployments/helm/hephaestus/templates/controller/deployment.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,33 @@ spec:
4343
serviceAccountName: {{ include "hephaestus.serviceAccountName" . }}
4444
securityContext:
4545
{{- toYaml .Values.controller.podSecurityContext | nindent 8 }}
46+
{{- if .Values.waitForNetworking }}
47+
initContainers:
48+
- name: wait-for-networking
49+
securityContext:
50+
{{- toYaml .Values.controller.manager.containerSecurityContext | nindent 12 }}
51+
image: {{ .Values.curl_image }}
52+
imagePullPolicy: {{ .Values.controller.manager.image.pullPolicy }}
53+
command: [ 'sh', '-c' ]
54+
args:
55+
- |
56+
# Init containers seem to fix https://dominodatalab.atlassian.net/browse/DOM-70981
57+
# We're not sure why, but this init container is here as a temporary solution.
58+
echo "1 second sleep..."
59+
sleep 1
60+
echo "...done"
61+
{{- with .Values.controller.manager }}
62+
{{- if or .extraEnvVars $.Values.podEnv }}
63+
env:
64+
{{- with .extraEnvVars }}
65+
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 12 }}
66+
{{- end }}
67+
{{- with $.Values.podEnv }}
68+
{{- toYaml . | nindent 12 }}
69+
{{- end }}
70+
{{- end }}
71+
{{- end }}
72+
{{- end }}
4673
containers:
4774
- name: manager
4875
securityContext:

deployments/helm/hephaestus/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,3 +405,9 @@ buildkit:
405405
values:
406406
- {{ .Chart.Name }}
407407
topologyKey: "kubernetes.io/hostname"
408+
409+
# waitForNetworking starts an initContainer that requires a curl_image
410+
# Set this to true in istio ambient mode to cause Hephaestus Manager to start up
411+
# with networking. We're not sure why this works. See: https://dominodatalab.atlassian.net/browse/DOM-70981
412+
waitForNetworking: false
413+
curl_image: curlimages/curl:latest

0 commit comments

Comments
 (0)