Skip to content

Commit 924756b

Browse files
feat: Redis on tailnet
1 parent d7307ac commit 924756b

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

deploy/charts/nebulous/templates/_helpers.tpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ headscale
4949
https://{{- required ".Values.headscale.domain is required" .Values.headscale.domain }}
5050
{{- end }}
5151

52+
{{- define "tailscale.loginServer" }}
53+
{{- if .Values.headscale.create }}
54+
{{- include "headscale.host" . }}
55+
{{- else }}
56+
{{- required ".Values.tailscale.loginServer is required" .Values.tailscale.loginServer }}
57+
{{- end }}
58+
{{- end }}
59+
5260
{{- define "postgres.name" -}}
5361
postgres
5462
{{- end }}

deploy/charts/nebulous/templates/redis.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,31 @@ spec:
3030
labels:
3131
app: {{ include "redis.name" . }}
3232
spec:
33+
hostNetwork: true
34+
dnsPolicy: ClusterFirstWithHostNet
3335
containers:
36+
- name: tailscale
37+
image: tailscale/tailscale:latest
38+
env:
39+
- name: TS_STATE_DIR
40+
value: /var/lib/tailscale
41+
- name: TS_USERSPACE
42+
value: "true"
43+
- name: TS_AUTH_KEY
44+
valueFrom:
45+
secretKeyRef:
46+
name: {{ .Values.tailscale.secret.name }}
47+
key: {{ .Values.tailscale.secret.keys.authKey }}
48+
- name: TS_EXTRA_ARGS
49+
value: --login-server {{ include "tailscale.loginServer" . }}
50+
volumeMounts:
51+
- name: dev-net-tun
52+
mountPath: /dev/net/tun
53+
securityContext:
54+
capabilities:
55+
add:
56+
- NET_ADMIN
57+
- NET_RAW
3458
- name: redis
3559
image: "redis:{{ .Values.redis.imageTag }}"
3660
command:
@@ -47,6 +71,11 @@ spec:
4771
key: {{ .Values.redis.secret.keys.password }}
4872
ports:
4973
- containerPort: 6379
74+
volumes:
75+
- name: dev-net-tun
76+
hostPath:
77+
path: /dev/net/tun
78+
type: CharDevice
5079
---
5180
apiVersion: v1
5281
kind: Service

deploy/charts/nebulous/values.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ tailscale:
5656
# -- Name of the secret with the Redis connection string and password.
5757
name: "tailscale-secret"
5858
keys:
59-
# -- The key in the secret containing the Tailscale host.
60-
loginServer: "LOGIN_SERVER"
6159
# -- The key in the secret containing the Tailscale API key
6260
apiKey: "API_KEY"
6361
# -- The key in the secret containing the Tailscale auth key

0 commit comments

Comments
 (0)