feat: overhaul

This commit is contained in:
auricom
2025-01-04 00:00:04 +01:00
parent b14022014b
commit 0c9529c7a2
408 changed files with 3187 additions and 2380 deletions

View File

@@ -4,7 +4,6 @@ apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: authelia
namespace: default
spec:
secretStoreRef:
kind: ClusterSecretStore
@@ -20,10 +19,6 @@ spec:
AUTHELIA_IDENTITY_VALIDATION_RESET_PASSWORD_JWT_SECRET: "{{ .AUTHELIA_JWT_SECRET }}"
AUTHELIA_SESSION_SECRET: "{{ .AUTHELIA_SESSION_SECRET }}"
AUTHELIA_STORAGE_ENCRYPTION_KEY: "{{ .AUTHELIA_STORAGE_ENCRYPTION_KEY }}"
AUTHELIA_STORAGE_POSTGRES_ADDRESS: &dbHost postgres16-rw.database.svc.cluster.local
AUTHELIA_STORAGE_POSTGRES_DATABASE: &dbName authelia
AUTHELIA_STORAGE_POSTGRES_USERNAME: &dbUser "{{ .AUTHELIA_STORAGE_POSTGRES_USERNAME }}"
AUTHELIA_STORAGE_POSTGRES_PASSWORD: &dbPass "{{ .AUTHELIA_STORAGE_POSTGRES_PASSWORD }}"
# AUTHELIA_STORAGE_POSTGRES_TLS_SERVER_NAME: *dbHost
# AUTHELIA_STORAGE_POSTGRES_TLS_SKIP_VERIFY: "false"
OIDC_JWKS_KEY: "{{ .OIDC_JWKS_KEY }}"
@@ -44,18 +39,31 @@ spec:
WINDMILL_OAUTH_CLIENT_SECRET: "{{ .WINDMILL_OAUTH_CLIENT_SECRET }}"
WINDMILL_OAUTH_DIGEST: "{{ .WINDMILL_OAUTH_DIGEST }}"
SECRET_PUBLIC_DOMAIN: "{{ .SECRET_PUBLIC_DOMAIN }}"
# Postgres Init
INIT_POSTGRES_DBNAME: *dbName
INIT_POSTGRES_HOST: *dbHost
INIT_POSTGRES_USER: *dbUser
INIT_POSTGRES_PASS: *dbPass
INIT_POSTGRES_SUPER_PASS: "{{ .POSTGRES_SUPER_PASS }}"
dataFrom:
- extract:
key: authelia
- extract:
key: cloudnative-pg
- extract:
key: lldap
- extract:
key: generic
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: authelia-db
spec:
secretStoreRef:
kind: ClusterSecretStore
name: crunchy-pgo-secrets
target:
name: authelia-db-secret
template:
engineVersion: v2
data:
AUTHELIA_STORAGE_POSTGRES_DATABASE: '{{ index . "dbname" }}'
AUTHELIA_STORAGE_POSTGRES_ADDRESS: 'tcp://{{ index . "host" }}:{{ index . "port" }}'
AUTHELIA_STORAGE_POSTGRES_USERNAME: '{{ index . "user" }}'
AUTHELIA_STORAGE_POSTGRES_PASSWORD: '{{ index . "password" }}'
dataFrom:
- extract:
key: postgres-pguser-authelia

View File

@@ -4,7 +4,6 @@ apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: &app authelia
namespace: default
spec:
interval: 30m
chart:
@@ -36,27 +35,13 @@ spec:
securityContext:
runAsUser: 568
runAsGroup: 568
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/name: *app
controllers:
authelia:
replicas: 2
strategy: RollingUpdate
annotations:
reloader.stakater.com/auto: "true"
initContainers:
init-db:
image:
repository: ghcr.io/onedr0p/postgres-init
tag: 16
envFrom: &envFrom
- secretRef:
name: authelia-secret
secret.reloader.stakater.com/reload: authelia-db-secret
containers:
app:
image:
@@ -74,7 +59,11 @@ spec:
AUTHELIA_WEBAUTHN_DISABLE: "true"
X_AUTHELIA_CONFIG: /config/configuration.yaml
X_AUTHELIA_CONFIG_FILTERS: template
envFrom: *envFrom
envFrom:
- secretRef:
name: authelia-secret
- secretRef:
name: authelia-db-secret
probes:
liveness: &probes
enabled: true
@@ -117,10 +106,8 @@ spec:
ingress:
app:
enabled: true
className: nginx
className: external
annotations:
external-dns.alpha.kubernetes.io/enabled: "true"
external-dns.alpha.kubernetes.io/target: services.${SECRET_DOMAIN}.
nginx.ingress.kubernetes.io/configuration-snippet: |
add_header Cache-Control "no-store";
add_header Pragma "no-cache";

View File

@@ -2,7 +2,6 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/kustomization.json
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: default
resources:
- ./externalsecret.yaml
- ./helmrelease.yaml

View File

@@ -1,5 +1,5 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
@@ -11,7 +11,7 @@ spec:
labels:
app.kubernetes.io/name: *app
dependsOn:
- name: cloudnative-pg-cluster
- name: crunchy-postgres-operator-cluster
- name: dragonfly-cluster
- name: external-secrets-stores
path: ./kubernetes/apps/default/authelia/app