Files
devops-infra-helm-charts-gcp/helm-templates/athens-proxy/templates/service-monitor.yaml
T
2026-08-26 03:39:42 +05:30

42 lines
1.2 KiB
YAML

{{- if .Values.metrics.serviceMonitor.enabled }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
{{- $metaLabels := include "athens.metaLabels" . | fromYaml }}
{{- $userLabels := .Values.metrics.serviceMonitor.labels | default dict }}
{{- $mergedLabels := merge $userLabels $metaLabels }}
{{- range $key, $value := $mergedLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ template "fullname" . }}
{{- if .Values.metrics.serviceMonitor.namespace }}
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
{{- end }}
spec:
endpoints:
- path: /metrics
port: http
{{- if .Values.basicAuth.enabled }}
basicAuth:
password:
name: {{ .Values.basicAuth.secretName }}
key: {{ .Values.basicAuth.passwordSecretKey }}
username:
name: {{ .Values.basicAuth.secretName }}
key: {{ .Values.basicAuth.usernameSecretKey }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
app: {{ template "fullname" . }}
release: "{{ .Release.Name }}"
{{- end }}