-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add Helm test for Authentik deployment validation #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d16ea02
7141250
a00735c
55642a3
8cf47de
0a5ba58
8079e6a
eedfce9
2982a67
e59a8c4
e5eea62
eab6b77
e378d76
5adf6ea
f4241d5
f496b18
526c12e
443651c
715ada0
32e3174
21970e0
968098a
7a0f0eb
5208561
5338895
831a6ad
baaa428
592c586
948d26d
d456306
0937f89
576e828
9b72bae
e59fb3c
d79a8b0
da0f20c
fab2b43
0c4e9cf
518827a
6f09545
be45937
d670141
cc463bd
81a0b43
f5e300b
e0d3db4
177bf13
a7da994
b4db45b
acc1b5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| {{- if .Values.authentik.enabled }} | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: {{ include "ok8s.fullname" . }}-authentik | ||
| data: | ||
| # Authentik configuration | ||
| authentik.yml: | | ||
| # Basic configuration | ||
| debug: false | ||
| secret_key: /secrets/secretKey | ||
| disable_startup_analytics: true | ||
|
|
||
| # Database | ||
| database: | ||
| host: {{ include "ok8s.fullname" . }}-authentik-postgres | ||
| name: {{ .Values.authentik.postgres.database }} | ||
| user: {{ .Values.authentik.postgres.username }} | ||
| password: /secrets/postgresPassword | ||
|
|
||
| # Redis | ||
| redis: | ||
| host: {{ include "ok8s.fullname" . }}-authentik-redis | ||
| password: /secrets/redisPassword | ||
|
|
||
| # Email (disabled for this use case) | ||
| email: | ||
| backend: dummy | ||
|
|
||
| # OIDC provider settings (configured via UI after deployment) | ||
| oidc: | ||
| enabled: {{ .Values.authentik.oidc.enabled }} | ||
| {{- if .Values.authentik.oidc.issuerUrl }} | ||
| issuer_url: {{ .Values.authentik.oidc.issuerUrl }} | ||
| {{- end }} | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,51 @@ | ||||||||||||||
| {{- if .Values.authentik.enabled }} | ||||||||||||||
| apiVersion: apps/v1 | ||||||||||||||
| kind: Deployment | ||||||||||||||
| metadata: | ||||||||||||||
| name: {{ include "ok8s.fullname" . }}-authentik | ||||||||||||||
| namespace: {{ .Release.Namespace }} | ||||||||||||||
| labels: | ||||||||||||||
| app.kubernetes.io/name: authentik | ||||||||||||||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||||||||||||||
| spec: | ||||||||||||||
|
Comment on lines
+6
to
+10
|
||||||||||||||
| replicas: {{ .Values.authentik.replicaCount }} | ||||||||||||||
| selector: | ||||||||||||||
| matchLabels: | ||||||||||||||
| app.kubernetes.io/name: authentik | ||||||||||||||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||||||||||||||
| template: | ||||||||||||||
| metadata: | ||||||||||||||
| labels: | ||||||||||||||
| app.kubernetes.io/name: authentik | ||||||||||||||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||||||||||||||
| spec: | ||||||||||||||
| containers: | ||||||||||||||
| - name: authentik | ||||||||||||||
| image: {{ .Values.authentik.image.repository }}:{{ .Values.authentik.image.tag }} | ||||||||||||||
|
timothyclin marked this conversation as resolved.
|
||||||||||||||
| command: ["ak", "server"] | ||||||||||||||
| env: | ||||||||||||||
| - name: AUTHENTIK_BOOTSTRAP_PASSWORD | ||||||||||||||
| value: "admin" # Change in production | ||||||||||||||
| - name: AUTHENTIK_BOOTSTRAP_EMAIL | ||||||||||||||
| value: "admin@local" | ||||||||||||||
|
Comment on lines
+28
to
+30
|
||||||||||||||
| value: "admin" # Change in production | |
| - name: AUTHENTIK_BOOTSTRAP_EMAIL | |
| value: "admin@local" | |
| value: {{ required "authentik.bootstrap.password is required" .Values.authentik.bootstrap.password | quote }} | |
| - name: AUTHENTIK_BOOTSTRAP_EMAIL | |
| value: {{ required "authentik.bootstrap.email is required" .Values.authentik.bootstrap.email | quote }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| {{- if .Values.authentik.enabled }} | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
| name: {{ include "ok8s.fullname" . }}-authentik | ||
|
timothyclin marked this conversation as resolved.
|
||
| spec: | ||
| podSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: authentik | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| policyTypes: | ||
| - Ingress | ||
| - Egress | ||
| ingress: | ||
| - from: | ||
| - namespaceSelector: {} # Allow from all namespaces | ||
| ports: | ||
| - protocol: TCP | ||
| port: 9000 | ||
| - protocol: TCP | ||
| port: 9443 | ||
| egress: | ||
| - to: | ||
| - podSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: postgres | ||
| ports: | ||
| - protocol: TCP | ||
| port: 5432 | ||
| - to: | ||
| - podSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: redis | ||
| ports: | ||
| - protocol: TCP | ||
| port: 6379 | ||
| - to: [] # Allow external access for OIDC providers | ||
| ports: | ||
|
timothyclin marked this conversation as resolved.
|
||
| - protocol: TCP | ||
| port: 443 | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,45 @@ | ||||||||||||||
| {{- if .Values.authentik.enabled }} | ||||||||||||||
| apiVersion: apps/v1 | ||||||||||||||
| kind: Deployment | ||||||||||||||
| metadata: | ||||||||||||||
| name: {{ include "ok8s.fullname" . }}-authentik-postgres | ||||||||||||||
| labels: | ||||||||||||||
|
timothyclin marked this conversation as resolved.
Comment on lines
+5
to
+6
|
||||||||||||||
| name: {{ include "ok8s.fullname" . }}-authentik-postgres | |
| labels: | |
| name: {{ include "ok8s.fullname" . }}-authentik-postgres | |
| namespace: {{ .Release.Namespace }} | |
| labels: | |
| {{- include "ok8s.labels" . | nindent 4 }} |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,12 @@ | ||||||||||||
| {{- if and .Values.authentik.enabled .Values.authentik.postgres.persistence.enabled }} | ||||||||||||
|
timothyclin marked this conversation as resolved.
|
||||||||||||
| apiVersion: v1 | ||||||||||||
| kind: PersistentVolumeClaim | ||||||||||||
| metadata: | ||||||||||||
| name: {{ include "ok8s.fullname" . }}-authentik-postgres | ||||||||||||
|
||||||||||||
| name: {{ include "ok8s.fullname" . }}-authentik-postgres | |
| name: {{ include "ok8s.fullname" . }}-authentik-postgres | |
| namespace: {{ .Release.Namespace }} | |
| labels: | |
| {{- include "ok8s.labels" . | nindent 4 }} |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,13 @@ | ||||||||||||
| {{- if .Values.authentik.enabled }} | ||||||||||||
| apiVersion: v1 | ||||||||||||
| kind: Service | ||||||||||||
| metadata: | ||||||||||||
| name: {{ include "ok8s.fullname" . }}-authentik-postgres | ||||||||||||
|
||||||||||||
| name: {{ include "ok8s.fullname" . }}-authentik-postgres | |
| name: {{ include "ok8s.fullname" . }}-authentik-postgres | |
| namespace: {{ .Release.Namespace }} | |
| labels: | |
| {{- include "ok8s.labels" . | nindent 4 }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| {{- if .Values.authentik.enabled }} | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ include "ok8s.fullname" . }}-authentik-redis | ||
| labels: | ||
|
Comment on lines
+1
to
+6
|
||
| app.kubernetes.io/name: redis | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| spec: | ||
|
Comment on lines
+3
to
+9
|
||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: redis | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app.kubernetes.io/name: redis | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| spec: | ||
| containers: | ||
| - name: redis | ||
| image: "{{ .Values.authentik.redis.image.repository }}:{{ .Values.authentik.redis.image.tag }}" | ||
| command: ["redis-server", "--requirepass", "$(REDIS_PASSWORD)"] | ||
| env: | ||
| - name: REDIS_PASSWORD | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ include "ok8s.fullname" . }}-authentik-redis | ||
| key: password | ||
| ports: | ||
| - containerPort: 6379 | ||
| resources: {{ toYaml .Values.authentik.redis.resources | nindent 10 }} | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,13 @@ | ||||||||||||
| {{- if .Values.authentik.enabled }} | ||||||||||||
| apiVersion: v1 | ||||||||||||
| kind: Service | ||||||||||||
| metadata: | ||||||||||||
| name: {{ include "ok8s.fullname" . }}-authentik-redis | ||||||||||||
|
||||||||||||
| name: {{ include "ok8s.fullname" . }}-authentik-redis | |
| name: {{ include "ok8s.fullname" . }}-authentik-redis | |
| namespace: {{ .Release.Namespace }} | |
| labels: | |
| {{- include "ok8s.labels" . | nindent 4 }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| {{- if .Values.authentik.enabled }} | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: {{ include "ok8s.fullname" . }}-authentik | ||
| type: Opaque | ||
|
Comment on lines
+2
to
+6
|
||
| data: | ||
| # Authentik secret key for encryption | ||
| secretKey: {{ required "authentik.secretKey must be set" .Values.authentik.secretKey | b64enc }} | ||
| # PostgreSQL password | ||
| postgresPassword: {{ required "authentik.postgres.password must be set" .Values.authentik.postgres.password | b64enc }} | ||
| # Redis password | ||
| redisPassword: {{ required "authentik.redis.password must be set" .Values.authentik.redis.password | b64enc }} | ||
|
Comment on lines
+8
to
+13
|
||
| # OIDC client secret (if provided) | ||
| {{- if .Values.authentik.oidc.clientSecret }} | ||
| oidcClientSecret: {{ .Values.authentik.oidc.clientSecret | b64enc }} | ||
| {{- end }} | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: {{ include "ok8s.fullname" . }}-authentik-postgres | ||
| type: Opaque | ||
| data: | ||
| password: {{ required "authentik.postgres.password must be set" .Values.authentik.postgres.password | b64enc }} | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: {{ include "ok8s.fullname" . }}-authentik-redis | ||
| type: Opaque | ||
| data: | ||
| password: {{ required "authentik.redis.password must be set" .Values.authentik.redis.password | b64enc }} | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,17 @@ | ||||||||||||
| {{- if .Values.authentik.enabled }} | ||||||||||||
| apiVersion: v1 | ||||||||||||
| kind: Service | ||||||||||||
| metadata: | ||||||||||||
| name: {{ include "ok8s.fullname" . }}-authentik | ||||||||||||
|
||||||||||||
| name: {{ include "ok8s.fullname" . }}-authentik | |
| name: {{ include "ok8s.fullname" . }}-authentik | |
| namespace: {{ .Release.Namespace }} | |
| labels: | |
| {{- include "ok8s.labels" . | nindent 4 }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| {{- if .Values.authentik.enabled }} | ||
| # Authentik ingress for shared hostname | ||
| apiVersion: networking.k8s.io/v1 | ||
|
timothyclin marked this conversation as resolved.
|
||
| kind: Ingress | ||
| metadata: | ||
| name: {{ include "ok8s.fullname" . }}-authentik | ||
| annotations: | ||
| nginx.ingress.kubernetes.io/ssl-redirect: "true" | ||
| cert-manager.io/cluster-issuer: "letsencrypt-prod" | ||
|
timothyclin marked this conversation as resolved.
|
||
| spec: | ||
| ingressClassName: nginx | ||
| tls: | ||
| - hosts: | ||
| - {{ .Values.authentik.proxy.hostname }} | ||
| secretName: {{ include "ok8s.fullname" . }}-authentik-tls | ||
| rules: | ||
| - host: {{ .Values.authentik.proxy.hostname }} | ||
| http: | ||
| paths: | ||
| - path: / | ||
| pathType: Prefix | ||
| backend: | ||
| service: | ||
| name: {{ include "ok8s.fullname" . }}-authentik | ||
| port: | ||
| number: 80 | ||
| {{- else }} | ||
| # Direct ingress to OpenCode service | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: Ingress | ||
| metadata: | ||
| name: {{ include "ok8s.fullname" . }} | ||
| annotations: | ||
| nginx.ingress.kubernetes.io/ssl-redirect: "true" | ||
| cert-manager.io/cluster-issuer: "letsencrypt-prod" | ||
| spec: | ||
| ingressClassName: nginx | ||
| tls: | ||
| - hosts: | ||
| - {{ .Values.ingress.hostname | default (include "ok8s.ingressHostname" .) }} | ||
| secretName: {{ include "ok8s.fullname" . }}-tls | ||
| rules: | ||
| - host: {{ .Values.ingress.hostname | default (include "ok8s.ingressHostname" .) }} | ||
| http: | ||
| paths: | ||
| - path: / | ||
| pathType: Prefix | ||
| backend: | ||
| service: | ||
| name: {{ include "ok8s.fullname" . }} | ||
| port: | ||
| number: 4096 | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,22 @@ | ||||||||||||||||||||||
| {{- if .Values.authentik.enabled }} | ||||||||||||||||||||||
| apiVersion: v1 | ||||||||||||||||||||||
| kind: Pod | ||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||
| name: {{ include "ok8s.fullname" . }}-authentik-test | ||||||||||||||||||||||
|
Comment on lines
+1
to
+5
|
||||||||||||||||||||||
| annotations: | ||||||||||||||||||||||
| "helm.sh/hook": test | ||||||||||||||||||||||
|
Comment on lines
+5
to
+7
|
||||||||||||||||||||||
| name: {{ include "ok8s.fullname" . }}-authentik-test | |
| annotations: | |
| "helm.sh/hook": test | |
| name: {{ include "ok8s.fullname" . }}-authentik-test | |
| namespace: {{ .Release.Namespace }} | |
| labels: | |
| {{- include "ok8s.labels" . | nindent 4 }} | |
| annotations: | |
| "helm.sh/hook": test | |
| "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded |
Copilot
AI
Apr 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script comment says it tests PostgreSQL connectivity, but the test only does an HTTP curl and then prints a success message. Either implement an actual DB connectivity check (e.g., TCP check/pg_isready with an appropriate image) or remove/rename the comment to reflect what is actually tested.
| # Test PostgreSQL connectivity (basic) | |
| # Report successful Authentik availability test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ConfigMap is missing
metadata.namespace: {{ .Release.Namespace }}and the common chart labels (include "ok8s.labels"). Other templates in this chart consistently set both (e.g.,chart/templates/configmap.yaml), so adding them here will keep resources discoverable and consistent.