service.yaml 947 B

1234567891011121314151617181920212223242526272829303132
  1. {{- if or .Values.prometheus.enabled .Values.metrics.service.enabled }}
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. name: {{ include "external-secrets.fullname" . }}-metrics
  6. namespace: {{ .Release.Namespace | quote }}
  7. labels:
  8. {{- include "external-secrets.labels" . | nindent 4 }}
  9. {{- if .Values.prometheus.enabled }}
  10. annotations:
  11. prometheus.io/path: "/metrics"
  12. prometheus.io/scrape: "true"
  13. prometheus.io/port: {{ .Values.prometheus.service.port | quote }}
  14. {{- else }}
  15. {{- with .Values.metrics.service.annotations }}
  16. annotations:
  17. {{- toYaml . | nindent 4 }}
  18. {{- end }}
  19. {{- end }}
  20. spec:
  21. type: ClusterIP
  22. ports:
  23. {{- if .Values.prometheus.enabled }}
  24. - port: {{ .Values.prometheus.service.port }}
  25. {{- else }}
  26. - port: {{ .Values.metrics.service.port }}
  27. {{- end }}
  28. protocol: TCP
  29. name: metrics
  30. selector:
  31. {{- include "external-secrets.selectorLabels" . | nindent 4 }}
  32. {{- end }}