kube-vip
kube-vip copied to clipboard
Can't handle loadBalancerIP change
Describe the bug When change loadBalancerIP of a service, VIP not get reassigned.
To Reproduce Steps to reproduce the behavior:
- create a deployment of nginx.
- create service/http1 for that nginx, with type: LoadBalancer and loadBalancerIP: 192.168.0.128
- curl http://192.168.0.128/ return normal contents.
- change loadBalancerIP of service/http1 to 192.168.0.126
- curl http://192.168.0.126/ Connection refused
- delete service/http1 and recreate it with type: LoadBalancer and loadBalancerIP: 192.168.0.126
- 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
I need this feature too.
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