Files
kubespray/docs/ingress/kube-vip.md
Sumit Solanki 7fd29b5529 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.
2026-05-19 11:15:02 +05:30

3.0 KiB

kube-vip

kube-vip provides Kubernetes clusters with a virtual IP and load balancer for both the control plane (for building a highly-available cluster) and Kubernetes Services of type LoadBalancer without relying on any external hardware or software.

Prerequisites

You have to configure kube_proxy_strict_arp when the kube_proxy_mode is ipvs and kube-vip ARP is enabled.

kube_proxy_strict_arp: true

Install

You have to explicitly enable the kube-vip extension:

kube_vip_enabled: true

You also need to enable kube-vip as HA, Load Balancer, or both:

# HA for control-plane, requires a VIP
kube_vip_controlplane_enabled: true
kube_vip_address: 10.42.42.42
loadbalancer_apiserver:
  address: "{{ kube_vip_address }}"
  port: 6443
# kube_vip_interface: ens160

# LoadBalancer for services
kube_vip_services_enabled: false
# kube_vip_services_interface: ens320

Note: When using kube-vip as LoadBalancer for services, additional manual steps are needed.

If using local traffic policy:

kube_vip_enableServicesElection: true

If using ARP mode :

kube_vip_arp_enabled: true

If using BGP mode :

kube_vip_bgp_enabled: true
kube_vip_local_as: 65000
kube_vip_bgp_routerid: 192.168.0.2
kube_vip_bgppeers:
- 192.168.0.10:65000::false
- 192.168.0.11:65000::false
# kube_vip_bgp_peeraddress:
# kube_vip_bgp_peerpass:
# kube_vip_bgp_peeras:
# kube_vip_bgp_sourceip:
# kube_vip_bgp_sourceif:

If using control plane load-balancing:

kube_vip_lb_enable: true

In addition, load-balancing method could be changed:

kube_vip_lb_fwdmethod: masquerade

If you want to adjust the parameters of kube-vip LeaderElection:

kube_vip_leaseduration: 30
kube_vip_renewdeadline: 20
kube_vip_retryperiod: 4

To expose Prometheus metrics 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). 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.

kube_vip_metrics_enabled: true
# kube_vip_metrics_port: 2112