Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIP address is incorrectly selected as the BGP IP address in the scenario that controlplane network configuration Keepalived. #5094

Closed
gongxiao2 opened this issue Nov 18, 2021 · 2 comments

Comments

@gongxiao2
Copy link

Use calico plugin as k8s controlplane network. k8s node start keepalived in controlplane and keepalived vip is in k8s node controlplane cidr, then keepalived master node has two ip in same cidr, as follow:

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:6f:1a:0e brd ff:ff:ff:ff:ff:ff
    inet 192.168.200.51/24 brd 192.168.200.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.200.59/32 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fe6f:1a0e/64 scope link
       valid_lft forever preferred_lft forever

We can see that eth0 has two IP addresses, "192.168.200.51/24" is k8s node controlplane ip and "192.168.200.59/32" is keepalived vip, the two ips have different netmask.
configure calico ip autodetection method:

kubectl set env daemonset/calico-node -n kube-system IP_AUTODETECTION_METHOD=cidr=192.168.200.0/24

Cailico can select VIP as the calico BGP protocol ip for unknow reason and causing the node calico network disconnect.

Expected Behavior

Calico choose node controlplane ip as BGP protocol ip in the scenario.

Current Behavior

Calico choose keepalived vip as BGP protocol ip in the scenario.

Possible Solution

fixup calico ip autodetection method.

Steps to Reproduce (for bugs)

  1. Install a multi-node K8S environment, such as 2 master + 1 etcd + 1 worker.
  2. k8s controlplane start keepalived.
  3. ifdown/ifup node controlplane port, example "ifdown eth0;ifup eth0"
  4. In normal scenarios, the K8S node uses controlplane ip as the calico BGP protocol ip, but calico may also choose VIP address as calico BGP protocol ip.

Context

This issue may cause the node calico network disconnect.

Your Environment

  • Calico version
    calico v3.17.2
  • Orchestrator version (e.g. kubernetes, mesos, rkt):
    k8s version: 1.20.6
  • Operating System and version:
    centos7
  • Link to your project (optional):
@caseydavenport
Copy link
Member

I think this is a duplicate of #4870, which has a PR in progress to add an autodetection method based on k8s node IP.

@Lzhang-hub
Copy link

Thw new method can be used in which veriosn ?
And use like follow?
IP_AUTODETECTION_METHOD=KubernetesInternalIP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants