openreplay/scripts/helmcharts/toolings/charts/kyverno/templates/reports-controller/service.yaml
2023-06-09 18:13:40 +02:00

27 lines
1,012 B
YAML

{{- if .Values.reportsController.enabled -}}
{{- if .Values.reportsController.metricsService.create -}}
apiVersion: v1
kind: Service
metadata:
name: {{ template "kyverno.reports-controller.name" . }}-metrics
namespace: {{ template "kyverno.namespace" . }}
labels:
{{- include "kyverno.reports-controller.labels" . | nindent 4 }}
{{- with .Values.reportsController.metricsService.annotations }}
annotations:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
ports:
- port: {{ .Values.reportsController.metricsService.port }}
targetPort: 8000
protocol: TCP
name: metrics-port
{{- if and (eq .Values.reportsController.metricsService.type "NodePort") (not (empty .Values.reportsController.metricsService.nodePort)) }}
nodePort: {{ .Values.reportsController.metricsService.nodePort }}
{{- end }}
selector:
{{- include "kyverno.reports-controller.matchLabels" . | nindent 4 }}
type: {{ .Values.reportsController.metricsService.type }}
{{- end -}}
{{- end -}}