Revision 826d75a1fcd6dcbdac53071fac3b57b73f2f99d1 authored by Ian Vernon on 19 April 2019, 00:16:28 UTC, committed by Ian Vernon on 19 April 2019, 00:18:12 UTC
Signed-off by: Ian Vernon <ian@cilium.io>
1 parent 9c4b907
Raw File
cilium-kube-inject.awk
{ print }

# Add an init container to delay the start of the application containers,
# to reduce the chance of dropping early traffic.
/initContainers:/ {
	indent = $0 ; gsub(/[^ ].*/, "", indent)
	print indent "- name: sleep"
	print indent "  image: busybox:1.28.4"
	print indent "  imagePullPolicy: IfNotPresent"
	print indent "  command: ['sh', '-c', 'max=120; i=0; until nslookup kube-dns.kube-system.svc.cluster.local; do i=$((i + 1)); if [ $i -eq $max ]; then echo timed-out; exit 1; else sleep 1; fi done ']"
}

# Mount the Cilium state directory to give Cilium's Envoy filters access to the
# Cilium API.
/volumeMounts:/ {
	indent = $0 ; gsub(/[^ ].*/, "", indent)
	print indent "- mountPath: /var/run/cilium"
	print indent "  name: cilium-unix-sock-dir"
}

# Define the Cilium state directory which contains the Cilium Unix domain
# sockets required by Cilium's Envoy filters.
/volumes:/ {
	indent = $0 ; gsub(/[^ ]*/, "", indent)
	print indent "- hostPath:"
	print indent "    path: /var/run/cilium"
	print indent "  name: cilium-unix-sock-dir"
}
back to top