Compare commits

...

3 Commits

Author SHA1 Message Date
8b06b33a5d feat: Added authelia 2025-12-23 01:34:23 +01:00
98679f7af9 feat: Added dragonfly operator 2025-12-23 01:34:04 +01:00
3671fdd8b2 feat: Added authelia-controller 2025-12-23 01:33:46 +01:00
27 changed files with 365 additions and 0 deletions

View File

@@ -19,3 +19,8 @@ spec:
copy:
- from: "@foundation/apps/lldap/**"
to: "@artifact/"
- name: authelia
originRevision: "@foundation"
copy:
- from: "@foundation/apps/authelia/**"
to: "@artifact/"

View File

@@ -0,0 +1,19 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: authelia
namespace: flux-system
spec:
interval: 1h
retryInterval: 2m
timeout: 5m
dependsOn:
- name: cnpg
- name: lldap-controller
- name: dragonfly-operator
sourceRef:
kind: ExternalArtifact
name: authelia
path: ./${cluster_env}
prune: true
wait: true

View File

@@ -0,0 +1,16 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: db
spec:
bootstrap:
recovery:
source: source
externalClusters:
- name: source
plugin:
name: barman-cloud.cloudnative-pg.io
parameters:
barmanObjectName: garage-store
serverName: db
plugins: []

View File

@@ -0,0 +1,15 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: db
namespace: authelia
# TODO: Add labels?
spec:
storage:
size: 8Gi
storageClass: local-path
plugins:
- name: barman-cloud.cloudnative-pg.io
isWALArchiver: true
parameters:
barmanObjectName: garage-store

View File

@@ -0,0 +1,29 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: authelia
namespace: authelia
spec:
interval: 12h
install:
strategy:
name: RetryOnFailure
retryInterval: 2m
upgrade:
strategy:
name: RetryOnFailure
retryInterval: 3m
chart:
spec:
chart: authelia
version: "0.10.x"
sourceRef:
kind: HelmRepository
name: authelia
interval: 24h
valuesFrom:
- kind: ConfigMap
name: values-base
- kind: ConfigMap
name: values-overlay
optional: true

View File

@@ -0,0 +1,8 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: authelia
namespace: authelia
spec:
interval: 24h
url: https://charts.authelia.com

View File

@@ -0,0 +1,25 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- cluster.yaml
- service-user.yaml
- helm-repository.yaml
- helm-release.yaml
- secret-s3-garage.yaml
- object-store.yaml
configurations:
- name-reference.yaml
configMapGenerator:
- name: values-base
namespace: authelia
files:
- values.yaml
# Uncomment to restore database from backup
# patches:
# - path: cluster-restore.yaml
# target:
# kind: Cluster

View File

@@ -0,0 +1,6 @@
nameReference:
- kind: ConfigMap
version: v1
fieldSpecs:
- path: spec/valuesFrom/name
kind: HelmRelease

View File

@@ -0,0 +1,5 @@
apiVersion: v1
kind: Namespace
metadata:
name: authelia
namespace: authelia

View File

@@ -0,0 +1,20 @@
apiVersion: barmancloud.cnpg.io/v1
kind: ObjectStore
metadata:
name: garage-store
namespace: authelia
spec:
configuration:
destinationPath: s3://cnpg-backup/authelia
s3Credentials:
accessKeyId:
name: s3-garage
key: ACCESS_KEY_ID
secretAccessKey:
name: s3-garage
key: ACCESS_SECRET_KEY
region:
name: s3-garage
key: REGION
wal:
compression: gzip

View File

@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: s3-garage
namespace: authelia
annotations:
reflector.v1.k8s.emberstack.com/reflects: "cnpg-system/s3-garage"
type: Opaque
data: {}

View File

@@ -0,0 +1,6 @@
apiVersion: lldap.huizinga.dev/v1
kind: ServiceUser
metadata:
name: authelia
namespace: authelia
spec: {}

View File

