Skip to content

Commit

Permalink
Merge pull request #42 from guilhermevillote/main
Browse files Browse the repository at this point in the history
Add PodMonitor to Kube-Vip Helm Chart for Enhanced Metrics Collection
  • Loading branch information
thebsdbox authored Jan 15, 2025
2 parents 0fef7f9 + e37ca1e commit a5a6938
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
21 changes: 21 additions & 0 deletions charts/kube-vip/templates/pod-monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if and .Values.podMonitor.enabled (hasKey .Values.env "prometheus_server") (regexMatch "^:\\d+$" .Values.env.prometheus_server) }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ include "kube-vip.name" . }}
labels:
{{- include "kube-vip.selectorLabels" . | nindent 4 }}
{{- with .Values.podMonitor.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.podMonitor.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "kube-vip.selectorLabels" . | nindent 6 }}
podMetricsEndpoints:
- targetPort: {{ trimPrefix ":" .Values.env.prometheus_server }}
{{- end }}
7 changes: 6 additions & 1 deletion charts/kube-vip/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,9 @@ affinity: {}
# - key: node-role.kubernetes.io/control-plane
# operator: Exists

priorityClassName: ""
podMonitor:
enabled: false
labels: {}
annotations: {}

priorityClassName: ""

0 comments on commit a5a6938

Please sign in to comment.