1.ack的hosts不會繼承宿主機(jī)的hosts,而工作中有一個(gè)域名默認(rèn)是走內(nèi)網(wǎng)解析,內(nèi)網(wǎng)被限制訪問了,只能在coreDNS中加一個(gè)hosts解析域名
2.編輯configmap (coredns)
kubectl edit configmap -n kube-system coredns
增加hosts節(jié)點(diǎn)文章來源:http://www.zghlxwxcb.cn/news/detail-848714.html
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
}
3.使用命令行添加過程中一直報(bào)錯(cuò)無法添加,后來通過圖形界面添加了文章來源地址http://www.zghlxwxcb.cn/news/detail-848714.html
.:53 {
errors
health :10260 {
lameduck 15s
}
ready
kubeapi
k8s_event {
level info error warning
}
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
ttl 30
fallthrough in-addr.arpa ip6.arpa
}
hosts {
47.106.191.109 osale.gemdale.com
fallthrough
}
prometheus :9153
forward . /etc/resolv.conf {
prefer_udp
}
cache 30
log
loop
reload
loadbalance
}
到了這里,關(guān)于k8s的coreDNS添加自定義hosts的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!