113 lines
2.7 KiB
YAML
113 lines
2.7 KiB
YAML
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
name: platform-gateway
|
|
namespace: studio-system
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: Role
|
|
metadata:
|
|
name: platform-gateway-tailscale-state
|
|
namespace: studio-system
|
|
rules:
|
|
- apiGroups: [""]
|
|
resources: ["secrets"]
|
|
verbs: ["get", "create", "update", "patch"]
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: RoleBinding
|
|
metadata:
|
|
name: platform-gateway-tailscale-state
|
|
namespace: studio-system
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: platform-gateway
|
|
namespace: studio-system
|
|
roleRef:
|
|
apiGroup: rbac.authorization.k8s.io
|
|
kind: Role
|
|
name: platform-gateway-tailscale-state
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: platform-gateway
|
|
namespace: studio-system
|
|
labels:
|
|
app: platform-gateway
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: platform-gateway
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: platform-gateway
|
|
spec:
|
|
serviceAccountName: platform-gateway
|
|
containers:
|
|
- name: tailscale
|
|
image: tailscale/tailscale:stable
|
|
env:
|
|
- name: TS_KUBE_SECRET
|
|
value: platform-gateway-tailscale-state
|
|
- name: TS_AUTHKEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: platform-gateway-tailscale-auth
|
|
key: authkey
|
|
- name: TS_HOSTNAME
|
|
value: platform-gateway
|
|
- name: TS_USERSPACE
|
|
value: "false"
|
|
- name: TS_EXTRA_ARGS
|
|
value: --login-server=https://atnmy-hs.duckdns.org --accept-routes
|
|
securityContext:
|
|
capabilities:
|
|
add: ["NET_ADMIN"]
|
|
volumeMounts:
|
|
- name: dev-net-tun
|
|
mountPath: /dev/net/tun
|
|
- name: platform-gateway
|
|
image: localhost:5000/platform-gateway:0.1.0
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- name: http
|
|
containerPort: 4500
|
|
envFrom:
|
|
- secretRef:
|
|
name: platform-gateway-env
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 4500
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 4500
|
|
initialDelaySeconds: 15
|
|
periodSeconds: 20
|
|
volumes:
|
|
- name: dev-net-tun
|
|
hostPath:
|
|
path: /dev/net/tun
|
|
type: CharDevice
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: platform-gateway
|
|
namespace: studio-system
|
|
labels:
|
|
app: platform-gateway
|
|
spec:
|
|
selector:
|
|
app: platform-gateway
|
|
ports:
|
|
- name: http
|
|
port: 4500
|
|
targetPort: 4500
|