我运行牧场主在centos与主节点是同一台机器。我可以做的一切,但当我试图“apt-get update”内的吊舱,我得到:
Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
问题出在Centos的防火墙里,因为当我关闭防火墙的时候,我可以在pod里面上网。我已经添加了link提供的端口。但是我仍然不能上网。有没有其他方法可以不关闭Centos的防火墙呢?
我用的是Centos 8和Rancher 2。
1条答案
按热度按时间falq053o1#
我能够解决这个问题。问题是Docker无法解析容器内的DNS查询。解决方法是,首先添加ports,然后执行以下命令: