• 请不要在回答技术问题时复制粘贴 AI 生成的内容
dirk41
V2EX  ›  程序员

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

  •  
  •   dirk41 · Oct 26, 2017 · 3054 views
    This topic created in 3155 days ago, the information mentioned may be changed or developed.

    通过 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 replies    2017-10-27 15:07:45 +08:00
    goapi
        1
    goapi  
       Oct 26, 2017
    gwind
        2
    gwind  
       Oct 27, 2017
    临时测试
    echo "nameserver 8.8.8.8" > /etc/resolv.conf
    mritd
        3
    mritd  
       Oct 27, 2017
    k8s 上游 dns 设置有问题,检查 kubelet 设置 还有 kube-dns 组件状态
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4174 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 05:28 · PVG 13:28 · LAX 22:28 · JFK 01:28
    ♥ Do have faith in what you're doing.