From 7a5116e3e61cb3cd655bd6f7f14184a5093efe1f Mon Sep 17 00:00:00 2001 From: David Weber Date: Fri, 3 Nov 2023 09:00:44 +0100 Subject: [PATCH] fix(serviceMonitor) fix target port for cmetrics the target port for cmetrics should only be applied if the ingress controller is enabled --- charts/kong/CHANGELOG.md | 5 +++++ charts/kong/templates/servicemonitor.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/charts/kong/CHANGELOG.md b/charts/kong/CHANGELOG.md index 3705f343a..a10fd896d 100644 --- a/charts/kong/CHANGELOG.md +++ b/charts/kong/CHANGELOG.md @@ -9,6 +9,11 @@ * Added services resource to admission webhook config for KIC >= 3.0.0. [#919](https://github.com/Kong/charts/pull/919) +### Fixed + +* The target port for cmetrics should only be applied if the ingress controller is enabled. + [#926](https://github.com/Kong/charts/pull/926) + ## 2.30.0 ### Improvements diff --git a/charts/kong/templates/servicemonitor.yaml b/charts/kong/templates/servicemonitor.yaml index b0f8b4d3a..db3dfbf35 100644 --- a/charts/kong/templates/servicemonitor.yaml +++ b/charts/kong/templates/servicemonitor.yaml @@ -24,7 +24,7 @@ spec: {{- if .Values.serviceMonitor.metricRelabelings }} metricRelabelings: {{ toYaml .Values.serviceMonitor.metricRelabelings | nindent 6 }} {{- end }} - {{ if (semverCompare ">= 2.0.0" (include "kong.effectiveVersion" .Values.ingressController.image)) -}} + {{- if and .Values.ingressController.enabled (semverCompare ">= 2.0.0" (include "kong.effectiveVersion" .Values.ingressController.image)) }} - targetPort: cmetrics scheme: http {{- if .Values.serviceMonitor.interval }}