0

我正在探索 kube-vip,遵循 doc => https://kube-vip.io/control-plane/进行多主 (HA) 集群设置

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

我一直在尝试执行 kubeadm init,但它总是有原因超时kubelet unhealthy

在进一步调试时,我发现一个 kubevip 容器失败并显示以下消息:

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"

我对 BGP 协议进行了相同的尝试(在 docker run 中使用 --bgp 选项),这导致我出现不同的错误

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"

这些错误提示什么?

4

1 回答 1

3

您缺少将--controlplanekube-vip 管理器作为控制平面启动的标志。否则它将尝试连接到另一个不存在的控制平面。

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

如果这不能解决您的问题,请提高日志级别--log 5

于 2022-02-14T05:25:12.803 回答