add headscale
This commit is contained in:
parent
7049403d60
commit
2e711d1be6
77
infrastructure/headscale/deployment.yaml
Normal file
77
infrastructure/headscale/deployment.yaml
Normal file
@ -0,0 +1,77 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: headscale
|
||||
labels:
|
||||
app: headscale
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: headscale
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: headscale
|
||||
spec:
|
||||
shareProcessNamespace: true
|
||||
serviceAccountName: default
|
||||
containers:
|
||||
- name: headplane
|
||||
image: headplane
|
||||
env:
|
||||
# Set these if the pod name for Headscale is not static
|
||||
# We will use the downward API to get the pod name instead
|
||||
- name: HEADPLANE_LOAD_ENV_OVERRIDES
|
||||
value: 'true'
|
||||
- name: 'HEADPLANE_INTEGRATION__KUBERNETES__POD_NAME'
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
volumeMounts:
|
||||
- name: headscale-config
|
||||
mountPath: /etc/headscale/config.yaml
|
||||
subPath: config.yaml
|
||||
- name: headplane-config
|
||||
mountPath: /etc/headplane/config.yaml
|
||||
subPath: config.yaml
|
||||
- name: headplane-data
|
||||
mountPath: /var/lib/headplane
|
||||
|
||||
- name: headscale
|
||||
image: headscale
|
||||
args: ["serve"]
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
# env:
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
volumeMounts:
|
||||
- name: headscale-config
|
||||
mountPath: /etc/headscale/config.yaml
|
||||
subPath: config.yaml
|
||||
- mountPath: /persistence
|
||||
name: headscale-data
|
||||
|
||||
terminationGracePeriodSeconds: 30
|
||||
volumes:
|
||||
- name: headscale-config
|
||||
configMap:
|
||||
name: headscale-config
|
||||
- name: headscale-data
|
||||
persistentVolumeClaim:
|
||||
claimName: headscale-data
|
||||
|
||||
- name: headplane-config
|
||||
configMap:
|
||||
name: headplane-config
|
||||
- name: headplane-data
|
||||
persistentVolumeClaim:
|
||||
claimName: headplane-data
|
17
infrastructure/headscale/ingress.yaml
Normal file
17
infrastructure/headscale/ingress.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: headscale-ingressroute
|
||||
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure
|
||||
routes:
|
||||
- match: Host(`headscale.kluster.moll.re`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: headscale-web
|
||||
port: 8080
|
||||
|
||||
tls:
|
||||
certResolver: default-tls
|
22
infrastructure/headscale/kustomization.yaml
Normal file
22
infrastructure/headscale/kustomization.yaml
Normal file
@ -0,0 +1,22 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
namespace: headscale
|
||||
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- headscale-config.configmap.yaml
|
||||
- headplane-config.configmap.yaml
|
||||
- pvc.yaml
|
||||
- deployment.yaml
|
||||
- serviceaccount.yaml
|
||||
- service.yaml
|
||||
- ingress.yaml
|
||||
|
||||
images:
|
||||
- name: headscale
|
||||
newName: headscale/headscale # has all plugins
|
||||
newTag: v0.25.1
|
||||
- name: headplane
|
||||
newName: ghcr.io/tale/headplane
|
||||
newTag: "0.5.10"
|
6
infrastructure/headscale/namespace.yaml
Normal file
6
infrastructure/headscale/namespace.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: placeholder
|
||||
labels:
|
||||
pod-security.kubernetes.io/enforce: privileged
|
23
infrastructure/headscale/pvc.yaml
Normal file
23
infrastructure/headscale/pvc.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: headscale-data
|
||||
spec:
|
||||
storageClassName: "nfs-client"
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
---
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: headplane-data
|
||||
spec:
|
||||
storageClassName: "nfs-client"
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
10
infrastructure/headscale/service.yaml
Normal file
10
infrastructure/headscale/service.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: headscale-web
|
||||
spec:
|
||||
selector:
|
||||
app: headscale
|
||||
ports:
|
||||
- port: 8080
|
||||
targetPort: 8080
|
26
infrastructure/headscale/serviceaccount.yaml
Normal file
26
infrastructure/headscale/serviceaccount.yaml
Normal file
@ -0,0 +1,26 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: headplane-agent
|
||||
# namespace: default # Adjust namespace as needed
|
||||
rules:
|
||||
- apiGroups: ['']
|
||||
resources: ['pods']
|
||||
verbs: ['get', 'list']
|
||||
- apiGroups: ['apps']
|
||||
resources: ['deployments']
|
||||
verbs: ['get', 'list']
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: headplane-agent
|
||||
# namespace: default # Adjust namespace as needed
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: headplane-agent
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: default # If you use a different service account, change this
|
||||
# namespace: default # Adjust namespace as needed
|
Loading…
x
Reference in New Issue
Block a user