mirror of
https://github.com/kyverno/kyverno.git
synced 2025-04-13 15:57:31 +00:00
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
47 lines
1.5 KiB
YAML
47 lines
1.5 KiB
YAML
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ template "kyverno.admission-controller.serviceName" . }}
|
|
namespace: {{ template "kyverno.namespace" . }}
|
|
labels:
|
|
{{- include "kyverno.admission-controller.labels" . | nindent 4 }}
|
|
{{- with .Values.service.annotations }}
|
|
annotations: {{ tpl (toYaml .) $ | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
ports:
|
|
- port: {{ .Values.service.port }}
|
|
targetPort: https
|
|
protocol: TCP
|
|
name: https
|
|
{{- if and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort)) }}
|
|
nodePort: {{ .Values.service.nodePort }}
|
|
{{- end }}
|
|
selector:
|
|
{{- include "kyverno.admission-controller.matchLabels" . | nindent 4 }}
|
|
type: {{ .Values.service.type }}
|
|
---
|
|
{{- if .Values.metricsService.create }}
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ template "kyverno.admission-controller.serviceName" . }}-metrics
|
|
namespace: {{ template "kyverno.namespace" . }}
|
|
labels:
|
|
{{- include "kyverno.admission-controller.labels" . | nindent 4 }}
|
|
{{- with .Values.metricsService.annotations }}
|
|
annotations: {{ tpl (toYaml .) $ | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
ports:
|
|
- port: {{ .Values.metricsService.port }}
|
|
targetPort: 8000
|
|
protocol: TCP
|
|
name: metrics-port
|
|
{{- if and (eq .Values.metricsService.type "NodePort") (not (empty .Values.metricsService.nodePort)) }}
|
|
nodePort: {{ .Values.metricsService.nodePort }}
|
|
{{- end }}
|
|
selector:
|
|
{{- include "kyverno.admission-controller.matchLabels" . | nindent 4 }}
|
|
type: {{ .Values.metricsService.type }}
|
|
{{- end -}}
|