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
|
|
|
|
kind: ServiceAccount
|
|
|
|
metadata:
|
|
|
|
name: proxies
|
2022-12-14 23:41:26 +00:00
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: Role
|
|
|
|
metadata:
|
|
|
|
name: proxies
|
2022-12-14 23:41:26 +00:00
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
rules:
|
2022-12-14 23:41:26 +00:00
|
|
|
- apiGroups: [""]
|
2022-12-12 19:15:34 +00:00
|
|
|
resources: ["secrets"]
|
|
|
|
verbs: ["*"]
|
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: RoleBinding
|
|
|
|
metadata:
|
|
|
|
name: proxies
|
2022-12-14 23:41:26 +00:00
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
|
|
|
name: proxies
|
2022-12-14 23:41:26 +00:00
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
roleRef:
|
|
|
|
kind: Role
|
|
|
|
name: proxies
|
|
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
|
|
|
metadata:
|
|
|
|
name: operator
|
2022-12-14 23:41:26 +00:00
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: ClusterRole
|
|
|
|
metadata:
|
|
|
|
name: tailscale-operator
|
|
|
|
rules:
|
|
|
|
- apiGroups: [""]
|
2023-08-28 19:44:50 +00:00
|
|
|
resources: ["events", "services", "services/status"]
|
2022-12-12 19:15:34 +00:00
|
|
|
verbs: ["*"]
|
2023-08-24 19:18:17 +00:00
|
|
|
- apiGroups: ["networking.k8s.io"]
|
|
|
|
resources: ["ingresses", "ingresses/status"]
|
|
|
|
verbs: ["*"]
|
2022-12-12 19:15:34 +00:00
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: ClusterRoleBinding
|
|
|
|
metadata:
|
|
|
|
name: tailscale-operator
|
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
|
|
|
name: operator
|
2022-12-14 23:41:26 +00:00
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
roleRef:
|
|
|
|
kind: ClusterRole
|
|
|
|
name: tailscale-operator
|
|
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: Role
|
|
|
|
metadata:
|
|
|
|
name: operator
|
2022-12-14 23:41:26 +00:00
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
rules:
|
2022-12-14 23:41:26 +00:00
|
|
|
- apiGroups: [""]
|
2022-12-12 19:15:34 +00:00
|
|
|
resources: ["secrets"]
|
|
|
|
verbs: ["*"]
|
|
|
|
- apiGroups: ["apps"]
|
|
|
|
resources: ["statefulsets"]
|
|
|
|
verbs: ["*"]
|
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: RoleBinding
|
|
|
|
metadata:
|
|
|
|
name: operator
|
2022-12-14 23:41:26 +00:00
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
|
|
|
name: operator
|
2022-12-14 23:41:26 +00:00
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
roleRef:
|
|
|
|
kind: Role
|
|
|
|
name: operator
|
|
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|
|
---
|
2022-12-14 20:21:16 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: Secret
|
|
|
|
metadata:
|
2022-12-14 23:41:26 +00:00
|
|
|
name: operator-oauth
|
|
|
|
namespace: tailscale
|
2022-12-14 20:21:16 +00:00
|
|
|
stringData:
|
|
|
|
client_id: # SET CLIENT ID HERE
|
|
|
|
client_secret: # SET CLIENT SECRET HERE
|
|
|
|
---
|
2022-12-12 19:15:34 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
2022-12-14 23:41:26 +00:00
|
|
|
name: operator
|
|
|
|
namespace: tailscale
|
2022-12-12 19:15:34 +00:00
|
|
|
spec:
|
|
|
|
replicas: 1
|
|
|
|
strategy:
|
|
|
|
type: Recreate
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
2022-12-14 23:41:26 +00:00
|
|
|
app: operator
|
2022-12-12 19:15:34 +00:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
2022-12-14 23:41:26 +00:00
|
|
|
app: operator
|
2022-12-12 19:15:34 +00:00
|
|
|
spec:
|
|
|
|
serviceAccountName: operator
|
2022-12-14 20:21:16 +00:00
|
|
|
volumes:
|
|
|
|
- name: oauth
|
|
|
|
secret:
|
2022-12-14 23:41:26 +00:00
|
|
|
secretName: operator-oauth
|
2022-12-12 19:15:34 +00:00
|
|
|
containers:
|
2022-12-14 23:41:26 +00:00
|
|
|
- name: operator
|
2023-01-28 02:55:24 +00:00
|
|
|
image: tailscale/k8s-operator:unstable
|
2022-12-12 19:15:34 +00:00
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
cpu: 500m
|
|
|
|
memory: 100Mi
|
|
|
|
env:
|
|
|
|
- name: OPERATOR_HOSTNAME
|
|
|
|
value: tailscale-operator
|
|
|
|
- name: OPERATOR_SECRET
|
2022-12-14 23:41:26 +00:00
|
|
|
value: operator
|
|
|
|
- name: OPERATOR_LOGGING
|
|
|
|
value: info
|
|
|
|
- name: OPERATOR_NAMESPACE
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.namespace
|
2022-12-14 20:21:16 +00:00
|
|
|
- name: CLIENT_ID_FILE
|
|
|
|
value: /oauth/client_id
|
|
|
|
- name: CLIENT_SECRET_FILE
|
|
|
|
value: /oauth/client_secret
|
2022-12-12 19:15:34 +00:00
|
|
|
- name: PROXY_IMAGE
|
2023-01-28 05:31:54 +00:00
|
|
|
value: tailscale/tailscale:unstable
|
2022-12-12 19:15:34 +00:00
|
|
|
- name: PROXY_TAGS
|
|
|
|
value: tag:k8s
|
2023-10-12 03:11:11 +00:00
|
|
|
- name: APISERVER_PROXY
|
2023-02-03 22:47:52 +00:00
|
|
|
value: "false"
|
2023-10-17 17:05:02 +00:00
|
|
|
- name: PROXY_FIREWALL_MODE
|
|
|
|
value: auto
|
2022-12-14 20:21:16 +00:00
|
|
|
volumeMounts:
|
|
|
|
- name: oauth
|
|
|
|
mountPath: /oauth
|
2022-12-14 23:41:26 +00:00
|
|
|
readOnly: true
|