Files
truecharts/charts/stable/tailscale/templates/_configmap.tpl
T
Stavros KoisandGitHub e1224804c3 fix(tailscale): switch to the new golang binary (#4307)
* fix(tailscale): switch to the new golang binary

* temp, let CI  install tailscale

* test without secret

* change key name in secret

* change socket to varrun, which is the default that `tailscale` command looks for

* test with varrun enabled

* remove tty

* don't try to install TS

* dont load authkey as env

* update vpn template

* remove /var/lib as it now uses kubesecret for the state

* bump
2022-11-05 20:24:36 +02:00

52 lines
1.6 KiB
Smarty

{{/* Define the secret */}}
{{- define "tailscale.config" -}}
{{- $configName := printf "%s-tailscale-config" (include "tc.common.names.fullname" .) }}
{{- $secretName := printf "%s-tailscale-secret" (include "tc.common.names.fullname" .) }}
{{- $customArgs := "" -}}
{{- if .Values.tailscale.hostname }}
{{- $customArgs = (printf "--hostname %v %v" .Values.tailscale.hostname $customArgs | trim) -}}
{{- end }}
{{- if .Values.tailscale.advertise_as_exit_node }}
{{- $customArgs = (printf "--advertise-exit-node %v" $customArgs | trim) -}}
{{- end }}
{{- if .Values.tailscale.extra_args }}
{{- $customArgs = (printf "%v %v" .Values.tailscale.extra_args $customArgs | trim) -}}
{{- end }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $configName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
data:
TS_KUBE_SECRET: {{ $secretName | squote }}
TS_SOCKET: /var/run/tailscale/tailscaled.sock
TS_USERSPACE: {{ .Values.tailscale.userspace | quote }}
TS_ACCEPT_DNS: {{ .Values.tailscale.accept_dns | quote }}
TS_AUTH_ONCE: {{ .Values.tailscale.auth_once | quote }}
{{- with .Values.tailscale.routes }}
TS_ROUTES: {{ . }}
{{- end }}
{{- with .Values.tailscale.dest_ip }}
TS_DEST_IP: {{ . }}
{{- end }}
{{- with .Values.tailscale.sock5_server }}
TS_SOCK5_SERVER: {{ . }}
{{- end }}
{{- with .Values.tailscale.daemon_extra_args }}
TS_TAILSCALED_EXTRA_ARGS: {{ . | quote }}
{{- end }}
{{- with $customArgs }}
TS_EXTRA_ARGS: {{ . | quote }}
{{- end }}
{{- with .Values.tailscale.outbound_http_proxy_listen }}
TS_OUTBOUND_HTTP_PROXY_LISTEN: {{ . | quote }}
{{- end }}
{{- end }}