Skip to content

Commit

Permalink
Merge pull request #60 from Headorteil/main
Browse files Browse the repository at this point in the history
PodMonitor: use port instead of targetPort
  • Loading branch information
thebsdbox authored Jan 28, 2025
2 parents 5a58b7d + 50d7a03 commit 24a6dee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions charts/kube-vip/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if and .Values.podMonitor.enabled (hasKey .Values.env "prometheus_server") (regexMatch "^:\\d+$" .Values.env.prometheus_server) }}
ports:
- containerPort: {{ trimPrefix ":" .Values.env.prometheus_server }}
name: monitoring
protocol: TCP
{{- end }}
env:
{{- if eq (include "kube-vip.toBool" .Values.env.cp_enable) "true" }}
- name: vip_address
Expand Down
2 changes: 1 addition & 1 deletion charts/kube-vip/templates/pod-monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ spec:
matchLabels:
{{- include "kube-vip.selectorLabels" . | nindent 6 }}
podMetricsEndpoints:
- targetPort: {{ trimPrefix ":" .Values.env.prometheus_server }}
- port: monitoring
{{- end }}
1 change: 1 addition & 0 deletions charts/kube-vip/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env:
svc_enable: "true"
svc_election: "false"
vip_leaderelection: "false"
# prometheus_server: ":2112"

extraArgs: {}
# Specify additional arguments to kube-vip
Expand Down

0 comments on commit 24a6dee

Please sign in to comment.