diff --git a/charts/kong/CHANGELOG.md b/charts/kong/CHANGELOG.md index 03577a61b..97a33cbd4 100644 --- a/charts/kong/CHANGELOG.md +++ b/charts/kong/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## Unreleased +* Added serviceMonitor.trustCRDsExist for render based deployments ### Changes diff --git a/charts/kong/README.md b/charts/kong/README.md index fa495a31b..657854429 100644 --- a/charts/kong/README.md +++ b/charts/kong/README.md @@ -908,6 +908,7 @@ On the Gateway release side, set either `admin.tls.client.secretName` to the nam | securityContext | Set the securityContext for Kong Pods | `{}` | | containerSecurityContext | Set the securityContext for Containers | See values.yaml | | serviceMonitor.enabled | Create ServiceMonitor for Prometheus Operator | `false` | +| serviceMonitor.trustCRDsExist | Do not check for the Prometheus Operator CRDs, just try to deploy | `false` | | serviceMonitor.interval | Scraping interval | `30s` | | serviceMonitor.namespace | Where to create ServiceMonitor | | | serviceMonitor.labels | ServiceMonitor labels | `{}` | diff --git a/charts/kong/templates/servicemonitor.yaml b/charts/kong/templates/servicemonitor.yaml index 6e1f3abb0..50ec5a1a7 100644 --- a/charts/kong/templates/servicemonitor.yaml +++ b/charts/kong/templates/servicemonitor.yaml @@ -1,4 +1,4 @@ -{{- if and ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) .Values.serviceMonitor.enabled }} +{{- if and .Values.serviceMonitor.enabled (or (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.serviceMonitor.trustCRDsExist) }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: diff --git a/charts/kong/values.yaml b/charts/kong/values.yaml index 9cbe44bc7..30b538374 100644 --- a/charts/kong/values.yaml +++ b/charts/kong/values.yaml @@ -1011,6 +1011,7 @@ serviceMonitor: # If you wish to gather metrics from a Kong instance with the proxy disabled (such as a hybrid control plane), see: # https://github.com/Kong/charts/blob/main/charts/kong/README.md#prometheus-operator-integration enabled: false + trustCRDsExist: false # interval: 30s # Specifies namespace, where ServiceMonitor should be installed # namespace: monitoring