1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-29 10:55:05 +00:00

fix(chart): only create ServiceMonitor if cluster supports it (#7926)

* fix: only create ServiceMonitor if cluster supports it

Adds an additional check to the ServiceMonitor template to ensure that
the cluster supports the `monitoring.coreos.com/v1` API version.

Signed-off-by: Alexej Disterhoft <alexej@disterhoft.de>
This commit is contained in:
Alexej Disterhoft 2023-07-28 14:27:36 +02:00 committed by GitHub
parent 7fd2d1a5a3
commit 590dce5830
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 4 deletions

View file

@ -26,6 +26,8 @@ annotations:
url: https://kyverno.io/docs
# valid kinds are: added, changed, deprecated, removed, fixed and security
artifacthub.io/changes: |
- kind: changed
description: only create ServiceMonitor if cluster supports it
- kind: fixed
description: rbac templating issues
- kind: added

View file

@ -1,4 +1,4 @@
{{- if .Values.admissionController.serviceMonitor.enabled }}
{{- if and .Values.admissionController.serviceMonitor.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:

View file

@ -1,5 +1,5 @@
{{- if .Values.backgroundController.enabled -}}
{{- if .Values.backgroundController.serviceMonitor.enabled -}}
{{- if and .Values.backgroundController.serviceMonitor.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:

View file

@ -1,5 +1,5 @@
{{- if .Values.cleanupController.enabled -}}
{{- if .Values.cleanupController.serviceMonitor.enabled -}}
{{- if and .Values.cleanupController.serviceMonitor.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:

View file

@ -1,5 +1,5 @@
{{- if .Values.reportsController.enabled -}}
{{- if .Values.reportsController.serviceMonitor.enabled -}}
{{- if and .Values.reportsController.serviceMonitor.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata: