Oleksandr Kozachenko | b009349 | 2023-09-06 21:43:47 +0200 | [diff] [blame] | 1 | {{- /* |
| 2 | Copyright VMware, Inc. |
| 3 | SPDX-License-Identifier: APACHE-2.0 |
| 4 | */}} |
| 5 | |
| 6 | {{- if .Values.metrics.enabled }} |
| 7 | apiVersion: v1 |
| 8 | kind: Service |
| 9 | metadata: |
| 10 | name: {{ printf "%s-metrics" (include "common.names.fullname" .) }} |
| 11 | namespace: {{ include "common.names.namespace" . | quote }} |
| 12 | labels: {{- include "common.labels.standard" . | nindent 4 }} |
| 13 | app.kubernetes.io/component: metrics |
| 14 | {{- if .Values.commonLabels }} |
| 15 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} |
| 16 | {{- end }} |
| 17 | {{- if or .Values.metrics.service.annotations .Values.commonAnnotations }} |
| 18 | annotations: |
| 19 | {{- if .Values.metrics.service.annotations }} |
| 20 | {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.service.annotations "context" $ ) | nindent 4 }} |
| 21 | {{- end }} |
| 22 | {{- if .Values.commonAnnotations }} |
| 23 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} |
| 24 | {{- end }} |
| 25 | {{- end }} |
| 26 | spec: |
| 27 | type: ClusterIP |
| 28 | ports: |
| 29 | - name: http |
| 30 | port: {{ coalesce .Values.metrics.service.ports.http .Values.metrics.service.port }} |
| 31 | protocol: TCP |
| 32 | targetPort: http |
| 33 | selector: {{- include "common.labels.matchLabels" . | nindent 4 }} |
| 34 | app.kubernetes.io/component: keycloak |
| 35 | {{- end }} |