Kube-VIP 找不到命名空间
Kube-VIP unable to find Namespace
我正在探索 kube-vip,遵循文档 => 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 运行 中的 --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"
这些错误提示是什么?
您缺少 --controlplane
标志来启动 kube-vip 管理器作为控制平面。否则它将尝试连接到另一个 non-existing 控制平面。
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
。
我正在探索 kube-vip,遵循文档 => 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 运行 中的 --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"
这些错误提示是什么?
您缺少 --controlplane
标志来启动 kube-vip 管理器作为控制平面。否则它将尝试连接到另一个 non-existing 控制平面。
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
。