Compare commits

..

3 Commits

Author SHA1 Message Date
gitea-admin 1e2c451dfb feat: deploy Tailscale Operator
Validate Manifests / validate (pull_request) Has been cancelled
2026-05-09 19:07:00 +00:00
gitea-admin 20423ab28a feat: deploy Tailscale Operator 2026-05-09 19:07:00 +00:00
gitea-admin cdeb5241a4 feat: deploy Tailscale Operator 2026-05-09 19:07:00 +00:00
28 changed files with 207 additions and 304 deletions
-6
View File
@@ -1,6 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: apps
labels:
name: apps
@@ -1,18 +0,0 @@
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: tailscale-auth
namespace: tailscale
spec:
refreshInterval: 1h
secretStoreRef:
name: orion-vault
kind: ClusterSecretStore
target:
name: tailscale-auth
creationPolicy: Owner
data:
- secretKey: TS_AUTH_KEY
remoteRef:
key: Talos Cluster/tailscale
property: TS_AUTH_KEY
@@ -1,17 +0,0 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: tailscale-operator
rules:
- apiGroups: [""]
resources: ["secrets", "configmaps", "services", "pods", "endpoints"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups: ["apps"]
resources: ["deployments", "statefulsets", "daemonsets"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups: ["networking.k8s.io"]
resources: ["ingresses"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups: ["tailscale.com"]
resources: ["*"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
@@ -1,12 +0,0 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tailscale-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: tailscale-operator
subjects:
- kind: ServiceAccount
name: tailscale-operator
namespace: tailscale
@@ -1,43 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: tailscale-operator
namespace: tailscale
labels:
app: tailscale-operator
spec:
replicas: 1
selector:
matchLabels:
app: tailscale-operator
template:
metadata:
labels:
app: tailscale-operator
spec:
serviceAccountName: tailscale-operator
containers:
- name: operator
image: ghcr.io/tailscale/k8s-operator:v1.78.3
imagePullPolicy: IfNotPresent
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: CLIENT_ID_FILE
value: /etc/tailscale/oauth/client-id
- name: CLIENT_SECRET_FILE
value: /etc/tailscale/oauth/client-secret
volumeMounts:
- name: oauth-secret
mountPath: /etc/tailscale/oauth
readOnly: true
volumes:
- name: oauth-secret
secret:
secretName: tailscale-operator-secret
@@ -1,22 +0,0 @@
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: tailscale-operator-secret
namespace: tailscale
spec:
refreshInterval: 1h
secretStoreRef:
name: orion-vault
kind: ClusterSecretStore
target:
name: tailscale-operator-secret
creationPolicy: Owner
data:
- secretKey: client-id
remoteRef:
key: tailscale/operator
property: CLIENT_ID_FILE
- secretKey: client-secret
remoteRef:
key: tailscale/operator
property: CLIENT_SECRET_FILE
@@ -1,7 +0,0 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: tailscale-operator
namespace: tailscale
labels:
app: tailscale-operator
-29
View File
@@ -1,29 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: whoami
namespace: apps
labels:
app: whoami
spec:
replicas: 1
selector:
matchLabels:
app: whoami
template:
metadata:
labels:
app: whoami
spec:
containers:
- name: whoami
image: traefik/whoami:latest
ports:
- containerPort: 80
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 200m
memory: 128Mi
-26
View File
@@ -1,26 +0,0 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: whoami
namespace: apps
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
traefik.ingress.kubernetes.io/router.tls: "true"
spec:
ingressClassName: traefik
tls:
- hosts:
- whoami.khalisio.com
secretName: whoami-tls
rules:
- host: whoami.khalisio.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: whoami
port:
number: 80
-13
View File
@@ -1,13 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: whoami
namespace: apps
spec:
selector:
app: whoami
ports:
- name: http
port: 80
targetPort: 80
type: ClusterIP
+12
View File
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
name: tailscale-operator-secret
namespace: tailscale
labels:
app.kubernetes.io/name: tailscale
app.kubernetes.io/component: operator
type: Opaque
data:
# TODO: Fill in the Tailscale auth key (base64 encoded)
authkey: PLACEHOLDER
+50 -27
View File
@@ -4,40 +4,63 @@ metadata:
name: tailscale-operator
namespace: tailscale
labels:
app: tailscale-operator
app.kubernetes.io/name: tailscale
app.kubernetes.io/component: operator
spec:
replicas: 1
selector:
matchLabels:
app: tailscale-operator
app.kubernetes.io/name: tailscale
app.kubernetes.io/component: operator
template:
metadata:
labels:
app: tailscale-operator
app.kubernetes.io/name: tailscale
app.kubernetes.io/component: operator
spec:
serviceAccountName: tailscale-operator
securityContext:
runAsNonRoot: true
containers:
- name: operator
image: ghcr.io/tailscale/k8s-operator:v1.78.3
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: CLIENT_ID_FILE
value: /etc/tailscale/operator/client-id
- name: CLIENT_SECRET_FILE
value: /etc/tailscale/operator/client-secret
volumeMounts:
- name: operator-secret
mountPath: /etc/tailscale/operator
readOnly: true
resources: {}
volumes:
- name: operator-secret
secret:
secretName: tailscale-operator-secret
- name: operator
image: ghcr.io/tailscale/operator:v1.76.0
args:
- --hostname=$(POD_NAME)
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
envFrom:
- secretRef:
name: tailscale-operator-secret
ports:
- containerPort: 8080
name: metrics
protocol: TCP
resources:
requests:
cpu: 10m
memory: 64Mi
limits:
cpu: 100m
memory: 128Mi
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsUser: 1000
runAsGroup: 1000
capabilities:
drop:
- ALL
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
+7
View File
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
name: tailscale
labels:
app.kubernetes.io/name: tailscale
app.kubernetes.io/component: operator
-42
View File
@@ -1,42 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: tailscale-operator
namespace: tailscale
labels:
app: tailscale-operator
spec:
replicas: 1
selector:
matchLabels:
app: tailscale-operator
template:
metadata:
labels:
app: tailscale-operator
spec:
serviceAccountName: tailscale-operator
containers:
- name: operator
image: ghcr.io/tailscale/k8s-operator:v1.78.3
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: TS_CLIENT_ID_FILE
value: /etc/tailscale/oauth/client-id
- name: TS_CLIENT_SECRET_FILE
value: /etc/tailscale/oauth/client-secret
volumeMounts:
- name: oauth-secret
mountPath: /etc/tailscale/oauth
readOnly: true
volumes:
- name: oauth-secret
secret:
secretName: tailscale-operator-secret
+48
View File
@@ -0,0 +1,48 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: tailscale-operator
namespace: tailscale
labels:
app.kubernetes.io/name: tailscale
app.kubernetes.io/component: operator
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: tailscale-operator
labels:
app.kubernetes.io/name: tailscale
app.kubernetes.io/component: operator
rules:
- apiGroups: ['']
resources: ['secrets', 'services', 'endpoints']
verbs: ['get', 'list', 'watch', 'create', 'update', 'patch', 'delete']
- apiGroups: ['']
resources: ['nodes']
verbs: ['get', 'list', 'update', 'patch']
- apiGroups: ['apps']
resources: ['daemonsets']
verbs: ['get', 'list', 'watch']
- apiGroups: ['tailscale.com']
resources: ['*']
verbs: ['get', 'list', 'watch', 'create', 'update', 'patch', 'delete']
- apiGroups: ['coordination.k8s.io']
resources: ['leases']
verbs: ['get', 'create', 'update']
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tailscale-operator
labels:
app.kubernetes.io/name: tailscale
app.kubernetes.io/component: operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: tailscale-operator
subjects:
- kind: ServiceAccount
name: tailscale-operator
namespace: tailscale
+18
View File
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: tailscale-operator
namespace: tailscale
labels:
app.kubernetes.io/name: tailscale
app.kubernetes.io/component: operator
spec:
type: ClusterIP
ports:
- name: metrics
port: 8080
targetPort: 8080
protocol: TCP
selector:
app.kubernetes.io/name: tailscale
app.kubernetes.io/component: operator
@@ -1,42 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: tailscale-operator
namespace: tailscale
labels:
app: tailscale-operator
spec:
replicas: 1
selector:
matchLabels:
app: tailscale-operator
template:
metadata:
labels:
app: tailscale-operator
spec:
serviceAccountName: tailscale-operator
containers:
- name: operator
image: ghcr.io/tailscale/k8s-operator:v1.78.3
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: TS_CLIENT_ID_FILE
value: /etc/tailscale/oauth/client-id
- name: TS_CLIENT_SECRET_FILE
value: /etc/tailscale/oauth/client-secret
volumeMounts:
- name: oauth-secret
mountPath: /etc/tailscale/oauth
readOnly: true
volumes:
- name: oauth-secret
secret:
secretName: tailscale-operator-secret
@@ -2,3 +2,5 @@ apiVersion: v1
kind: Namespace
metadata:
name: tailscale
labels:
name: tailscale
@@ -0,0 +1,34 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: tailscale-operator
namespace: tailscale
labels:
app: tailscale-operator
spec:
replicas: 1
selector:
matchLabels:
app: tailscale-operator
template:
metadata:
labels:
app: tailscale-operator
spec:
serviceAccountName: tailscale-operator
containers:
- name: operator
image: ghcr.io/tailscale/k8s-operator:v1.78.3
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: TAILSCALE_API_CLIENT_ID
value: ""
- name: TAILSCALE_API_CLIENT_SECRET
value: ""
@@ -0,0 +1,36 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: tailscale-operator
namespace: tailscale
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: tailscale-operator
rules:
- apiGroups: [""]
resources: ["pods", "services", "endpoints", "namespaces", "events", "configmaps"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
- apiGroups: ["apps"]
resources: ["deployments", "daemonsets"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
- apiGroups: ["tailscale.com"]
resources: ["*"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
- apiGroups: ["networking.k8s.io"]
resources: ["ingressclasses"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tailscale-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: tailscale-operator
subjects:
- kind: ServiceAccount
name: tailscale-operator
namespace: tailscale