2023-01-27 21:37:20 +00:00
|
|
|
# Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2022-12-12 19:15:34 +00:00
|
|
|
|
2022-12-14 23:41:26 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: Namespace
|
|
|
|
metadata:
|
|
|
|
name: tailscale
|
|
|
|
---
|
2022-12-12 19:15:34 +00:00
|
|
|
apiVersion: v1
|
2023-12-04 10:18:07 +00:00
|
|
|
kind: Secret
|
2022-12-12 19:15:34 +00:00
|
|
|
metadata:
|
2023-12-04 10:18:07 +00:00
|
|
|
name: operator-oauth
|
2022-12-14 23:41:26 +00:00
|
|
|
namespace: tailscale
|
2023-12-04 10:18:07 +00:00
|
|
|
stringData:
|
|
|
|
client_id: # SET CLIENT ID HERE
|
|
|
|
client_secret: # SET CLIENT SECRET HERE
|
2022-12-12 19:15:34 +00:00
|
|
|
---
|
2023-12-04 10:18:07 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
2022-12-12 19:15:34 +00:00
|
|
|
metadata:
|
2023-12-04 10:18:07 +00:00
|
|
|
name: operator
|
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
|
|
|
metadata:
|
2023-12-04 10:18:07 +00:00
|
|
|
name: proxies
|
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: ClusterRole
|
|
|
|
metadata:
|
2023-12-04 10:18:07 +00:00
|
|
|
name: tailscale-operator
|
2022-12-12 19:15:34 +00:00
|
|
|
rules:
|
2023-12-04 10:18:07 +00:00
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
- events
|
|
|
|
- services
|
|
|
|
- services/status
|
|
|
|
verbs:
|
|
|
|
- '*'
|
|
|
|
- apiGroups:
|
|
|
|
- networking.k8s.io
|
|
|
|
resources:
|
|
|
|
- ingresses
|
|
|
|
- ingresses/status
|
|
|
|
verbs:
|
|
|
|
- '*'
|
2023-12-14 13:51:59 +00:00
|
|
|
- apiGroups:
|
|
|
|
- tailscale.com
|
|
|
|
resources:
|
|
|
|
- connectors
|
|
|
|
- connectors/status
|
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
- list
|
|
|
|
- watch
|
|
|
|
- update
|
2022-12-12 19:15:34 +00:00
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: ClusterRoleBinding
|
|
|
|
metadata:
|
2023-12-04 10:18:07 +00:00
|
|
|
name: tailscale-operator
|
2022-12-12 19:15:34 +00:00
|
|
|
roleRef:
|
2023-12-04 10:18:07 +00:00
|
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|
|
kind: ClusterRole
|
|
|
|
name: tailscale-operator
|
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
|
|
|
name: operator
|
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: Role
|
|
|
|
metadata:
|
2023-12-04 10:18:07 +00:00
|
|
|
name: operator
|
|
|
|
namespace: tailscale
|
|
|
|
rules:
|
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
- secrets
|
|
|
|
verbs:
|
|
|
|
- '*'
|
|
|
|
- apiGroups:
|
|
|
|
- apps
|
|
|
|
resources:
|
|
|
|
- statefulsets
|
|
|
|
verbs:
|
|
|
|
- '*'
|
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: Role
|
|
|
|
metadata:
|
|
|
|
name: proxies
|
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
rules:
|
2023-12-04 10:18:07 +00:00
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
- secrets
|
|
|
|
verbs:
|
|
|
|
- '*'
|
2022-12-12 19:15:34 +00:00
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: RoleBinding
|
|
|
|
metadata:
|
2023-12-04 10:18:07 +00:00
|
|
|
name: operator
|
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
roleRef:
|
2023-12-04 10:18:07 +00:00
|
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|
|
kind: Role
|
|
|
|
name: operator
|
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
|
|
|
name: operator
|
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
---
|
2023-12-04 10:18:07 +00:00
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: RoleBinding
|
2022-12-14 20:21:16 +00:00
|
|
|
metadata:
|
2023-12-04 10:18:07 +00:00
|
|
|
name: proxies
|
|
|
|
namespace: tailscale
|
|
|
|
roleRef:
|
|
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|
|
kind: Role
|
|
|
|
name: proxies
|
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
|
|
|
name: proxies
|
|
|
|
namespace: tailscale
|
2022-12-14 20:21:16 +00:00
|
|
|
---
|
2022-12-12 19:15:34 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
2023-12-04 10:18:07 +00:00
|
|
|
name: operator
|
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
spec:
|
2023-12-04 10:18:07 +00:00
|
|
|
replicas: 1
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: operator
|
|
|
|
strategy:
|
|
|
|
type: Recreate
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: operator
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- env:
|
|
|
|
- name: OPERATOR_HOSTNAME
|
|
|
|
value: tailscale-operator
|
|
|
|
- name: OPERATOR_SECRET
|
|
|
|
value: operator
|
|
|
|
- name: OPERATOR_LOGGING
|
|
|
|
value: info
|
|
|
|
- name: OPERATOR_NAMESPACE
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.namespace
|
2023-12-14 13:51:59 +00:00
|
|
|
- name: ENABLE_CONNECTOR
|
|
|
|
value: "false"
|
2023-12-04 10:18:07 +00:00
|
|
|
- name: CLIENT_ID_FILE
|
|
|
|
value: /oauth/client_id
|
|
|
|
- name: CLIENT_SECRET_FILE
|
|
|
|
value: /oauth/client_secret
|
|
|
|
- name: PROXY_IMAGE
|
|
|
|
value: tailscale/tailscale:unstable
|
|
|
|
- name: PROXY_TAGS
|
|
|
|
value: tag:k8s
|
|
|
|
- name: APISERVER_PROXY
|
|
|
|
value: "false"
|
|
|
|
- name: PROXY_FIREWALL_MODE
|
|
|
|
value: auto
|
|
|
|
image: tailscale/k8s-operator:unstable
|
|
|
|
imagePullPolicy: Always
|
|
|
|
name: operator
|
|
|
|
volumeMounts:
|
|
|
|
- mountPath: /oauth
|
|
|
|
name: oauth
|
|
|
|
readOnly: true
|
|
|
|
nodeSelector:
|
|
|
|
kubernetes.io/os: linux
|
|
|
|
serviceAccountName: operator
|
|
|
|
volumes:
|
|
|
|
- name: oauth
|
|
|
|
secret:
|
|
|
|
secretName: operator-oauth
|