简体   繁体   English

无法使用 master/worker IP 连接到 k8s 集群

[英]Unable to connect to k8s cluster using master/worker IP

I am trying to install a Kubernetes cluster with one master node and two worker nodes.我正在尝试安装一个具有一个主节点和两个工作节点的 Kubernetes 集群。

I acquired 3 VMs for this purpose running on Ubuntu 21.10.为此,我购买了 3 个在 Ubuntu 21.10 上运行的 VM。 In the master node, I installed kubeadm:1.21.4 , kubectl:1.21.4 , kubelet:1.21.4 and docker-ce:20.4 .在主节点中,我安装了kubeadm:1.21.4kubectl:1.21.4kubelet:1.21.4和 docker docker-ce:20.4

I followed this guide to install the cluster.我按照本指南安装集群。 The only difference was in my init command where I did not mention the --control-plane-endpoint .唯一的区别是在我的 init 命令中我没有提到--control-plane-endpoint I used calico CNI v3.19.1 and docker for CRI Runtime.我将 calico CNI v3.19.1和 docker 用于 CRI 运行时。

After I installed the cluster, I deployed minio pod and exposed it as a NodePort.安装集群后,我部署了 minio pod 并将其公开为 NodePort。 The pod got deployed in the worker node ( 10.72.12.52 ) and my master node IP is 10.72.12.51 ). pod 部署在工作节点( 10.72.12.52 )中,我的主节点 IP 是10.72.12.51 )。 For the first two hours, I am able to access the login page via all three IPs ( 10.72.12.51:30981 , 10.72.12.52:30981 , 10.72.13.53:30981 ).在前两个小时,我可以通过所有三个 IP( 10.72.12.51:3098110.72.12.52:3098110.72.13.53:30981 )访问登录页面。 However, after two hours, I lost access to the service via 10.72.12.51:30981 and 10.72.13.53:30981 .但是,两个小时后,我无法通过10.72.12.51:3098110.72.13.53:30981访问该服务。 Now I am only able to access the service from the node on which it is running ( 10.72.12.52 ).现在我只能从运行它的节点( 10.72.12.52 )访问该服务。

I have disabled the firewall and added calico.conf file inside /etc/NetworkManager/conf.d with the following content:我已禁用防火墙并在/etc/NetworkManager/conf.d中添加了calico.conf文件,其中包含以下内容:

[keyfile]
unmanaged-devices=interface-name:cali*;interface-name:tunl*;interface-name:vxlan.calico

What am I missing in the setup that might cause this issue?我在设置中缺少什么可能导致此问题?

This is a community wiki answer posted for better visibility.这是为更好的可见性而发布的社区 wiki 答案。 Feel free to expand it.随意扩展它。

As mentioned by @AbhinavSharma the problem was solved by switching from Calico to Flannel CNI.正如@AbhinavSharma 所提到的,问题是通过从 Calico 切换到 Flannel CNI 来解决的。

More information regarding Flannel itself can be found here .更多关于法兰绒本身的信息可以在这里找到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM