0

我无法更新通过 k8s 上的 helms 部署的 Jenkins 中的插件。获取“检查更新站点时出错:UnknownHostException:updates.jenkins.io”

jenkins@k8s-worker1:/$ cat /etc/resolv.conf
search jenkins.svc.cluster.local svc.cluster.local cluster.local mydomain.org
nameserver 10.96.0.10
options ndots:5

jenkins@k8s-worker1:/$ cat /etc/hosts
# Kubernetes-managed hosts file (host network).
127.0.0.1 localhost
127.0.1.1 k8s-worker1

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

jenkins@k8s-worker1:/$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=17.5 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=117 time=10.3 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=117 time=10.2 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 10.293/12.738/17.569/3.417 ms

jenkins@k8s-worker1:/$ ping google.com
ping: google.com: Temporary failure in name resolution
4

1 回答 1

0

从您的帖子中不清楚确切的问题是什么。是不是突然无法解析google.com?

一些信息在这里: https ://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/

您基本上想验证您的主服务器 jenkins pod(可能会进行该查找)是否能够解析名称。

如果 dnsPolicy 是 Clusterfirst 或 ClusterfirstWithHostnet,则主机文件看起来不错。这取决于您的设置和配置。

有关故障排除的更多信息: https ://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/

您可以在 de 部署中注入您自己的 DNS 配置或检查您拥有的任何 VPC 网络设置。祝你好运,如果您发现确切的问题,请发布。

于 2021-02-28T11:55:09.043 回答