【K8S】基于coredns配置自定义域名类似配置HOST

 

配置步骤

集群(system)-资源(配置映射)-名称空间kube-system(coredns)

1)进入集群(system)

2)选择资源(配置映射)

3)找到名称空间kube-system下的coredns

4)对coredns进行编辑-添加host

.:53 {
    errors
    health
    ready
    kubernetes cluster.local in-addr.arpa ip6.arpa {
      pods insecure
      fallthrough in-addr.arpa ip6.arpa
    }
    prometheus :9153
    hosts {
        10.211.55.24 gitlab.zbq.com
        10.211.55.19 harbor.zbq.com
        fallthrough
    }
    forward . "/etc/resolv.conf"
    cache 30
    loop
    reload
    loadbalance
}

 

posted @ 2020-10-25 23:08  N!CE波  阅读(1537)  评论(0编辑  收藏  举报