Skip to content

Commit 33651d4

Browse files
Add a wait to ensure networking is up. this assumes ztunnel blocks everything, including k8s
1 parent 3557238 commit 33651d4

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,38 @@ 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+
echo "Testing Connections"
57+
while true; do
58+
echo "AWS Metadata attempt:"
59+
if curl -sX PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600" > /dev/null; then
60+
echo "AWS Metadata successful"
61+
exit 0
62+
else
63+
echo "error: AWS Metadata failed"
64+
fi
65+
done
66+
{{- with .Values.controller.manager }}
67+
{{- if or .extraEnvVars $.Values.podEnv }}
68+
env:
69+
{{- with .extraEnvVars }}
70+
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 12 }}
71+
{{- end }}
72+
{{- with $.Values.podEnv }}
73+
{{- toYaml . | nindent 12 }}
74+
{{- end }}
75+
{{- end }}
76+
{{- end }}
77+
{{- end }}
4678
containers:
4779
- name: manager
4880
securityContext:

deployments/helm/hephaestus/values.yaml

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

0 commit comments

Comments
 (0)