Compare commits
9 Commits
36f74fc8ba
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
2e5d187f01
|
|||
|
5c56e25fd8
|
|||
|
94af8edee7
|
|||
|
a9fcc5e07c
|
|||
|
2e918de78a
|
|||
|
cc76529d5f
|
|||
|
619f778a1c
|
|||
|
b8698feb00
|
|||
|
28dab8e5f4
|
@@ -19,3 +19,8 @@ spec:
|
|||||||
copy:
|
copy:
|
||||||
- from: "@foundation/apps/lldap/**"
|
- from: "@foundation/apps/lldap/**"
|
||||||
to: "@artifact/"
|
to: "@artifact/"
|
||||||
|
- name: authelia
|
||||||
|
originRevision: "@foundation"
|
||||||
|
copy:
|
||||||
|
- from: "@foundation/apps/authelia/**"
|
||||||
|
to: "@artifact/"
|
||||||
|
|||||||
20
apps/authelia/authelia.yaml
Normal file
20
apps/authelia/authelia.yaml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
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
|
||||||
|
- name: authelia-controller
|
||||||
|
sourceRef:
|
||||||
|
kind: ExternalArtifact
|
||||||
|
name: authelia
|
||||||
|
path: ./${cluster_env}
|
||||||
|
prune: true
|
||||||
|
wait: true
|
||||||
16
apps/authelia/base/cluster-restore.yaml
Normal file
16
apps/authelia/base/cluster-restore.yaml
Normal 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: []
|
||||||
15
apps/authelia/base/cluster.yaml
Normal file
15
apps/authelia/base/cluster.yaml
Normal 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
|
||||||
29
apps/authelia/base/helm-release.yaml
Normal file
29
apps/authelia/base/helm-release.yaml
Normal 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
|
||||||
8
apps/authelia/base/helm-repository.yaml
Normal file
8
apps/authelia/base/helm-repository.yaml
Normal 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
|
||||||
25
apps/authelia/base/kustomization.yaml
Normal file
25
apps/authelia/base/kustomization.yaml
Normal 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
|
||||||
6
apps/authelia/base/name-reference.yaml
Normal file
6
apps/authelia/base/name-reference.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
nameReference:
|
||||||
|
- kind: ConfigMap
|
||||||
|
version: v1
|
||||||
|
fieldSpecs:
|
||||||
|
- path: spec/valuesFrom/name
|
||||||
|
kind: HelmRelease
|
||||||
5
apps/authelia/base/namespace.yaml
Normal file
5
apps/authelia/base/namespace.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: authelia
|
||||||
|
namespace: authelia
|
||||||
20
apps/authelia/base/object-store.yaml
Normal file
20
apps/authelia/base/object-store.yaml
Normal 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
|
||||||
9
apps/authelia/base/secret-s3-garage.yaml
Normal file
9
apps/authelia/base/secret-s3-garage.yaml
Normal 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: {}
|
||||||
6
apps/authelia/base/service-user.yaml
Normal file
6
apps/authelia/base/service-user.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: lldap.huizinga.dev/v1
|
||||||
|
kind: ServiceUser
|
||||||
|
metadata:
|
||||||
|
name: authelia
|
||||||
|
namespace: authelia
|
||||||
|
spec: {}
|
||||||
61
apps/authelia/base/values.yaml
Normal file
61
apps/authelia/base/values.yaml
Normal 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
|
||||||
6
apps/authelia/production/cluster.yaml
Normal file
6
apps/authelia/production/cluster.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: postgresql.cnpg.io/v1
|
||||||
|
kind: Cluster
|
||||||
|
metadata:
|
||||||
|
name: db
|
||||||
|
spec:
|
||||||
|
instances: 2
|
||||||
7
apps/authelia/production/dragonfly.yaml
Normal file
7
apps/authelia/production/dragonfly.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: dragonflydb.io/v1alpha1
|
||||||
|
kind: Dragonfly
|
||||||
|
metadata:
|
||||||
|
name: dragonfly
|
||||||
|
namespace: authelia
|
||||||
|
spec:
|
||||||
|
replicas: 2
|
||||||
16
apps/authelia/production/kustomization.yaml
Normal file
16
apps/authelia/production/kustomization.yaml
Normal 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
|
||||||
8
apps/authelia/production/values.yaml
Normal file
8
apps/authelia/production/values.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
pod:
|
||||||
|
replicas: 2
|
||||||
|
|
||||||
|
configMap:
|
||||||
|
session:
|
||||||
|
cookies:
|
||||||
|
- subdomain: auth
|
||||||
|
domain: huizinga.dev
|
||||||
6
apps/authelia/staging/cluster.yaml
Normal file
6
apps/authelia/staging/cluster.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: postgresql.cnpg.io/v1
|
||||||
|
kind: Cluster
|
||||||
|
metadata:
|
||||||
|
name: db
|
||||||
|
spec:
|
||||||
|
instances: 1
|
||||||
7
apps/authelia/staging/dragonfly.yaml
Normal file
7
apps/authelia/staging/dragonfly.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: dragonflydb.io/v1alpha1
|
||||||
|
kind: Dragonfly
|
||||||
|
metadata:
|
||||||
|
name: dragonfly
|
||||||
|
namespace: authelia
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
19
apps/authelia/staging/kustomization.yaml
Normal file
19
apps/authelia/staging/kustomization.yaml
Normal 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
|
||||||
8
apps/authelia/staging/object-store.yaml
Normal file
8
apps/authelia/staging/object-store.yaml
Normal 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
|
||||||
11
apps/authelia/staging/values.yaml
Normal file
11
apps/authelia/staging/values.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
pod:
|
||||||
|
replicas: 1
|
||||||
|
|
||||||
|
configMap:
|
||||||
|
log:
|
||||||
|
level: debug
|
||||||
|
|
||||||
|
session:
|
||||||
|
cookies:
|
||||||
|
- subdomain: auth
|
||||||
|
domain: staging.huizinga.dev
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
apiVersion: postgresql.cnpg.io/v1
|
apiVersion: postgresql.cnpg.io/v1
|
||||||
kind: Cluster
|
kind: Cluster
|
||||||
metadata:
|
metadata:
|
||||||
name: lldap-db
|
name: db
|
||||||
spec:
|
spec:
|
||||||
bootstrap:
|
bootstrap:
|
||||||
recovery:
|
recovery:
|
||||||
@@ -12,5 +12,5 @@ spec:
|
|||||||
name: barman-cloud.cloudnative-pg.io
|
name: barman-cloud.cloudnative-pg.io
|
||||||
parameters:
|
parameters:
|
||||||
barmanObjectName: garage-store
|
barmanObjectName: garage-store
|
||||||
serverName: lldap-db
|
serverName: db
|
||||||
plugins: []
|
plugins: []
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
apiVersion: postgresql.cnpg.io/v1
|
apiVersion: postgresql.cnpg.io/v1
|
||||||
kind: Cluster
|
kind: Cluster
|
||||||
metadata:
|
metadata:
|
||||||
name: lldap-db
|
name: db
|
||||||
namespace: lldap
|
namespace: lldap
|
||||||
# TODO: Add labels?
|
# TODO: Add labels?
|
||||||
spec:
|
spec:
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ spec:
|
|||||||
- name: LLDAP_DATABASE_URL
|
- name: LLDAP_DATABASE_URL
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: lldap-db-app
|
name: db-app
|
||||||
key: uri
|
key: uri
|
||||||
- name: TZ
|
- name: TZ
|
||||||
value: CET
|
value: CET
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ metadata:
|
|||||||
namespace: lldap
|
namespace: lldap
|
||||||
spec:
|
spec:
|
||||||
configuration:
|
configuration:
|
||||||
destinationPath: s3://cnpg-backup
|
destinationPath: s3://cnpg-backup/lldap
|
||||||
s3Credentials:
|
s3Credentials:
|
||||||
accessKeyId:
|
accessKeyId:
|
||||||
name: s3-garage
|
name: s3-garage
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
apiVersion: postgresql.cnpg.io/v1
|
apiVersion: postgresql.cnpg.io/v1
|
||||||
kind: Cluster
|
kind: Cluster
|
||||||
metadata:
|
metadata:
|
||||||
name: lldap-db
|
name: db
|
||||||
spec:
|
spec:
|
||||||
instances: 2
|
instances: 2
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
apiVersion: postgresql.cnpg.io/v1
|
apiVersion: postgresql.cnpg.io/v1
|
||||||
kind: Cluster
|
kind: Cluster
|
||||||
metadata:
|
metadata:
|
||||||
name: lldap-db
|
name: db
|
||||||
spec:
|
spec:
|
||||||
instances: 1
|
instances: 1
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ resources:
|
|||||||
- ../../controllers/local-path-provisioner/local-path-provisioner.yaml
|
- ../../controllers/local-path-provisioner/local-path-provisioner.yaml
|
||||||
- ../../controllers/cnpg/cnpg.yaml
|
- ../../controllers/cnpg/cnpg.yaml
|
||||||
- ../../controllers/reflector/reflector.yaml
|
- ../../controllers/reflector/reflector.yaml
|
||||||
|
- ../../controllers/lldap-controller/lldap-controller.yaml
|
||||||
|
- ../../controllers/authelia-controller/authelia-controller.yaml
|
||||||
|
- ../../controllers/dragonfly-operator/dragonfly-operator.yaml
|
||||||
|
- ../../controllers/kube-prometheus-stack/kube-prometheus-stack.yaml
|
||||||
|
|
||||||
- ../../configs/artifacts.yaml
|
- ../../configs/artifacts.yaml
|
||||||
- ../../configs/cilium-config/cilium-config.yaml
|
- ../../configs/cilium-config/cilium-config.yaml
|
||||||
@@ -20,3 +24,4 @@ resources:
|
|||||||
- ../../apps/artifacts.yaml
|
- ../../apps/artifacts.yaml
|
||||||
- ../../apps/spegel/spegel.yaml
|
- ../../apps/spegel/spegel.yaml
|
||||||
- ../../apps/lldap/lldap.yaml
|
- ../../apps/lldap/lldap.yaml
|
||||||
|
- ../../apps/authelia/authelia.yaml
|
||||||
|
|||||||
@@ -44,3 +44,13 @@ spec:
|
|||||||
copy:
|
copy:
|
||||||
- from: "@foundation/controllers/reflector/**"
|
- from: "@foundation/controllers/reflector/**"
|
||||||
to: "@artifact/"
|
to: "@artifact/"
|
||||||
|
- name: dragonfly-operator
|
||||||
|
originRevision: "@foundation"
|
||||||
|
copy:
|
||||||
|
- from: "@foundation/controllers/dragonfly-operator/**"
|
||||||
|
to: "@artifact/"
|
||||||
|
- name: kube-prometheus-stack
|
||||||
|
originRevision: "@foundation"
|
||||||
|
copy:
|
||||||
|
- from: "@foundation/controllers/kube-prometheus-stack/**"
|
||||||
|
to: "@artifact/"
|
||||||
|
|||||||
26
controllers/authelia-controller/authelia-controller.yaml
Normal file
26
controllers/authelia-controller/authelia-controller.yaml
Normal 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
|
||||||
@@ -13,9 +13,14 @@ spec:
|
|||||||
strategy:
|
strategy:
|
||||||
name: RetryOnFailure
|
name: RetryOnFailure
|
||||||
retryInterval: 3m
|
retryInterval: 3m
|
||||||
chartRef:
|
chart:
|
||||||
kind: OCIRepository
|
spec:
|
||||||
name: cert-manager
|
chart: cert-manager
|
||||||
|
version: "1.19.x"
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: cert-manager
|
||||||
|
interval: 24h
|
||||||
values:
|
values:
|
||||||
crds:
|
crds:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|||||||
9
controllers/cert-manager/helm-repository.yaml
Normal file
9
controllers/cert-manager/helm-repository.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
|
kind: HelmRepository
|
||||||
|
metadata:
|
||||||
|
name: cert-manager
|
||||||
|
namespace: cert-manager
|
||||||
|
spec:
|
||||||
|
type: "oci"
|
||||||
|
interval: 24h
|
||||||
|
url: oci://quay.io/jetstack/charts/
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./namespace.yaml
|
- namespace.yaml
|
||||||
- ./oci-repository.yaml
|
- helm-repository.yaml
|
||||||
- ./helm-release.yaml
|
- helm-release.yaml
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
apiVersion: source.toolkit.fluxcd.io/v1
|
|
||||||
kind: OCIRepository
|
|
||||||
metadata:
|
|
||||||
name: cert-manager
|
|
||||||
namespace: cert-manager
|
|
||||||
spec:
|
|
||||||
interval: 24h
|
|
||||||
url: oci://quay.io/jetstack/charts/cert-manager
|
|
||||||
layerSelector:
|
|
||||||
mediaType: "application/vnd.cncf.helm.chart.content.v1.tar+gzip"
|
|
||||||
operation: copy
|
|
||||||
ref:
|
|
||||||
semver: "1.19.x"
|
|
||||||
15
controllers/dragonfly-operator/dragonfly-operator.yaml
Normal file
15
controllers/dragonfly-operator/dragonfly-operator.yaml
Normal 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
|
||||||
4
controllers/dragonfly-operator/kustomization.yaml
Normal file
4
controllers/dragonfly-operator/kustomization.yaml
Normal 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
|
||||||
16
controllers/kube-prometheus-stack/cluster-restore.yaml
Normal file
16
controllers/kube-prometheus-stack/cluster-restore.yaml
Normal 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: []
|
||||||
15
controllers/kube-prometheus-stack/cluster.yaml
Normal file
15
controllers/kube-prometheus-stack/cluster.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: postgresql.cnpg.io/v1
|
||||||
|
kind: Cluster
|
||||||
|
metadata:
|
||||||
|
name: db
|
||||||
|
namespace: monitoring
|
||||||
|
# TODO: Add labels?
|
||||||
|
spec:
|
||||||
|
storage:
|
||||||
|
size: 8Gi
|
||||||
|
storageClass: local-path
|
||||||
|
plugins:
|
||||||
|
- name: barman-cloud.cloudnative-pg.io
|
||||||
|
isWALArchiver: true
|
||||||
|
parameters:
|
||||||
|
barmanObjectName: garage-store
|
||||||
7
controllers/kube-prometheus-stack/dragonfly.yaml
Normal file
7
controllers/kube-prometheus-stack/dragonfly.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: dragonflydb.io/v1alpha1
|
||||||
|
kind: Dragonfly
|
||||||
|
metadata:
|
||||||
|
name: dragonfly
|
||||||
|
namespace: monitoring
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
53
controllers/kube-prometheus-stack/grafana-ldap.toml
Normal file
53
controllers/kube-prometheus-stack/grafana-ldap.toml
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# This is only the ldap config, you also need to enable ldap support in the main config file
|
||||||
|
# of Grafana. See https://grafana.com/docs/grafana/latest/auth/ldap/#enable-ldap
|
||||||
|
# You can test that it is working correctly by trying usernames at: https://<your grafana instance>/admin/ldap
|
||||||
|
|
||||||
|
[[servers]]
|
||||||
|
# Ldap server host (specify multiple hosts space separated)
|
||||||
|
host = "lldap.lldap.svc.cluster.local"
|
||||||
|
# Default port is 389 or 636 if use_ssl = true
|
||||||
|
port = 3890
|
||||||
|
# Set to true if LDAP server should use an encrypted TLS connection (either with STARTTLS or LDAPS)
|
||||||
|
use_ssl = false
|
||||||
|
# If set to true, use LDAP with STARTTLS instead of LDAPS
|
||||||
|
start_tls = false
|
||||||
|
# set to true if you want to skip SSL cert validation
|
||||||
|
ssl_skip_verify = false
|
||||||
|
# set to the path to your root CA certificate or leave unset to use system defaults
|
||||||
|
# root_ca_cert = "/path/to/certificate.crt"
|
||||||
|
# Authentication against LDAP servers requiring client certificates
|
||||||
|
# client_cert = "/path/to/client.crt"
|
||||||
|
# client_key = "/path/to/client.key"
|
||||||
|
|
||||||
|
# Search user bind dn
|
||||||
|
bind_dn = "${BIND_DN}"
|
||||||
|
# Search user bind password
|
||||||
|
# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
|
||||||
|
bind_password = "${LDAP_PASSWORD}"
|
||||||
|
|
||||||
|
# User search filter
|
||||||
|
search_filter = "(&(|(uid=%s)(mail=%s))(objectClass=person))"
|
||||||
|
# If you want to limit to only users of a specific group use this instead:
|
||||||
|
# search_filter = "(&(uid=%s)(memberOf=cn=<your group>,ou=groups,dc=huizinga,dc=dev))"
|
||||||
|
|
||||||
|
# An array of base dns to search through
|
||||||
|
search_base_dns = ["dc=huizinga,dc=dev"]
|
||||||
|
|
||||||
|
# Specify names of the LDAP attributes your LDAP uses
|
||||||
|
[servers.attributes]
|
||||||
|
member_of = "memberOf"
|
||||||
|
email = "mail"
|
||||||
|
name = "givenName"
|
||||||
|
surname = "sn"
|
||||||
|
username = "uid"
|
||||||
|
|
||||||
|
# If you want to map your ldap groups to grafana's groups, see: https://grafana.com/docs/grafana/latest/auth/ldap/#group-mappings
|
||||||
|
# As a quick example, here is how you would map lldap's admin group to grafana's admin
|
||||||
|
[[servers.group_mappings]]
|
||||||
|
group_dn = "cn=lldap_admin,ou=groups,dc=huizinga,dc=dev"
|
||||||
|
org_role = "Admin"
|
||||||
|
grafana_admin = true
|
||||||
|
|
||||||
|
[[servers.group_mappings]]
|
||||||
|
group_dn = "*"
|
||||||
|
org_role = "Viewer"
|
||||||
30
controllers/kube-prometheus-stack/helm-release.yaml
Normal file
30
controllers/kube-prometheus-stack/helm-release.yaml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: kube-prometheus-stack
|
||||||
|
namespace: monitoring
|
||||||
|
spec:
|
||||||
|
interval: 12h
|
||||||
|
install:
|
||||||
|
strategy:
|
||||||
|
name: RetryOnFailure
|
||||||
|
retryInterval: 2m
|
||||||
|
upgrade:
|
||||||
|
strategy:
|
||||||
|
name: RetryOnFailure
|
||||||
|
retryInterval: 3m
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: kube-prometheus-stack
|
||||||
|
version: "80.6.x"
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: prometheus-community
|
||||||
|
interval: 24h
|
||||||
|
values:
|
||||||
|
grafana:
|
||||||
|
ldap:
|
||||||
|
existingSecret: grafana-ldap-toml
|
||||||
|
valuesFrom:
|
||||||
|
- kind: ConfigMap
|
||||||
|
name: values-base
|
||||||
9
controllers/kube-prometheus-stack/helm-repository.yaml
Normal file
9
controllers/kube-prometheus-stack/helm-repository.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
|
kind: HelmRepository
|
||||||
|
metadata:
|
||||||
|
name: prometheus-community
|
||||||
|
namespace: monitoring
|
||||||
|
spec:
|
||||||
|
type: "oci"
|
||||||
|
interval: 24h
|
||||||
|
url: oci://ghcr.io/prometheus-community/charts/
|
||||||
18
controllers/kube-prometheus-stack/kube-prometheus-stack.yaml
Normal file
18
controllers/kube-prometheus-stack/kube-prometheus-stack.yaml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: kube-prometheus-stack
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
interval: 1h
|
||||||
|
retryInterval: 2m
|
||||||
|
timeout: 5m
|
||||||
|
dependsOn:
|
||||||
|
- name: dragonfly-operator
|
||||||
|
- name: lldap-controller
|
||||||
|
sourceRef:
|
||||||
|
kind: ExternalArtifact
|
||||||
|
name: kube-prometheus-stack
|
||||||
|
path: ./
|
||||||
|
prune: true
|
||||||
|
wait: true
|
||||||
32
controllers/kube-prometheus-stack/kustomization.yaml
Normal file
32
controllers/kube-prometheus-stack/kustomization.yaml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- namespace.yaml
|
||||||
|
- helm-repository.yaml
|
||||||
|
- helm-release.yaml
|
||||||
|
- dragonfly.yaml
|
||||||
|
- cluster.yaml
|
||||||
|
- secret-s3-garage.yaml
|
||||||
|
- object-store.yaml
|
||||||
|
- service-user.yaml
|
||||||
|
|
||||||
|
configurations:
|
||||||
|
- name-reference.yaml
|
||||||
|
|
||||||
|
configMapGenerator:
|
||||||
|
- name: values-base
|
||||||
|
namespace: monitoring
|
||||||
|
files:
|
||||||
|
- values.yaml
|
||||||
|
|
||||||
|
secretGenerator:
|
||||||
|
- name: grafana-ldap-toml
|
||||||
|
namespace: monitoring
|
||||||
|
files:
|
||||||
|
- ldap-toml=grafana-ldap.toml
|
||||||
|
|
||||||
|
# Uncomment to restore database from backup
|
||||||
|
# patches:
|
||||||
|
# - path: cluster-restore.yaml
|
||||||
|
# target:
|
||||||
|
# kind: Cluster
|
||||||
11
controllers/kube-prometheus-stack/name-reference.yaml
Normal file
11
controllers/kube-prometheus-stack/name-reference.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
nameReference:
|
||||||
|
- kind: ConfigMap
|
||||||
|
version: v1
|
||||||
|
fieldSpecs:
|
||||||
|
- path: spec/valuesFrom/name
|
||||||
|
kind: HelmRelease
|
||||||
|
- kind: Secret
|
||||||
|
version: v1
|
||||||
|
fieldSpecs:
|
||||||
|
- path: spec/values/grafana/ldap/existingSecret
|
||||||
|
kind: HelmRelease
|
||||||
4
controllers/kube-prometheus-stack/namespace.yaml
Normal file
4
controllers/kube-prometheus-stack/namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: monitoring
|
||||||
20
controllers/kube-prometheus-stack/object-store.yaml
Normal file
20
controllers/kube-prometheus-stack/object-store.yaml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
apiVersion: barmancloud.cnpg.io/v1
|
||||||
|
kind: ObjectStore
|
||||||
|
metadata:
|
||||||
|
name: garage-store
|
||||||
|
namespace: monitoring
|
||||||
|
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
|
||||||
9
controllers/kube-prometheus-stack/secret-s3-garage.yaml
Normal file
9
controllers/kube-prometheus-stack/secret-s3-garage.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: s3-garage
|
||||||
|
namespace: monitoring
|
||||||
|
annotations:
|
||||||
|
reflector.v1.k8s.emberstack.com/reflects: "cnpg-system/s3-garage"
|
||||||
|
type: Opaque
|
||||||
|
data: {}
|
||||||
6
controllers/kube-prometheus-stack/service-user.yaml
Normal file
6
controllers/kube-prometheus-stack/service-user.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: lldap.huizinga.dev/v1
|
||||||
|
kind: ServiceUser
|
||||||
|
metadata:
|
||||||
|
name: grafana
|
||||||
|
namespace: monitoring
|
||||||
|
spec: {}
|
||||||
86
controllers/kube-prometheus-stack/values.yaml
Normal file
86
controllers/kube-prometheus-stack/values.yaml
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
alertmanager:
|
||||||
|
alertsmanagerSpec:
|
||||||
|
replicas: 1
|
||||||
|
route:
|
||||||
|
main:
|
||||||
|
enabled: true
|
||||||
|
hostnames:
|
||||||
|
- "alerts.staging.huizinga.dev"
|
||||||
|
parentRefs:
|
||||||
|
- name: gateway
|
||||||
|
namespace: default
|
||||||
|
|
||||||
|
prometheus:
|
||||||
|
prometheusSpec:
|
||||||
|
replicas: 1
|
||||||
|
route:
|
||||||
|
main:
|
||||||
|
enabled: true
|
||||||
|
hostnames:
|
||||||
|
- "prometheus.staging.huizinga.dev"
|
||||||
|
parentRefs:
|
||||||
|
- name: gateway
|
||||||
|
namespace: default
|
||||||
|
|
||||||
|
grafana:
|
||||||
|
replicas: 1
|
||||||
|
|
||||||
|
# ingress:
|
||||||
|
# enabled: true
|
||||||
|
# hosts:
|
||||||
|
# - grafana.${domain}
|
||||||
|
# tls:
|
||||||
|
# - secretName: ${domain//./-}-tls
|
||||||
|
# annotations:
|
||||||
|
# traefik.ingress.kubernetes.io/router.entryPoints: "websecure"
|
||||||
|
# traefik.ingress.kubernetes.io/router.middlewares: "authelia-forwardauth-authelia@kubernetescrd"
|
||||||
|
# traefik.ingress.kubernetes.io/router.tls: "true"
|
||||||
|
|
||||||
|
envValueFrom:
|
||||||
|
BIND_DN:
|
||||||
|
secretKeyRef:
|
||||||
|
name: grafana-lldap-credentials
|
||||||
|
key: bind_dn
|
||||||
|
LDAP_PASSWORD:
|
||||||
|
secretKeyRef:
|
||||||
|
name: grafana-lldap-credentials
|
||||||
|
key: password
|
||||||
|
|
||||||
|
grafana.ini:
|
||||||
|
auth.ldap:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
# auth.proxy:
|
||||||
|
# enabled: true
|
||||||
|
# header_name: Remote-User
|
||||||
|
# header_property: username
|
||||||
|
# auto_sign_up: true
|
||||||
|
# headers: Groups:Remote-Group
|
||||||
|
# enable_login_token: false
|
||||||
|
# sync_ttl: 0
|
||||||
|
# signout_redirect_url: https://login.${domain}/logout?rd=https://grafana.${domain}
|
||||||
|
|
||||||
|
database:
|
||||||
|
type: postgres
|
||||||
|
host: $__file{/etc/secrets/db/host}
|
||||||
|
name: $__file{/etc/secrets/db/dbname}
|
||||||
|
user: $__file{/etc/secrets/db/user}
|
||||||
|
password: $__file{/etc/secrets/db/password}
|
||||||
|
|
||||||
|
remote_cache:
|
||||||
|
type: redis
|
||||||
|
connstr: addr=dragonflydb.monitoring:6379
|
||||||
|
|
||||||
|
ldap:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
extraSecretMounts:
|
||||||
|
- name: db-app-mount
|
||||||
|
secretName: db-app
|
||||||
|
defaultMode: 0440
|
||||||
|
mountPath: /etc/secrets/db
|
||||||
|
readOnly: true
|
||||||
|
|
||||||
|
# We are not running kube-proxy
|
||||||
|
kubeProxy:
|
||||||
|
enabled: false
|
||||||
28
controllers/lldap-controller/lldap-controller.yaml
Normal file
28
controllers/lldap-controller/lldap-controller.yaml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
apiVersion: source.toolkit.fluxcd.io/v1beta2
|
||||||
|
kind: OCIRepository
|
||||||
|
metadata:
|
||||||
|
name: lldap-controller
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
interval: 1m0s
|
||||||
|
url: oci://git.huizinga.dev/infra/lldap-controller/manifests
|
||||||
|
ref:
|
||||||
|
tag: edge
|
||||||
|
---
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: lldap-controller
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
interval: 1h
|
||||||
|
retryInterval: 2m
|
||||||
|
timeout: 5m
|
||||||
|
dependsOn:
|
||||||
|
- name: lldap
|
||||||
|
sourceRef:
|
||||||
|
kind: OCIRepository
|
||||||
|
name: lldap-controller
|
||||||
|
path: ./
|
||||||
|
prune: true
|
||||||
|
wait: true
|
||||||
Reference in New Issue
Block a user