From 76e8fa8ee7783cdd1923d3c9d09470974f0ea9f7 Mon Sep 17 00:00:00 2001 From: Aspen Date: Wed, 24 Jun 2026 23:23:14 -0400 Subject: [PATCH] fix(authentik): correct errors blocking metrics from working (#49454) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** Correct the syntax for metrics definitions in the authentik chart, and enable worker metrics ⚒️ Fixes # **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [x] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code - [ ] 📜 Documentation Changes **🧪 How Has This Been Tested?** Tested against the values in the `ci/` directory and it now produces the consistent, expected ServiceMonitor resources, Service resources, and adds containerPorts. **📃 Notes:** I can't find an associated issue, but the values.yaml and templates both indicate this was an old bug that needed to be fixed. **✔️ Checklist:** - [x] ⚖️ My code follows the style guidelines of this project - [x] 👀 I have performed a self-review of my own code - [x] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made changes to the documentation - [x] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [x] ⬆️ I increased versions for any altered app according to semantic versioning - [x] I made sure the title starts with `feat(chart-name):`, `fix(chart-name):`, `chore(chart-name):`, `docs(chart-name):` or `fix(docs):` **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --- charts/stable/authentik/Chart.yaml | 2 +- charts/stable/authentik/templates/_config.tpl | 7 ++++ charts/stable/authentik/templates/common.yaml | 11 ------ charts/stable/authentik/values.yaml | 35 ++++++++++++++++--- 4 files changed, 38 insertions(+), 17 deletions(-) diff --git a/charts/stable/authentik/Chart.yaml b/charts/stable/authentik/Chart.yaml index 365a6587154..392f0887b8c 100644 --- a/charts/stable/authentik/Chart.yaml +++ b/charts/stable/authentik/Chart.yaml @@ -40,5 +40,5 @@ sources: - https://github.com/trueforge-org/truecharts/tree/master/charts/stable/authentik - https://goauthentik.io/docs/ type: application -version: 40.8.0 +version: 40.8.1 diff --git a/charts/stable/authentik/templates/_config.tpl b/charts/stable/authentik/templates/_config.tpl index 454418ad312..93cde4c31ab 100644 --- a/charts/stable/authentik/templates/_config.tpl +++ b/charts/stable/authentik/templates/_config.tpl @@ -11,6 +11,13 @@ server: AUTHENTIK_LISTEN__HTTP: {{ printf "0.0.0.0:%v" .Values.service.http.ports.http.port | quote }} AUTHENTIK_LISTEN__METRICS: {{ printf "0.0.0.0:%v" .Values.service.servermetrics.ports.servermetrics.port | quote }} +{{/* Worker-only config */}} +worker: + enabled: true + data: + AUTHENTIK_LISTEN__METRICS: {{ printf "0.0.0.0:%v" .Values.service.workermetrics.ports.workermetrics.port | quote }} + +{{/* Shared config for server and worker */}} server-worker: enabled: true data: diff --git a/charts/stable/authentik/templates/common.yaml b/charts/stable/authentik/templates/common.yaml index f60f125473f..16382c638fc 100644 --- a/charts/stable/authentik/templates/common.yaml +++ b/charts/stable/authentik/templates/common.yaml @@ -82,16 +82,5 @@ {{- $_ := set .Values.metrics.ldapmetrics "enabled" false -}} {{- end -}} -{{/* FIXME: See values.yaml */}} -{{- $_ := set .Values.service.servermetrics "enabled" false -}} -{{- $_ := set .Values.service.proxymetrics "enabled" false -}} -{{- $_ := set .Values.service.radiusmetrics "enabled" false -}} -{{- $_ := set .Values.service.ldapmetrics "enabled" false -}} - -{{- $_ := set .Values.metrics.servermetrics "enabled" false -}} -{{- $_ := set .Values.metrics.proxymetrics "enabled" false -}} -{{- $_ := set .Values.metrics.radiusmetrics "enabled" false -}} -{{- $_ := set .Values.metrics.ldapmetrics "enabled" false -}} - {{/* Render the templates */}} {{ include "tc.v1.common.loader.apply" . }} diff --git a/charts/stable/authentik/values.yaml b/charts/stable/authentik/values.yaml index 406a3df84c5..d193ff3c9a9 100644 --- a/charts/stable/authentik/values.yaml +++ b/charts/stable/authentik/values.yaml @@ -145,6 +145,8 @@ workload: name: server-worker - configMapRef: name: server-worker + - configMapRef: + name: worker args: - worker probes: @@ -372,6 +374,17 @@ service: enabled: true protocol: http port: 10231 + # Worker Metrics + workermetrics: + enabled: true + type: ClusterIP + targetSelector: worker + ports: + workermetrics: + enabled: true + protocol: http + port: 10235 + targetSelector: worker # Radius Metrics radiusmetrics: enabled: true @@ -459,37 +472,49 @@ cnpg: database: authentik metrics: - # FIXME: Metrics do not work yet servermetrics: enabled: true type: servicemonitor endpoints: - - port: "{{ .Values.service.servermetrics.ports.servermetrics.port }}" + - port: "servermetrics" path: /metrics + targetSelector: servermetrics + prometheusRule: + enabled: false + workermetrics: + enabled: true + type: servicemonitor + endpoints: + - port: "workermetrics" + path: /metrics + targetSelector: workermetrics prometheusRule: enabled: false radiusmetrics: enabled: true type: servicemonitor endpoints: - - port: "{{ .Values.service.radiusmetrics.ports.radiusmetrics.port }}" + - port: "radiusmetrics" path: /metrics + targetSelector: radiusmetrics prometheusRule: enabled: false ldapmetrics: enabled: true type: servicemonitor endpoints: - - port: "{{ .Values.service.ldapmetrics.ports.ldapmetrics.port }}" + - port: "ldapmetrics" path: /metrics + targetSelector: ldapmetrics prometheusRule: enabled: false proxymetrics: enabled: true type: servicemonitor endpoints: - - port: "{{ .Values.service.proxymetrics.ports.proxymetrics.port }}" + - port: "proxymetrics" path: /metrics + targetSelector: proxymetrics prometheusRule: enabled: false updated: true