@@ -0,0 +1,61 @@
pod:
kind: Deployment
replicas: 2
ingress:
enabled: true
gatewayAPI:
enabled: true
parentRefs:
- name: gateway
namespace: default
secret:
additionalSecrets:
db-app:
key: db-app
authelia-lldap-credentials:
key: authelia-lldap-credentials
configMap:
authentication_backend:
ldap:
enabled: true
implementation: lldap
address: ldap://lldap.lldap.svc.cluster.local:3890
base_dn: dc=huizinga,dc=dev
additional_users_dn: ou=people
users_filter: "(&(|({username_attribute}={input})({mail_attribute}={input}))(objectClass=person))"
additional_groups_dn: ou=groups
groups_filter: "(member={dn})"
attributes:
display_name: displayName
username: uid
group_name: cn
mail: mail
user: uid=authelia.authelia,ou=people,dc=huizinga,dc=dev
password:
secret_name: authelia-lldap-credentials
path: password
session:
redis:
enabled: true
host: dragonfly.authelia
storage:
postgres:
enabled: true
address: tcp://db-rw.authelia:5432
database: app
username: app
password:
secret_name: db-app
path: password
notifier:
filesystem:
enabled: true
access_control:
secret:
existingSecret: authelia-acl

View File

@@ -0,0 +1,6 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: db
spec:
instances: 2

View File

@@ -0,0 +1,7 @@
apiVersion: dragonflydb.io/v1alpha1
kind: Dragonfly
metadata:
name: dragonfly
namespace: authelia
spec:
replicas: 2

View File

@@ -0,0 +1,16 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
- dragonfly.yaml
patches:
- path: cluster.yaml
target:
kind: Cluster
configMapGenerator:
- name: values-overlay
namespace: authelia
files:
- values.yaml

View File

@@ -0,0 +1,8 @@
pod:
replicas: 2
configMap:
session:
cookies:
- subdomain: auth
domain: huizinga.dev

View File

@@ -0,0 +1,6 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: db
spec:
instances: 1

View File

@@ -0,0 +1,7 @@
apiVersion: dragonflydb.io/v1alpha1
kind: Dragonfly
metadata:
name: dragonfly
namespace: authelia
spec:
replicas: 1

View File

@@ -0,0 +1,19 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
- dragonfly.yaml
patches:
- path: cluster.yaml
target:
kind: Cluster
- path: object-store.yaml
target:
kind: ObjectStore
configMapGenerator:
- name: values-overlay
namespace: authelia
files:
- values.yaml

View File

@@ -0,0 +1,8 @@
apiVersion: barmancloud.cnpg.io/v1
kind: ObjectStore
metadata:
name: garage-store
namespace: lldap
spec:
configuration:
endpointURL: http://192.168.1.1:3900

View File

@@ -0,0 +1,11 @@
pod:
replicas: 1
configMap:
log:
level: debug
session:
cookies:
- subdomain: auth
domain: staging.huizinga.dev

View File

@@ -11,6 +11,8 @@ resources:
- ../../controllers/cnpg/cnpg.yaml
- ../../controllers/reflector/reflector.yaml
- ../../controllers/lldap-controller/lldap-controller.yaml
- ../../controllers/authelia-controller/authelia-controller.yaml
- ../../controllers/dragonfly-operator/dragonfly-operator.yaml
- ../../configs/artifacts.yaml
- ../../configs/cilium-config/cilium-config.yaml
@@ -21,3 +23,4 @@ resources:
- ../../apps/artifacts.yaml
- ../../apps/spegel/spegel.yaml
- ../../apps/lldap/lldap.yaml
- ../../apps/authelia/authelia.yaml

View File

@@ -44,3 +44,8 @@ spec:
copy:
- from: "@foundation/controllers/reflector/**"
to: "@artifact/"
- name: dragonfly-operator
originRevision: "@foundation"
copy:
- from: "@foundation/controllers/dragonfly-operator/**"
to: "@artifact/"

View File

@@ -0,0 +1,26 @@
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
name: authelia-controller
namespace: flux-system
spec:
interval: 1m0s
url: oci://git.huizinga.dev/infra/authelia-controller/manifests
ref:
tag: edge
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: authelia-controller
namespace: flux-system
spec:
interval: 1h
retryInterval: 2m
timeout: 5m
sourceRef:
kind: OCIRepository
name: authelia-controller
path: ./
prune: true
wait: true

View File

@@ -0,0 +1,15 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: dragonfly-operator
namespace: flux-system
spec:
interval: 1h
retryInterval: 2m
timeout: 5m
sourceRef:
kind: ExternalArtifact
name: dragonfly-operator
path: .
prune: true
wait: true

View File

@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://raw.githubusercontent.com/dragonflydb/dragonfly-operator/v1.3.1/manifests/dragonfly-operator.yaml