J release changes
[ric-plt/ric-dep.git] / helm / infrastructure / subcharts / kong / charts / postgresql / templates / read / metrics-svc.yaml
1 {{- if and .Values.metrics.enabled (eq .Values.architecture "replication") }}
2 apiVersion: v1
3 kind: Service
4 metadata:
5   name: {{ printf "%s-metrics" (include "postgresql.readReplica.fullname" .) }}
6   namespace: {{ .Release.Namespace | quote }}
7   labels: {{- include "common.labels.standard" . | nindent 4 }}
8     app.kubernetes.io/component: metrics-read
9     {{- if .Values.commonLabels }}
10     {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
11     {{- end }}
12   annotations:
13     {{- if .Values.commonAnnotations }}
14     {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
15     {{- end }}
16     {{- if .Values.metrics.service.annotations }}
17     {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.service.annotations "context" $ ) | nindent 4 }}
18     {{- end }}
19 spec:
20   type: ClusterIP
21   sessionAffinity: {{ .Values.metrics.service.sessionAffinity }}
22   {{- if .Values.metrics.service.clusterIP }}
23   clusterIP: {{ .Values.metrics.service.clusterIP }}
24   {{- end }}
25   ports:
26     - name: http-metrics
27       port: {{ .Values.metrics.service.ports.metrics }}
28       targetPort: http-metrics
29   selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
30     app.kubernetes.io/component: read
31 {{- end }}