Merge pull request 'feat: deploy Tailscale Operator and auth secret' (#17) from orion/auto/feat-deploy-tailscale-operator-and-auth--1778378566626 into main
Reviewed-on: #17
This commit was merged in pull request #17.
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: tailscale-operator
|
||||||
|
labels:
|
||||||
|
app: tailscale-operator
|
||||||
|
rules:
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["pods", "services", "secrets", "configmaps"]
|
||||||
|
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
||||||
|
- apiGroups: ["apps"]
|
||||||
|
resources: ["deployments", "statefulsets"]
|
||||||
|
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
||||||
|
- apiGroups: ["discovery.k8s.io"]
|
||||||
|
resources: ["endpointslices"]
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: ["coordination.k8s.io"]
|
||||||
|
resources: ["leases"]
|
||||||
|
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: tailscale-operator
|
||||||
|
labels:
|
||||||
|
app: tailscale-operator
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: tailscale-operator
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: tailscale-operator
|
||||||
|
namespace: apps
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: tailscale-operator
|
||||||
|
namespace: apps
|
||||||
|
labels:
|
||||||
|
app: tailscale-operator
|
||||||
|
data:
|
||||||
|
TS_KUBE_OBJECT_STORE: "true"
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: tailscale-operator
|
||||||
|
namespace: apps
|
||||||
|
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:1.72.0
|
||||||
|
env:
|
||||||
|
- name: TS_AUTH_KEY
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: tailscale-auth
|
||||||
|
key: TS_AUTH_KEY
|
||||||
|
- name: POD_NAME
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: metadata.name
|
||||||
|
- name: POD_NAMESPACE
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: metadata.namespace
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 50m
|
||||||
|
memory: 64Mi
|
||||||
|
limits:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
@@ -2,20 +2,17 @@ apiVersion: external-secrets.io/v1
|
|||||||
kind: ExternalSecret
|
kind: ExternalSecret
|
||||||
metadata:
|
metadata:
|
||||||
name: tailscale-auth
|
name: tailscale-auth
|
||||||
namespace: tailscale
|
namespace: apps
|
||||||
labels:
|
labels:
|
||||||
app: tailscale
|
app: tailscale-operator
|
||||||
managed-by: orion
|
|
||||||
spec:
|
spec:
|
||||||
refreshInterval: "1h"
|
refreshInterval: 1h
|
||||||
secretStoreRef:
|
secretStoreRef:
|
||||||
name: orion-vault
|
name: orion-vault
|
||||||
kind: ClusterSecretStore
|
kind: ClusterSecretStore
|
||||||
target:
|
target:
|
||||||
name: tailscale-auth
|
name: tailscale-auth
|
||||||
creationPolicy: Owner
|
creationPolicy: Owner
|
||||||
template:
|
|
||||||
type: Opaque
|
|
||||||
data:
|
data:
|
||||||
- secretKey: TS_AUTH_KEY
|
- secretKey: TS_AUTH_KEY
|
||||||
remoteRef:
|
remoteRef:
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: apps
|
||||||
|
labels:
|
||||||
|
name: apps
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: tailscale-operator
|
||||||
|
namespace: apps
|
||||||
|
labels:
|
||||||
|
app: tailscale-operator
|
||||||
Reference in New Issue
Block a user