Userspace-mode subnet router advertising only the node (192.168.2.218/32). Auth key comes from OpenBao via ESO; node state is kept in a Kubernetes Secret so the identity survives restarts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
74 lines
2.2 KiB
YAML
74 lines
2.2 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: tailscale
|
|
namespace: {{ .Values.namespace }}
|
|
labels:
|
|
app.kubernetes.io/name: tailscale
|
|
spec:
|
|
replicas: 1
|
|
# One node identity: never run two pods with the same state at once.
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: tailscale
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: tailscale
|
|
spec:
|
|
serviceAccountName: tailscale
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
runAsUser: 1000
|
|
runAsGroup: 1000
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
containers:
|
|
- name: tailscale
|
|
image: {{ .Values.image }}
|
|
imagePullPolicy: IfNotPresent
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
readOnlyRootFilesystem: true
|
|
capabilities:
|
|
drop: ["ALL"]
|
|
env:
|
|
# Userspace networking: no /dev/net/tun, no NET_ADMIN. Subnet routing still
|
|
# works - forwarded connections originate from the pod and reach the node IP.
|
|
- name: TS_USERSPACE
|
|
value: "true"
|
|
- name: TS_KUBE_SECRET
|
|
value: {{ .Values.stateSecret | quote }}
|
|
- name: TS_HOSTNAME
|
|
value: {{ .Values.hostname | quote }}
|
|
- name: TS_ROUTES
|
|
value: {{ join "," .Values.routes | quote }}
|
|
- name: TS_ACCEPT_DNS
|
|
value: "false"
|
|
{{- with .Values.extraArgs }}
|
|
- name: TS_EXTRA_ARGS
|
|
value: {{ . | quote }}
|
|
{{- end }}
|
|
- name: TS_AUTHKEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: tailscale-auth
|
|
key: TS_AUTHKEY
|
|
# containerboot writes its socket/state helpers here.
|
|
- name: TS_SOCKET
|
|
value: /tmp/tailscaled.sock
|
|
- name: HOME
|
|
value: /tmp
|
|
volumeMounts:
|
|
- name: tmp
|
|
mountPath: /tmp
|
|
{{- with .Values.resources }}
|
|
resources:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: tmp
|
|
emptyDir: {}
|