V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
dirk41
V2EX  ›  程序员

[求助] k8s 的内的 container 无法连接外网

  •  
  •   dirk41 · 2017-10-26 19:24:38 +08:00 · 2217 次点击
    这是一个创建于 2380 天前的主题,其中的信息可能已经有所发展或是发生改变。

    通过 ip 可以但是域名不行

    有没有大神遇到类似问题的,请帮忙解答

    os@master:/data/jenkins$ kubectl exec -it jenkins-7fb9c8886f-d99qp bash
    jenkins@jenkins-7fb9c8886f-d99qp:/$ curl -I baidu.com
    curl: (6) Could not resolve host: baidu.com
    
    jenkins@jenkins-7fb9c8886f-d99qp:/$ curl -I 111.13.101.208
    HTTP/1.1 200 OK
    Date: Thu, 26 Oct 2017 11:23:41 GMT
    Server: Apache
    Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
    ETag: "51-47cf7e6ee8400"
    Accept-Ranges: bytes
    Content-Length: 81
    Cache-Control: max-age=86400
    Expires: Fri, 27 Oct 2017 11:23:41 GMT
    Connection: Keep-Alive
    Content-Type: text/html
    
    3 条回复    2017-10-27 15:07:45 +08:00
    goapi
        1
    goapi  
       2017-10-26 19:43:23 +08:00
    gwind
        2
    gwind  
       2017-10-27 10:03:56 +08:00
    临时测试
    echo "nameserver 8.8.8.8" > /etc/resolv.conf
    mritd
        3
    mritd  
       2017-10-27 15:07:45 +08:00
    k8s 上游 dns 设置有问题,检查 kubelet 设置 还有 kube-dns 组件状态
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   736 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 21:22 · PVG 05:22 · LAX 14:22 · JFK 17:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.