Home > Mobile >  Kube-VIP unable to find Namespace
Kube-VIP unable to find Namespace

Time:02-15

I am exploring the kube-vip, following the doc => https://kube-vip.io/control-plane/ for a multi-master (HA) cluster setup

sudo docker run --network host --rm ghcr.io/kube-vip/kube-vip:main manifest pod \
--vip 192.168.0.75 \
--arp \
--leaderElection | sudo tee /etc/kubernetes/manifests/vip.yaml

sudo kubeadm init --kubernetes-version 1.17.0 --control-plane-endpoint 192.168.0.75 --upload-certs

I have been trying to perform kubeadm init but it always times out with a reason kubelet unhealthy

On further debugging, I found that one kubevip container is failing with the message :

time="2022-02-11T06:21:54Z" level=info msg="No interface is specified for VIP in config, auto-detecting default Interface"
time="2022-02-11T06:21:54Z" level=info msg="kube-vip will bind to interface [eth0]"
time="2022-02-11T06:21:54Z" level=info msg="server started"
time="2022-02-11T06:21:54Z" level=info msg="Starting Kube-vip Manager with the ARP engine"
time="2022-02-11T06:21:54Z" level=info msg="Namespace [kube-system], Hybrid mode [false]"
time="2022-02-11T06:21:54Z" level=fatal msg="starting new Manager error -> unable to find Namespace"

I tried the same with BGP protocol (using the --bgp option in docker run), which leads me to a different error

time="2022-02-12T07:35:33Z" level=info msg="No interface is specified for VIP in config, auto-detecting default Interface"
time="2022-02-12T07:35:33Z" level=info msg="kube-vip will bind to interface [eth0]"
time="2022-02-12T07:35:33Z" level=info msg="server started"
time="2022-02-12T07:35:33Z" level=info msg="Starting Kube-vip Manager with the BGP engine"
time="2022-02-12T07:35:33Z" level=info msg="Namespace [kube-system], Hybrid mode [false]"
time="2022-02-12T07:35:33Z" level=info msg="Starting the BGP server to advertise VIP routes to BGP peers"
time="2022-02-12T07:35:33Z" level=fatal msg="starting new Manager error -> You need to provide at least one peer"

What is these error suggesting ?

CodePudding user response:

You are missing the --controlplane flag to start the kube-vip manager as the control plane. Otherwise it will try to connect to another non-existing control plane.

sudo docker run --network host --rm ghcr.io/kube-vip/kube-vip:main manifest pod \
--vip 192.168.0.75 \
--arp \
--controlplane \
--leaderElection | sudo tee /etc/kubernetes/manifests/vip.yaml

If this doesn't resolve you issue please increase the log level --log 5.

  • Related