mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-05-22 04:42:54 +03:00
kube-vip: optional Prometheus metrics (default port 2112) (#13229)
Add kube_vip_metrics_enabled and kube_vip_metrics_port; wire prometheus_server and container port in the static pod manifest. Default metrics port to 2112 to match kube-vip upstream. Document and sample inventory updated.
This commit is contained in:
@@ -86,3 +86,12 @@ kube_vip_leaseduration: 30
|
||||
kube_vip_renewdeadline: 20
|
||||
kube_vip_retryperiod: 4
|
||||
```
|
||||
|
||||
To expose [Prometheus metrics](https://kube-vip.io/docs/installation/flags/#environment-variables) from the kube-vip static pod, set `kube_vip_metrics_enabled`. `kube_vip_metrics_port` is an integer; the manifest sets `prometheus_server` to `:PORT` because kube-vip passes that value to Go's HTTP listen address (see [`servePrometheusHTTPServer` in kube-vip](https://github.com/kube-vip/kube-vip/blob/main/cmd/kube-vip.go)). The manifest `ports` entry uses the same number for tooling that reads the pod spec.
|
||||
|
||||
Kubespray defaults `kube_vip_metrics_port` to `2112`, matching upstream kube-vip's `--prometheusHTTPServer` default. Override it if your scrape config expects another port.
|
||||
|
||||
```yaml
|
||||
kube_vip_metrics_enabled: true
|
||||
# kube_vip_metrics_port: 2112
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user