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

fix: add missing service monitor for background controller (#6600)

* fix: add missing service monitor for background controller

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2023-03-16 13:03:52 +01:00 committed by GitHub
parent 7b9ef6ab1b
commit c275740279
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 51 additions and 13 deletions

View file

@ -0,0 +1,34 @@
{{- if .Values.backgroundController.enabled -}}
{{- if .Values.backgroundController.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "kyverno.background-controller.name" . }}
{{- if .Values.backgroundController.serviceMonitor.namespace }}
namespace: {{ .Values.backgroundController.serviceMonitor.namespace }}
{{- else }}
namespace: {{ template "kyverno.namespace" . }}
{{- end }}
labels:
{{- include "kyverno.background-controller.labels" . | nindent 4 }}
{{- with .Values.backgroundController.serviceMonitor.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "kyverno.background-controller.matchLabels" . | nindent 6 }}
namespaceSelector:
matchNames:
- {{ template "kyverno.namespace" . }}
endpoints:
- port: metrics-port
interval: {{ .Values.backgroundController.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.backgroundController.serviceMonitor.scrapeTimeout }}
{{- if .Values.backgroundController.serviceMonitor.secure }}
scheme: https
tlsConfig:
{{- toYaml .Values.backgroundController.serviceMonitor.tlsConfig | nindent 8 }}
{{- end }}
{{- end -}}
{{- end -}}

View file

@ -17,6 +17,10 @@ admissionController:
- --tracingPort=4317
- --enablePolicyException
backgroundController:
serviceMonitor:
enabled: true
cleanupController:
rbac:
clusterRole:

View file

@ -9,19 +9,6 @@ admissionController:
- --loggingFormat=json
- --enablePolicyException
cleanupController:
rbac:
clusterRole:
extraResources:
- apiGroups:
- ''
resources:
- pods
reportsController:
extraArgs:
enablePolicyException: true
backgroundController:
rbac:
clusterRole:
@ -40,3 +27,16 @@ backgroundController:
- nodes
- nodes/status
- pods
cleanupController:
rbac:
clusterRole:
extraResources:
- apiGroups:
- ''
resources:
- pods
reportsController:
extraArgs:
enablePolicyException: true