kube-vip icon indicating copy to clipboard operation
kube-vip copied to clipboard

Can't handle loadBalancerIP change

Open ouyangde opened this issue 1 year ago • 2 comments

Describe the bug When change loadBalancerIP of a service, VIP not get reassigned.

To Reproduce Steps to reproduce the behavior:

  1. create a deployment of nginx.
  2. create service/http1 for that nginx, with type: LoadBalancer and loadBalancerIP: 192.168.0.128
  3. curl http://192.168.0.128/ return normal contents.
  4. change loadBalancerIP of service/http1 to 192.168.0.126
  5. curl http://192.168.0.126/ Connection refused
  6. delete service/http1 and recreate it with type: LoadBalancer and loadBalancerIP: 192.168.0.126
  7. curl http://192.168.0.126/ return normal contents.

Expected behavior step 5 should return normal contents.

Environment (please complete the following information):

  • OS/Distro: [e.g. Centoos 7.8]
  • Kubernetes Version: [e.g. v.1.23]
  • Kube-vip Version: [e.g. 0.5.12]

Kube-vip.yaml: spec: containers:

  • args:
    • manager env:
    • name: vip_arp value: "true"
    • name: port value: "6443"
    • name: vip_interface value: eth1
    • name: vip_cidr value: "32"
    • name : lb_enable value: "true"
    • name : lb_port value: "6443"
    • name: lb_fwdmethod value: local
    • name: cp_enable value: "true"
    • name: cp_namespace value: kube-system
    • name: vip_ddns value: "false"
    • name: svc_enable value: "true"
    • name: svc_election value: "true"
    • name: vip_leaderelection value: "true"
    • name: vip_leaseduration value: "5"
    • name: vip_renewdeadline value: "3"
    • name: vip_retryperiod value: "1"
    • name: address value: 192.168.0.100
    • name: prometheus_server value: :2112

Additional context kube-vip deploy method: static pods number of kube-vip instance: 3

ouyangde avatar May 27 '23 11:05 ouyangde

I need this feature too.

todaygood avatar Jun 02 '23 22:06 todaygood

It's already supported. But for new kube-vip you need to modify the Annotation kube-vip.io/loadbalancerIPs now, not the spec.loadBalancer. Since the spec.loadBalancer was deprecated in k8s 1.24

metadata:
  annotations:
    kube-vip.io/loadbalancerIPs: 10.92.96.194

lubronzhan avatar Jul 25 '23 04:07 lubronzhan