metrics-svc.yaml 1.1 KB

1234567891011121314151617181920212223242526272829
  1. {{- if .Values.metrics.enabled }}
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. name: {{ printf "%s-metrics" (include "common.names.fullname" .) }}
  6. namespace: {{ include "common.names.namespace" . | quote }}
  7. labels: {{- include "common.labels.standard" . | nindent 4 }}
  8. {{- if .Values.commonLabels }}
  9. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  10. {{- end }}
  11. app.kubernetes.io/component: metrics
  12. {{- if or .Values.metrics.service.annotations .Values.commonAnnotations }}
  13. annotations:
  14. {{- if .Values.metrics.service.annotations }}
  15. {{- include "common.tplvalues.render" (dict "value" .Values.metrics.service.annotations "context" $) | nindent 4 }}
  16. {{- end }}
  17. {{- if .Values.commonAnnotations }}
  18. {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  19. {{- end }}
  20. {{- end }}
  21. spec:
  22. type: {{ .Values.metrics.service.type }}
  23. ports:
  24. - port: {{ .Values.metrics.service.port }}
  25. targetPort: metrics
  26. protocol: TCP
  27. name: metrics
  28. selector: {{- include "common.labels.matchLabels" $ | nindent 4 }}
  29. {{- end }}