我启动了一个setup.template.name: "packets"
,它应该从本地注册表中提取。为什么docker会忽略kubernetes管理的本地DNS设置(jenkins-k8s-slave
和/etc/hosts
)?
当我这样做时:
/etc/resolv.conf
我得到:docker pull service.namespace.svc.cluster.local:5000/test:latest
但这可行:
dial tcp: lookup service.namespace.svc.cluster.local: no such host
curl https://service.namespace.svc.cluster.local:5000/v2/_catalog -k
答案 0 :(得分:1)
您将需要配置docker以使用您的dns,在这种情况下,似乎需要告诉docker使用kubernetes dns:
https://github.com/moby/moby/issues/23910
示例配置:
cat /etc/docker/daemon.json
{
"hosts": [ "unix:///var/run/docker.sock","tcp://0.0.0.0:2376"],
"live-restore": true,
"tls": true,
"tlscacert": "/etc/docker/ssl/ca.pem",
"tlscert": "/etc/docker/ssl/cert.pem",
"tlskey": "/etc/docker/ssl/key.pem",
"tlsverify": true,
"dns":["172.21.1.100","172.16.1.100"]
}