blob: 42dadbb8cd8184bfb73af74b3e5802efa6275946 [file] [log] [blame]
Giorgi Lekveishviliec6b3cc2023-12-01 16:30:04 +04001{{- if and .Values.deployment.enabled .Values.prometheus.service.enabled }}
2apiVersion: v1
3kind: Service
4metadata:
5 name: {{ template "coredns.fullname" . }}-metrics
6 labels: {{- include "coredns.labels" . | nindent 4 }}
7 app.kubernetes.io/component: metrics
8{{- if .Values.customLabels }}
9{{ toYaml .Values.customLabels | indent 4 }}
10{{- end }}
11 {{- if or .Values.prometheus.service.annotations .Values.service.annotations .Values.customAnnotations }}
12 annotations:
13 {{- if .Values.prometheus.service.annotations }}
14 {{- toYaml .Values.prometheus.service.annotations | nindent 4 }}
15 {{- end }}
16 {{- if .Values.service.annotations }}
17 {{- toYaml .Values.service.annotations | nindent 4 }}
18 {{- end }}
19 {{- if .Values.customAnnotations }}
20 {{- toYaml .Values.customAnnotations | nindent 4 }}
21 {{- end }}
22 {{- end }}
23spec:
24 selector:
25 app.kubernetes.io/instance: {{ .Release.Name | quote }}
26 {{- if .Values.isClusterService }}
27 k8s-app: {{ template "coredns.k8sapplabel" . }}
28 {{- end }}
29 app.kubernetes.io/name: {{ template "coredns.name" . }}
30 ports:
31 - name: metrics
32 port: 9153
33 targetPort: 9153
34{{- end }}