123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- {{- define "tailscale.workload" -}}
- {{ include "tailscale.validation" $ }}
- workload:
- tailscale:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- automountServiceAccountToken: true
- hostNetwork: {{ .Values.tailscaleNetwork.hostNetwork }}
- sysctls:
- - name: net.ipv4.ip_forward
- value: "1"
- - name: net.ipv6.conf.all.forwarding
- value: "1"
- containers:
- tailscale:
- enabled: true
- primary: true
- imageSelector: image
- command: /usr/local/bin/containerboot
- securityContext:
- {{ if .Values.tailscaleConfig.userspace }}
- runAsUser: 568
- runAsGroup: 568
- {{ else }}
- runAsUser: 0
- runAsGroup: 0
- runAsNonRoot: false
- {{ end }}
- readOnlyRootFilesystem: false
- capabilities:
- add:
- - NET_ADMIN
- - NET_RAW
- env:
- TS_KUBE_SECRET: {{ printf "%s-tailscale-secret" (include "ix.v1.common.lib.chart.names.fullname" .) }}
- TS_SOCKET: /var/run/tailscale/tailscaled.sock
- TS_USERSPACE: {{ .Values.tailscaleConfig.userspace | quote }}
- TS_ACCEPT_DNS: {{ .Values.tailscaleConfig.acceptDns | quote }}
- TS_AUTH_ONCE: {{ .Values.tailscaleConfig.authOnce | quote }}
- {{ with .Values.tailscaleConfig.advertiseRoutes }}
- TS_ROUTES: {{ join "," . }}
- {{ end }}
- {{ with (include "tailscale.args" $) }}
- TS_EXTRA_ARGS: {{ . }}
- {{ end }}
- {{ with .Values.tailscaleConfig.extraDaemonArgs }}
- TS_TAILSCALED_ARGS: {{ join " " . }}
- {{ end }}
- {{ with .Values.tailscaleConfig.additionalEnvs }}
- envList:
- {{ range $env := . }}
- - name: {{ $env.name }}
- value: {{ $env.value }}
- {{ end }}
- {{ end }}
- probes:
- liveness:
- enabled: true
- type: exec
- command:
- - tailscale
- - status
- readiness:
- enabled: true
- type: exec
- command:
- - tailscale
- - status
- startup:
- enabled: true
- type: exec
- command:
- - tailscale
- - status
- {{/* RBAC */}}
- serviceAccount:
- tailscale:
- enabled: true
- primary: true
- rbac:
- tailscale:
- enabled: true
- primary: true
- rules:
- - apiGroups:
- - ""
- resources:
- - secrets
- verbs:
- - create
- - apiGroups:
- - ""
- resources:
- - secrets
- resourceNames:
- - {{ printf "%s-tailscale-secret" (include "ix.v1.common.lib.chart.names.fullname" .) }}
- verbs:
- - get
- - update
- - patch
- {{/* Persistence */}}
- persistence:
- tun-dev:
- enabled: {{ not .Values.tailscaleConfig.userspace }}
- type: device
- hostPath: /dev/net/tun
- targetSelector:
- tailscale:
- tailscale:
- mountPath: /dev/net/tun
- var-run:
- enabled: true
- type: emptyDir
- targetSelector:
- tailscale:
- tailscale:
- mountPath: /var/run
- cache:
- enabled: true
- type: emptyDir
- targetSelector:
- tailscale:
- tailscale:
- mountPath: /.cache
- {{/* Secret */}}
- secret:
- tailscale-secret:
- enabled: true
- data:
- {{/* Name "authkey" must not be changed, it's what tailscale looks for */}}
- authkey: {{ .Values.tailscaleConfig.authkey }}
- {{- end -}}
|