gpt4 book ai didi

docker - nslookup无法在最新的busybox上获取服务ip

转载 作者:行者123 更新时间:2023-12-02 11:31:14 25 4
gpt4 key购买 nike

重现步骤:

  • kubectl run busybox1 --generator=run-pod/v1 --image=busybox:1.28 -- sleep 3600
  • kubectl run busybox2 --generator=run-pod/v1 --image=busybox:1.31.1 -- sleep 3600
  • kubectl exec -ti busybox1 -- nslookup kubernetes.default

  • 可以正常工作

    Server: 10.96.0.10

    Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local

    Name: kubernetes.default

    Address 1: 10.96.0.1 kubernetes.default.svc.cluster.local


  • kubectl exec -ti busybox2 -- nslookup kubernetes.default

  • 不起作用

    Server: 10.96.0.10 Address: 10.96.0.10:53

    ** server can't find kubernetes.default: NXDOMAIN

    *** Can't find kubernetes.default: No answer

    command terminated with exit code 1



    nslookup在1.31.1上的工作方式不同吗?

    在1.31.1上使用nslookup的正确方法是什么?

    最佳答案

    busybox内部的DNS仅在<= 1.28.4的图像中正常工作。

    修复版本image: "busybox:1.28.0"应该可以解决问题。

    https://github.com/kubernetes/kubernetes/issues/66924这里有一个线程

    关于docker - nslookup无法在最新的busybox上获取服务ip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59553941/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com