Replaced Headscale (too buggy in 0.28.x — random node drops) with direct WireGuard hub-and-spoke + full mesh. 7 Proxmox VMs across 3 hosts form a K3s v1.34.6 cluster: 3 control-plane/etcd nodes, 4 workers. Running services: postgres, mariadb, ghost (x3), forgejo, authentik. All unpinned services use local-path StorageClass. Databases pinned to pve-worker and adder-worker with local PVs. Includes VM provisioning scripts (create-debian-template.sh, clone-vm.sh), K3s manifests for all services, and full deployment docs in k3s/README.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
# Authentik DB Init Job
|
|
# Creates authentik database and user in PostgreSQL.
|
|
# Run once before deploying Authentik.
|
|
#
|
|
# Deploy:
|
|
# kubectl create secret generic authentik-secret \
|
|
# --namespace <ns> \
|
|
# --from-literal=db-password='<password>' \
|
|
# --from-literal=secret-key='<random-50-chars>'
|
|
# kubectl apply -f authentik-db-init.yaml -n <ns>
|
|
#
|
|
# Watch completion:
|
|
# kubectl get jobs -n <ns> -w
|
|
# kubectl logs job/authentik-db-init -n <ns>
|
|
|
|
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: authentik-db-init
|
|
spec:
|
|
template:
|
|
spec:
|
|
restartPolicy: OnFailure
|
|
containers:
|
|
- name: authentik-db-init
|
|
image: postgres:16
|
|
env:
|
|
- name: PGPASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: postgres-secret
|
|
key: password
|
|
- name: AUTHENTIK_DB_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: authentik-secret
|
|
key: db-password
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- |
|
|
psql -h postgres -U postgres <<EOF
|
|
CREATE USER authentik_user WITH PASSWORD '${AUTHENTIK_DB_PASSWORD}';
|
|
CREATE DATABASE authentik_db OWNER authentik_user;
|
|
EOF
|