metrics-svc.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. {{- if .Values.metrics.enabled }}
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. name: {{ printf "%s-metrics" (include "postgresql.primary.fullname" .) }}
  6. namespace: {{ .Release.Namespace | quote }}
  7. labels: {{- include "common.labels.standard" . | nindent 4 }}
  8. app.kubernetes.io/component: metrics
  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: primary
  31. {{- end }}