CoreDNS配置文件详解

2,987 阅读1分钟
.:53 {
    errors #错误记录到标准输出
    health {
       lameduck 5s #在http://localhost:8080/health处提供CoreDNS的健康报告
    }
    ready #在端口 8181 上提供的一个 HTTP 末端,当所有能够 表达自身就绪的插件都已就绪时,在此末端返回 200 OK
    kubernetes cluster.local in-addr.arpa ip6.arpCa { #CoreDNS 将基于 Kubernetes 的服务和 Pod 的 IP 答复 DNS 查询
       pods insecure
       fallthrough in-addr.arpa ip6.arpa
       ttl 30
    }
    prometheus :9153
    forward . /etc/resolv.conf #不在 Kubernetes 集群域内的任何查询都将转发到 预定义的解析器
    cache 30 #前端缓存
    loop #检测到简单的转发环,如果发现死循环,则中止 CoreDNS 进程
    reload #允许自动重新加载已更改的 Corefile
    loadbalance #这是一个轮转式 DNS 负载均衡器, 它在应答中随机分配 A、AAAA 和 MX 记录的顺序
}

kubernetes.io/zh/docs/tas…