|
| 1 | +{{- if and .Values.encryption.enabled (eq .Values.encryption.type "ztunnel") }} |
| 2 | +--- |
| 3 | +kind: DaemonSet |
| 4 | +apiVersion: apps/v1 |
| 5 | +metadata: |
| 6 | + name: ztunnel-cilium |
| 7 | + namespace: {{ include "cilium.namespace" . }} |
| 8 | + {{- with .Values.encryption.ztunnel.annotations }} |
| 9 | + annotations: |
| 10 | + {{- toYaml . | nindent 4 }} |
| 11 | + {{- end }} |
| 12 | + labels: |
| 13 | + app: ztunnel-cilium |
| 14 | + app.kubernetes.io/part-of: cilium |
| 15 | + app.kubernetes.io/name: ztunnel-cilium |
| 16 | + {{- with .Values.commonLabels }} |
| 17 | + {{- toYaml . | nindent 4 }} |
| 18 | + {{- end }} |
| 19 | +spec: |
| 20 | + revisionHistoryLimit: 10 |
| 21 | + selector: |
| 22 | + matchLabels: |
| 23 | + app: ztunnel-cilium |
| 24 | + {{- with .Values.encryption.ztunnel.updateStrategy }} |
| 25 | + updateStrategy: |
| 26 | + {{- toYaml . | trim | nindent 4 }} |
| 27 | + {{- end }} |
| 28 | + template: |
| 29 | + metadata: |
| 30 | + annotations: |
| 31 | + sidecar.istio.io/inject: "false" |
| 32 | + {{- with .Values.encryption.ztunnel.podAnnotations }} |
| 33 | + {{- toYaml . | nindent 8 }} |
| 34 | + {{- end }} |
| 35 | + labels: |
| 36 | + app: ztunnel-cilium |
| 37 | + app.kubernetes.io/part-of: cilium |
| 38 | + app.kubernetes.io/name: ztunnel-cilium |
| 39 | + {{- with .Values.commonLabels }} |
| 40 | + {{- toYaml . | nindent 8 }} |
| 41 | + {{- end }} |
| 42 | + {{- with .Values.encryption.ztunnel.podLabels }} |
| 43 | + {{- toYaml . | nindent 8 }} |
| 44 | + {{- end }} |
| 45 | + spec: |
| 46 | + {{- with .Values.imagePullSecrets }} |
| 47 | + imagePullSecrets: |
| 48 | + {{- toYaml . | nindent 8 }} |
| 49 | + {{- end }} |
| 50 | + hostNetwork: true |
| 51 | + dnsPolicy: ClusterFirst |
| 52 | + containers: |
| 53 | + - name: istio-proxy |
| 54 | + image: {{ include "cilium.image" .Values.encryption.ztunnel.image | quote }} |
| 55 | + imagePullPolicy: {{ .Values.encryption.ztunnel.image.pullPolicy }} |
| 56 | + args: |
| 57 | + - proxy |
| 58 | + - ztunnel |
| 59 | + env: |
| 60 | + - name: XDS_ADDRESS |
| 61 | + value: "https://localhost:15012" |
| 62 | + - name: XDS_ROOT_CA |
| 63 | + value: "/etc/ztunnel/bootstrap-root.crt" |
| 64 | + - name: CA_ROOT_CA |
| 65 | + value: "/etc/ztunnel/bootstrap-root.crt" |
| 66 | + - name: CA_ADDRESS |
| 67 | + value: {{ .Values.encryption.ztunnel.caAddress | quote }} |
| 68 | + - name: ISTIO_META_DNS_CAPTURE |
| 69 | + value: "false" |
| 70 | + - name: INPOD_UDS |
| 71 | + value: "/var/run/cilium/ztunnel.sock" |
| 72 | + - name: NODE_NAME |
| 73 | + valueFrom: |
| 74 | + fieldRef: |
| 75 | + apiVersion: v1 |
| 76 | + fieldPath: status.hostIP |
| 77 | + - name: INSTANCE_IP |
| 78 | + valueFrom: |
| 79 | + fieldRef: |
| 80 | + apiVersion: v1 |
| 81 | + fieldPath: status.podIP |
| 82 | + - name: ISTIO_META_ENABLE_HBONE |
| 83 | + value: "true" |
| 84 | + {{- with .Values.encryption.ztunnel.extraEnv }} |
| 85 | + {{- toYaml . | trim | nindent 12 }} |
| 86 | + {{- end }} |
| 87 | + readinessProbe: |
| 88 | + httpGet: |
| 89 | + path: /healthz/ready |
| 90 | + port: {{ .Values.encryption.ztunnel.healthPort }} |
| 91 | + host: "127.0.0.1" |
| 92 | + scheme: HTTP |
| 93 | + initialDelaySeconds: {{ .Values.encryption.ztunnel.readinessProbe.initialDelaySeconds }} |
| 94 | + periodSeconds: {{ .Values.encryption.ztunnel.readinessProbe.periodSeconds }} |
| 95 | + failureThreshold: {{ .Values.encryption.ztunnel.readinessProbe.failureThreshold }} |
| 96 | + successThreshold: 1 |
| 97 | + timeoutSeconds: 1 |
| 98 | + {{- with .Values.encryption.ztunnel.resources }} |
| 99 | + resources: |
| 100 | + {{- toYaml . | trim | nindent 12 }} |
| 101 | + {{- end }} |
| 102 | + securityContext: |
| 103 | + allowPrivilegeEscalation: true |
| 104 | + capabilities: |
| 105 | + add: |
| 106 | + - NET_ADMIN |
| 107 | + - SYS_ADMIN |
| 108 | + - NET_RAW |
| 109 | + drop: |
| 110 | + - ALL |
| 111 | + privileged: false |
| 112 | + readOnlyRootFilesystem: true |
| 113 | + runAsGroup: 1337 |
| 114 | + runAsNonRoot: false |
| 115 | + runAsUser: 0 |
| 116 | + terminationMessagePath: /dev/termination-log |
| 117 | + terminationMessagePolicy: File |
| 118 | + volumeMounts: |
| 119 | + - mountPath: /var/run/cilium |
| 120 | + name: cilium-dir |
| 121 | + readOnly: false |
| 122 | + - mountPath: /etc/ztunnel |
| 123 | + name: cilium-ztunnel-secrets |
| 124 | + readOnly: true |
| 125 | + {{- with .Values.encryption.ztunnel.extraVolumeMounts }} |
| 126 | + {{- toYaml . | nindent 12 }} |
| 127 | + {{- end }} |
| 128 | + {{- with .Values.encryption.ztunnel.affinity }} |
| 129 | + affinity: |
| 130 | + {{- toYaml . | nindent 8 }} |
| 131 | + {{- end }} |
| 132 | + {{- with .Values.encryption.ztunnel.nodeSelector }} |
| 133 | + nodeSelector: |
| 134 | + {{- toYaml . | trim | nindent 8 }} |
| 135 | + {{- end }} |
| 136 | + {{- with .Values.encryption.ztunnel.tolerations }} |
| 137 | + tolerations: |
| 138 | + {{- toYaml . | trim | nindent 8 }} |
| 139 | + {{- end }} |
| 140 | + priorityClassName: {{ include "cilium.priorityClass" (list $ .Values.encryption.ztunnel.priorityClassName "system-node-critical") }} |
| 141 | + restartPolicy: Always |
| 142 | + terminationGracePeriodSeconds: {{ .Values.encryption.ztunnel.terminationGracePeriodSeconds }} |
| 143 | + {{- if .Values.serviceAccounts.ztunnel.create }} |
| 144 | + serviceAccountName: {{ .Values.serviceAccounts.ztunnel.name | quote }} |
| 145 | + automountServiceAccountToken: {{ .Values.serviceAccounts.ztunnel.automount }} |
| 146 | + {{- else }} |
| 147 | + automountServiceAccountToken: false |
| 148 | + {{- end }} |
| 149 | + volumes: |
| 150 | + - name: cilium-dir |
| 151 | + hostPath: |
| 152 | + path: /var/run/cilium |
| 153 | + type: DirectoryOrCreate |
| 154 | + - name: cilium-ztunnel-secrets |
| 155 | + secret: |
| 156 | + secretName: cilium-ztunnel-secrets |
| 157 | + defaultMode: 420 |
| 158 | + items: |
| 159 | + - key: bootstrap-root.crt |
| 160 | + path: bootstrap-root.crt |
| 161 | + mode: 420 |
| 162 | + {{- with .Values.encryption.ztunnel.extraVolumes }} |
| 163 | + {{- toYaml . | nindent 8 }} |
| 164 | + {{- end }} |
| 165 | +{{- end }} |
0 commit comments