Files
rice-flakes/modules/k3s/netbird/server.yaml
T

97 lines
2.3 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: netbird-server
namespace: netbird
spec:
replicas: 1
selector:
matchLabels:
app: netbird-server
template:
metadata:
labels:
app: netbird-server
spec:
initContainers:
- name: render-config
image: busybox
env:
- name: AUTH_SECRET
valueFrom:
secretKeyRef:
name: netbird-relay-auth
key: authSecret
- name: STORE_KEY
valueFrom:
secretKeyRef:
name: netbird-encryption
key: encryptionKey
command:
- sh
- -c
- |
sed -e "s|__AUTH_SECRET__|$AUTH_SECRET|g" \
-e "s|__STORE_ENCRYPTION_KEY__|$STORE_KEY|g" \
/tpl/config.yaml.tpl > /etc/netbird/config.yaml
volumeMounts:
- name: config-tpl
mountPath: /tpl
- name: config-rendered
mountPath: /etc/netbird
containers:
- name: netbird-server
image: netbirdio/netbird-server:latest
args: ["--config", "/etc/netbird/config.yaml"]
ports:
- containerPort: 80
- containerPort: 3479
protocol: UDP
- containerPort: 33073
volumeMounts:
- name: config-rendered
mountPath: /etc/netbird
- name: data
mountPath: /var/lib/netbird
volumes:
- name: config-tpl
configMap:
name: netbird-server-config
- name: config-rendered
emptyDir: {}
- name: data
persistentVolumeClaim:
claimName: netbird-data
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: netbird-data
namespace: netbird
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
---
apiVersion: v1
kind: Service
metadata:
name: netbird-server
namespace: netbird
spec:
selector:
app: netbird-server
ports:
- name: http
port: 80
targetPort: 80
- name: grpc-compat
port: 33073
targetPort: 33073
- name: stun
port: 3479
targetPort: 3479
protocol: UDP