github.phpd.cn/cilium/cilium@v1.6.12/examples/kubernetes-istio/cilium-kube-inject.awk (about)

     1  { print }
     2  
     3  # Add an init container to delay the start of the application containers,
     4  # to reduce the chance of dropping early traffic.
     5  /initContainers:/ {
     6  	indent = $0 ; sub(/[^ ].*/, "", indent)
     7  	print indent "- name: sleep"
     8  	print indent "  image: busybox:1.28.4"
     9  	print indent "  imagePullPolicy: IfNotPresent"
    10  	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 ']"
    11  }
    12  
    13  # Mount the Cilium state directory to give Cilium's Envoy filters access to the
    14  # Cilium API.
    15  /volumeMounts:/ {
    16  	indent = $0 ; sub(/[^ ].*/, "", indent)
    17  	print indent "- mountPath: /var/run/cilium"
    18  	print indent "  name: cilium-unix-sock-dir"
    19  }
    20  
    21  # Define the Cilium state directory which contains the Cilium Unix domain
    22  # sockets required by Cilium's Envoy filters.
    23  /volumes:/ {
    24  	indent = $0 ; sub(/[^ ].*/, "", indent)
    25  	print indent "- hostPath:"
    26  	print indent "    path: /var/run/cilium"
    27  	print indent "  name: cilium-unix-sock-dir"
    28  }