Files
cloud-configuration/helm/template/templates/_podmonitor.yaml
T
2023-11-08 09:38:09 +01:00

25 lines
842 B
YAML

{{- define "template.podmonitor" -}}
{{- if and .Values.prometheus.enabled .Values.prometheus.useCRDs .Values.application.isSpring }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ include "template.fullname" . }}
namespace: {{ tpl (quote .Values.prometheus.namespace) . | default "observability" }}
labels:
{{- include "template.labels" . | nindent 4 }}
release: {{ .Values.prometheus.releaseName | quote | default "prometheus" }}
annotations:
{{- include "template.annotations" . | nindent 4 }}
spec:
podMetricsEndpoints:
- port: "{{ .Values.application.actuatorPort }}"
path: /actuator/prometheus
namespaceSelector:
matchNames:
- "{{ .Release.Namespace }}"
selector:
matchLabels:
{{- include "template.selectorLabels" . | nindent 6 }}
{{- end }}
{{- end }}