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:
parent
7fd2d1a5a3
commit
590dce5830
5 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue