coreDNS添加自定义hosts

编辑configmap (coredns)

kubectl edit configmap -n kube-system coredns  

增加hosts节点

  Corefile: |
    .:53 {
        errors
        health {
          lameduck 5s
        }
        ready
        kubernetes cluster.local in-addr.arpa ip6.arpa {
          pods insecure
          fallthrough in-addr.arpa ip6.arpa
        }
        hosts {
            192.168.11.241     www.girls.cn
            192.168.11.240     harbor.girls.cn
            fallthrough
        }
        prometheus :9153
        forward . "/etc/resolv.conf"
        cache 30
        loop
        reload
        loadbalance
    }

你可能感兴趣的:(容器化)