From 6e2002d7fbf9ebad9ebd0d5701227f688fbd6713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roy?= Date: Sat, 25 Mar 2023 02:27:00 -0700 Subject: [PATCH] fix(traefik) Fix arguments to fix metrics (#7827) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Fixes # The _args template did not handle the standard metrics question and thus the `--metrics.prometheus.entrypoint=metrics` was not passed to traefik, resulting in 404 errors in prometheus. **⚙️ 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 **🧪 How Has This Been Tested?** Run `helm template --namespace=ix-traefik --set metrics.main.enabled=true .` in the charts directory. Check that `args` for the traefik pods contains - "--entryPoints.metrics.address=:9180/tcp" - "--metrics.prometheus=true" - "--metrics.prometheus.entrypoint=metrics" **📃 Notes:** **✔️ Checklist:** - [x] ⚖️ My code follows the style guidelines of this project - [x] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 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 **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ 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._ --------- Signed-off-by: Kjeld Schouten-Lebbing Co-authored-by: Kjeld Schouten-Lebbing --- charts/enterprise/traefik/Chart.yaml | 2 +- charts/enterprise/traefik/templates/_args.tpl | 24 +++++++++++-------- charts/enterprise/traefik/values.yaml | 2 -- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/charts/enterprise/traefik/Chart.yaml b/charts/enterprise/traefik/Chart.yaml index 0bd46d05613..69747220411 100644 --- a/charts/enterprise/traefik/Chart.yaml +++ b/charts/enterprise/traefik/Chart.yaml @@ -23,7 +23,7 @@ sources: - https://github.com/traefik/traefik-helm-chart - https://traefik.io/ type: application -version: 17.0.12 +version: 17.0.13 annotations: truecharts.org/catagories: | - network diff --git a/charts/enterprise/traefik/templates/_args.tpl b/charts/enterprise/traefik/templates/_args.tpl index 7acee2f60ac..cf1e35a1d49 100644 --- a/charts/enterprise/traefik/templates/_args.tpl +++ b/charts/enterprise/traefik/templates/_args.tpl @@ -24,25 +24,29 @@ args: {{- end }} - "--api.dashboard=true" - "--ping=true" - {{- if .Values.metrics }} - {{- if .Values.metrics.datadog }} + {{- if .Values.traefikMetrics }} + {{- if .Values.traefikMetrics.datadog }} - "--metrics.datadog=true" - - "--metrics.datadog.address={{ .Values.metrics.datadog.address }}" + - "--metrics.datadog.address={{ .Values.traefikMetrics.datadog.address }}" {{- end }} - {{- if .Values.metrics.influxdb }} + {{- if .Values.traefikMetrics.influxdb }} - "--metrics.influxdb=true" - - "--metrics.influxdb.address={{ .Values.metrics.influxdb.address }}" - - "--metrics.influxdb.protocol={{ .Values.metrics.influxdb.protocol }}" + - "--metrics.influxdb.address={{ .Values.traefikMetrics.influxdb.address }}" + - "--metrics.influxdb.protocol={{ .Values.traefikMetrics.influxdb.protocol }}" {{- end }} - {{- if .Values.metrics.prometheus }} + {{- if .Values.traefikMetrics.statsd }} + - "--metrics.statsd=true" + - "--metrics.statsd.address={{ .Values.traefikMetrics.statsd.address }}" + {{- if or .Values.traefikMetrics.prometheus }} - "--metrics.prometheus=true" - "--metrics.prometheus.entrypoint=metrics" {{- end }} - {{- if .Values.metrics.statsd }} - - "--metrics.statsd=true" - - "--metrics.statsd.address={{ .Values.metrics.statsd.address }}" {{- end }} {{- end }} + {{- if or .Values.metrics.main.enabled }} + - "--metrics.prometheus=true" + - "--metrics.prometheus.entrypoint=metrics" + {{- end }} {{- if .Values.providers.kubernetesCRD.enabled }} - "--providers.kubernetescrd" {{- end }} diff --git a/charts/enterprise/traefik/values.yaml b/charts/enterprise/traefik/values.yaml index da317fc579c..54ec179c8db 100644 --- a/charts/enterprise/traefik/values.yaml +++ b/charts/enterprise/traefik/values.yaml @@ -144,8 +144,6 @@ globalArguments: # All available options available on https://docs.traefik.io/reference/static-configuration/cli/ ## Use curly braces to pass values: `helm install --set="additionalArguments={--providers.kubernetesingress.ingressclass=traefik-internal,--log.level=DEBUG}"` additionalArguments: - - "--metrics.prometheus" - - "--ping" - "--serverstransport.insecureskipverify=true" - "--providers.kubernetesingress.allowexternalnameservices=true"