diff --git a/applications/authentik/postgres/authentik-postgres-statefulset.yaml b/applications/authentik/postgres/authentik-postgres-statefulset.yaml index 2ebf68e..2854e6c 100644 --- a/applications/authentik/postgres/authentik-postgres-statefulset.yaml +++ b/applications/authentik/postgres/authentik-postgres-statefulset.yaml @@ -19,24 +19,9 @@ spec: image: postgres:16-alpine ports: - containerPort: 5432 - env: - - name: POSTGRES_DB - valueFrom: - secretKeyRef: - name: authentik-secrets - key: db_name - - name: POSTGRES_USER - valueFrom: - secretKeyRef: - name: authentik-secrets - key: db_user - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: authentik-secrets - key: db_password - - name: PGDATA - value: /var/lib/postgresql/data/pgdata + envFrom: + - secretRef: + name: authentik-postgres-secrets volumeMounts: - name: data mountPath: /var/lib/postgresql/data diff --git a/applications/authentik/postgres/infisicalsecret.yaml b/applications/authentik/postgres/infisicalsecret.yaml new file mode 100644 index 0000000..929fe9c --- /dev/null +++ b/applications/authentik/postgres/infisicalsecret.yaml @@ -0,0 +1,25 @@ +apiVersion: secrets.infisical.com/v1alpha1 +kind: InfisicalSecret +metadata: + name: authentik-postgres-secrets + namespace: infisical +spec: + hostAPI: https://infisical.jsme.be + resyncInterval: 30 + authentication: + kubernetesAuth: + identityId: "5458def7-7c63-40d2-95da-41c614d0933a" + serviceAccountRef: + name: infisical-auth + namespace: infisical + autoCreateServiceAccountToken: true + secretsScope: + projectSlug: "kubernetes" + envSlug: "prod" + secretsPath: "/authentik/postgres" + # Non-recursive: keys are already named as the container expects. + recursive: false + managedSecretReference: + secretName: authentik-postgres-secrets + secretNamespace: authentik + secretType: Opaque diff --git a/applications/authentik/server/authentik-server-deployment.yaml b/applications/authentik/server/authentik-server-deployment.yaml index 3ac7ad2..88d58e5 100644 --- a/applications/authentik/server/authentik-server-deployment.yaml +++ b/applications/authentik/server/authentik-server-deployment.yaml @@ -25,62 +25,9 @@ spec: name: http - containerPort: 9443 name: https - env: - - name: AUTHENTIK_POSTGRESQL__HOST - valueFrom: - secretKeyRef: - name: authentik-secrets - key: db_host - - name: AUTHENTIK_POSTGRESQL__NAME - valueFrom: - secretKeyRef: - name: authentik-secrets - key: db_name - - name: AUTHENTIK_POSTGRESQL__USER - valueFrom: - secretKeyRef: - name: authentik-secrets - key: db_user - - name: AUTHENTIK_POSTGRESQL__PASSWORD - valueFrom: - secretKeyRef: - name: authentik-secrets - key: db_password - - name: AUTHENTIK_SECRET_KEY - valueFrom: - secretKeyRef: - name: authentik-secrets - key: AUTHENTIK_SECRET_KEY - - name: AUTHENTIK_EMAIL__HOST - valueFrom: - secretKeyRef: - name: authentik-secrets - key: email_host - - name: AUTHENTIK_EMAIL__PORT - valueFrom: - secretKeyRef: - name: authentik-secrets - key: email_port - - name: AUTHENTIK_EMAIL__USERNAME - valueFrom: - secretKeyRef: - name: authentik-secrets - key: email_username - - name: AUTHENTIK_EMAIL__PASSWORD - valueFrom: - secretKeyRef: - name: authentik-secrets - key: email_password - - name: AUTHENTIK_EMAIL__FROM - valueFrom: - secretKeyRef: - name: authentik-secrets - key: email_from - - name: AUTHENTIK_EMAIL__USE_TLS - valueFrom: - secretKeyRef: - name: authentik-secrets - key: email_use_tls + envFrom: + - secretRef: + name: authentik-app-secrets volumeMounts: - name: data mountPath: /data diff --git a/applications/infisical/Infisical-secrets/authentik-infisicalsecret.yaml b/applications/authentik/server/infisicalsecret.yaml similarity index 71% rename from applications/infisical/Infisical-secrets/authentik-infisicalsecret.yaml rename to applications/authentik/server/infisicalsecret.yaml index 4c4d66d..05fc258 100644 --- a/applications/infisical/Infisical-secrets/authentik-infisicalsecret.yaml +++ b/applications/authentik/server/infisicalsecret.yaml @@ -1,7 +1,7 @@ apiVersion: secrets.infisical.com/v1alpha1 kind: InfisicalSecret metadata: - name: authentik-secrets + name: authentik-app-secrets namespace: infisical spec: hostAPI: https://infisical.jsme.be @@ -16,9 +16,10 @@ spec: secretsScope: projectSlug: "kubernetes" envSlug: "prod" - secretsPath: "/authentik" - recursive: true + secretsPath: "/authentik/authentik" + # Non-recursive: keys are already named as the container expects. + recursive: false managedSecretReference: - secretName: authentik-secrets + secretName: authentik-app-secrets secretNamespace: authentik secretType: Opaque diff --git a/applications/authentik/worker/authentik-worker-deployment.yaml b/applications/authentik/worker/authentik-worker-deployment.yaml index 1d25e51..2ba341e 100644 --- a/applications/authentik/worker/authentik-worker-deployment.yaml +++ b/applications/authentik/worker/authentik-worker-deployment.yaml @@ -22,62 +22,9 @@ spec: image: ghcr.io/goauthentik/server:2026.5.2 command: ["ak"] args: ["worker"] - env: - - name: AUTHENTIK_POSTGRESQL__HOST - valueFrom: - secretKeyRef: - name: authentik-secrets - key: db_host - - name: AUTHENTIK_POSTGRESQL__NAME - valueFrom: - secretKeyRef: - name: authentik-secrets - key: db_name - - name: AUTHENTIK_POSTGRESQL__USER - valueFrom: - secretKeyRef: - name: authentik-secrets - key: db_user - - name: AUTHENTIK_POSTGRESQL__PASSWORD - valueFrom: - secretKeyRef: - name: authentik-secrets - key: db_password - - name: AUTHENTIK_SECRET_KEY - valueFrom: - secretKeyRef: - name: authentik-secrets - key: AUTHENTIK_SECRET_KEY - - name: AUTHENTIK_EMAIL__HOST - valueFrom: - secretKeyRef: - name: authentik-secrets - key: email_host - - name: AUTHENTIK_EMAIL__PORT - valueFrom: - secretKeyRef: - name: authentik-secrets - key: email_port - - name: AUTHENTIK_EMAIL__USERNAME - valueFrom: - secretKeyRef: - name: authentik-secrets - key: email_username - - name: AUTHENTIK_EMAIL__PASSWORD - valueFrom: - secretKeyRef: - name: authentik-secrets - key: email_password - - name: AUTHENTIK_EMAIL__FROM - valueFrom: - secretKeyRef: - name: authentik-secrets - key: email_from - - name: AUTHENTIK_EMAIL__USE_TLS - valueFrom: - secretKeyRef: - name: authentik-secrets - key: email_use_tls + envFrom: + - secretRef: + name: authentik-app-secrets volumeMounts: - name: data mountPath: /data