kube-vip

Provides a lightweight virtual IP and load balancing solution for Kubernetes control planes and services, without requiring external load balancer infrastructure.

metallb, keepalived, haproxy, nginx-ingress

What is kube-vip?

The kube-vip image provides a self-contained solution for virtual IP management and load balancing inside Kubernetes clusters. It assigns a floating VIP to the Kubernetes API server (for high-availability control plane setups) and can also act as a service load balancer for LoadBalancer-type services in on-premises or bare-metal environments where a cloud provider load balancer is unavailable.

kube-vip uses ARP or BGP to advertise the VIP across the network and supports leader election via the Kubernetes API to ensure only one node holds the VIP at any given time. It is commonly used in kubeadm-provisioned clusters, k3s, and RKE deployments as a lightweight alternative to external solutions like MetalLB or hardware load balancers.

How to use this image

kube-vip can run as a static pod on control plane nodes or as a DaemonSet.

Generate a static pod manifest (control plane HA):

export VIP=192.168.1.100
export INTERFACE=eth0
docker run --network host --rm \
  ghcr.io/kube-vip/kube-vip:latest manifest pod \
  --interface $INTERFACE \
  --address $VIP \
  --controlplane \
  --arp \
  --leaderElection | tee /etc/kubernetes/manifests/kube-vip.yaml

Deploy as a DaemonSet for service load balancing:

kubectl apply -f https://kube-vip.io/manifests/rbac.yaml
docker run --network host --rm \
  ghcr.io/kube-vip/kube-vip:latest manifest daemonset \
  --interface $INTERFACE \
  --address $VIP \
  --inCluster \
  --taint \
  --controlplane \
  --arp \
  --leaderElection \
  --services | kubectl apply -f -

Annotate a LoadBalancer service to use a specific IP:

apiVersion: v1
kind: Service
metadata:
  name: my-service
  annotations:
    kube-vip.io/loadbalancerIPs: "192.168.1.101"
spec:
  type: LoadBalancer
  selector:
    app: my-app
  ports:
    - port: 80
      targetPort: 8080

Image variants

ghcr.io/kube-vip/kube-vip:latest

The latest stable release. Suitable for most bare-metal and on-premises Kubernetes deployments.

ghcr.io/kube-vip/kube-vip:<version>

Pinned version tags such as ghcr.io/kube-vip/kube-vip:v0.7.2. Recommended for production environments to avoid unexpected behavior changes during upgrades.

Interested in base images that start and stay clean?