metrics-svc.yaml 1.2 KB

123456789101112131415161718192021222324252627
  1. {{- /*
  2. Copyright Broadcom, Inc. All Rights Reserved.
  3. SPDX-License-Identifier: APACHE-2.0
  4. */}}
  5. {{- if .Values.metrics.enabled }}
  6. apiVersion: v1
  7. kind: Service
  8. metadata:
  9. name: {{ template "common.names.fullname" . }}-metrics
  10. namespace: {{ template "zookeeper.namespace" . }}
  11. labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
  12. app.kubernetes.io/component: metrics
  13. {{- if or .Values.metrics.service.annotations .Values.commonAnnotations }}
  14. {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.metrics.service.annotations .Values.commonAnnotations ) "context" . ) }}
  15. annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
  16. {{- end }}
  17. spec:
  18. type: {{ .Values.metrics.service.type }}
  19. ports:
  20. - name: http-metrics
  21. port: {{ .Values.metrics.service.port }}
  22. targetPort: metrics
  23. {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) }}
  24. selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
  25. app.kubernetes.io/component: zookeeper
  26. {{- end }}