| Giorgi Lekveishvili | ec6b3cc | 2023-12-01 16:30:04 +0400 | [diff] [blame] | 1 | {{- if and .Values.deployment.enabled .Values.prometheus.service.enabled }} |
| 2 | apiVersion: v1 |
| 3 | kind: Service |
| 4 | metadata: |
| 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 }} |
| 23 | spec: |
| 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 }} |