2022-08-12 04:20:19 -04:00
|
|
|
{{- if and .Values.agent (not .Values.preflight.enabled) .Values.prometheus.enabled .Values.prometheus.serviceMonitor.enabled }}
|
|
|
|
---
|
|
|
|
apiVersion: monitoring.coreos.com/v1
|
|
|
|
kind: ServiceMonitor
|
|
|
|
metadata:
|
|
|
|
name: cilium-agent
|
|
|
|
namespace: {{ .Values.prometheus.serviceMonitor.namespace | default .Release.Namespace }}
|
|
|
|
labels:
|
2023-10-16 13:14:53 -04:00
|
|
|
app.kubernetes.io/part-of: cilium
|
2022-08-12 04:20:19 -04:00
|
|
|
{{- with .Values.prometheus.serviceMonitor.labels }}
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
2023-10-16 13:14:53 -04:00
|
|
|
{{- if or .Values.prometheus.serviceMonitor.annotations .Values.annotations }}
|
2022-08-12 04:20:19 -04:00
|
|
|
annotations:
|
2023-10-16 13:14:53 -04:00
|
|
|
{{- with .Values.annotations }}
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
2022-08-12 04:20:19 -04:00
|
|
|
{{- with .Values.prometheus.serviceMonitor.annotations }}
|
2023-10-16 13:14:53 -04:00
|
|
|
{{- toYaml . | nindent 4 }}
|
2022-08-12 04:20:19 -04:00
|
|
|
{{- end }}
|
2023-10-16 13:14:53 -04:00
|
|
|
{{- end }}
|
2022-08-12 04:20:19 -04:00
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
k8s-app: cilium
|
|
|
|
namespaceSelector:
|
|
|
|
matchNames:
|
|
|
|
- {{ .Release.Namespace }}
|
|
|
|
endpoints:
|
|
|
|
- port: metrics
|
2023-10-16 13:14:53 -04:00
|
|
|
interval: {{ .Values.prometheus.serviceMonitor.interval | quote }}
|
2022-08-12 04:20:19 -04:00
|
|
|
honorLabels: true
|
|
|
|
path: /metrics
|
2023-10-16 13:14:53 -04:00
|
|
|
{{- with .Values.prometheus.serviceMonitor.relabelings }}
|
|
|
|
relabelings:
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.prometheus.serviceMonitor.metricRelabelings }}
|
|
|
|
metricRelabelings:
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
2022-08-12 04:20:19 -04:00
|
|
|
targetLabels:
|
|
|
|
- k8s-app
|
2023-10-16 13:14:53 -04:00
|
|
|
{{- if .Values.prometheus.serviceMonitor.jobLabel }}
|
|
|
|
jobLabel: {{ .Values.prometheus.serviceMonitor.jobLabel | quote }}
|
|
|
|
{{- end }}
|
2022-08-12 04:20:19 -04:00
|
|
|
{{- end }}
|