Kubernetes pod 仅在部署在 4 个节点中的 2 个节点上时才有效

时间:2021-06-26 05:50:49

标签: linux ubuntu kubernetes ubuntu-20.04

我有一个由 4 个 Raspberry Pi 组成的集群,运行 ubuntu 20.04,我已经安装了 Microk8s 并在其上创建了一个 Kubernetes 集群。在 4 个节点中的 2 个节点上部署 pod 时,我似乎遇到了一些网络问题。

我创建了一个 Nginx Pod 守护进程集,如果我 exec 进入 Node-01 或 Node-04 上的 Pod 并运行 apt update,我得到:

root@nginx-deployment-wh72m:/# apt update
Hit:1 http://security.debian.org/debian-security stretch/updates InRelease
Ign:2 http://deb.debian.org/debian stretch InRelease        
Hit:3 http://deb.debian.org/debian stretch-updates InRelease
Hit:4 http://deb.debian.org/debian stretch Release
Reading package lists... Done
Building dependency tree       
Reading state information... Done
31 packages can be upgraded. Run 'apt list --upgradable' to see them.

但是,如果我在 Node-02 或 Node-03 上的 pod 中运行相同的命令,我会得到:

root@nginx-deployment-bd9kn:/# apt update
Err:1 http://deb.debian.org/debian stretch InRelease
  Temporary failure resolving 'deb.debian.org'
Err:2 http://security.debian.org/debian-security stretch/updates InRelease
  Temporary failure resolving 'security.debian.org'
Err:3 http://deb.debian.org/debian stretch-updates InRelease
  Temporary failure resolving 'deb.debian.org'
Reading package lists... Done    
Building dependency tree
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://deb.debian.org/debian/dists/stretch/InRelease  Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/InRelease  Temporary failure resolving 'security.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/InRelease  Temporary failure resolving 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

所有节点都是使用相同的过程安装的。我还可以在所有节点上运行 apt update

0 个答案:

没有答案