内容简介:先来看看默认的CoreDns的配置文件有些服务不在kubernetes内部,在内部环境内需要通过dns去访问,名称后缀为完整的配置文件
先来看看默认的CoreDns的配置文件
Corefile: |
.:53 {
errors
health
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
upstream
fallthrough in-addr.arpa ip6.arpa
}
prometheus :9153
forward . /etc/resolv.conf
cache 30
loop
reload
loadbalance
}
- error: 错误记录到stdout
- health :CoreDNS的运行状况报告为 http:// localhost:8080 / health
- kubernetes :CoreDNS将根据Kubernetes服务和pod的IP回复DNS查询
- prometheus :CoreDNS的度量标准可以在 http://localhost:9153/ Prometheus格式的 指标 中找到
- proxy :任何不在Kubernetes集群域内的查询都将转发到预定义的解析器(/etc/resolv.conf)
- cache :启用前端缓存
- loop :检测简单的转发循环,如果找到循环则停止CoreDNS进程
- reload :允许自动重新加载已更改的Corefile。编辑ConfigMap配置后,请等待两分钟以使更改生效
- loadbalance :这是一个循环DNS负载均衡器,可以在答案中随机化A,AAAA和MX记录的顺序
配置外部dns
有些服务不在kubernetes内部,在内部环境内需要通过dns去访问,名称后缀为 carey.com
carey:53 {
errors
cache 30
proxy . 10.150.0.1
}
完整的配置文件
Corefile: |
.:53 {
errors
health
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
upstream
fallthrough in-addr.arpa ip6.arpa
}
prometheus :9153
forward . /etc/resolv.conf
cache 30
loop
reload
loadbalance
}
carey.com:53 {
errors
cache 30
proxy . 10.150.0.1
}
参考文档: https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/#coredns
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:- SmartSql使用教程(4)——多库配置与使用
- rsync配置使用简要说明
- 使用shadowtunnel配置多级代理
- 使用Maven配置Spring
- 使用go读取配置文件
- 使用 Spell 实践深度学习,几乎零配置开始使用
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Persuasive Technology
B.J. Fogg / Morgan Kaufmann / 2002-12 / USD 39.95
Can computers change what you think and do? Can they motivate you to stop smoking, persuade you to buy insurance, or convince you to join the Army? "Yes, they can," says Dr. B.J. Fogg, directo......一起来看看 《Persuasive Technology》 这本书的介绍吧!