feat: install Tailscale

This commit is contained in:
Khue Doan 2024-04-18 19:33:25 +07:00
parent 0d556a6df1
commit eb88f5c306
6 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,7 @@
apiVersion: v2
name: tailscale
version: 0.0.0
dependencies:
- name: app-template
version: 3.1.0
repository: https://bjw-s.github.io/helm-charts

View File

@ -0,0 +1,16 @@
# https://github.com/tailscale/tailscale/blob/main/docs/k8s/role.yaml
# Copyright (c) Tailscale Inc & AUTHORS
# SPDX-License-Identifier: BSD-3-Clause
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: tailscale
namespace: {{ .Release.Namespace }}
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["create"]
- apiGroups: [""]
resourceNames: ["tailscale"]
resources: ["secrets"]
verbs: ["get", "update", "patch"]

View File

@ -0,0 +1,15 @@
# https://github.com/tailscale/tailscale/blob/main/docs/k8s/rolebinding.yaml
# Copyright (c) Tailscale Inc & AUTHORS
# SPDX-License-Identifier: BSD-3-Clause
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: tailscale
namespace: {{ .Release.Namespace }}
subjects:
- kind: ServiceAccount
name: tailscale
roleRef:
kind: Role
name: tailscale
apiGroup: rbac.authorization.k8s.io

View File

@ -0,0 +1,14 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: tailscale-auth
namespace: {{ .Release.Namespace }}
spec:
secretStoreRef:
kind: ClusterSecretStore
name: global-secrets
data:
- secretKey: TS_AUTHKEY
remoteRef:
key: external
property: tailscale-auth-key

View File

@ -0,0 +1,8 @@
# https://github.com/tailscale/tailscale/blob/main/docs/k8s/sa.yaml
# Copyright (c) Tailscale Inc & AUTHORS
# SPDX-License-Identifier: BSD-3-Clause
apiVersion: v1
kind: ServiceAccount
metadata:
name: tailscale
namespace: {{ .Release.Namespace }}

View File

@ -0,0 +1,24 @@
app-template:
serviceAccount:
name: tailscale
controllers:
tailscale:
containers:
app:
image:
repository: ghcr.io/tailscale/tailscale
tag: latest
env:
TS_HOSTNAME: homelab-router
TS_USERSPACE: false
TS_KUBE_SECRET: tailscale
TS_ROUTES: 192.168.1.224/27
TS_AUTHKEY:
valueFrom:
secretKeyRef:
name: tailscale-auth
key: TS_AUTHKEY
securityContext:
capabilities:
add:
- NET_ADMIN