1、关于coreDNS和公司内部dns打通问题
1.1 修改ConfigMap
---
apiVersion: v1
data:
Corefile: |
.:53 {
errors
health {
lameduck 5s
}
ready
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
fallthrough in-addr.arpa ip6.arpa
ttl 30
}
prometheus :9153
#注释代码
#forward . /etc/resolv.conf {
# max_concurrent 1000
#}
#此处是公司内部的dns地址
forward . 192.168.0.253 192.168.0.254 {
prefer_udp
}
cache 30
loop
reload
loadbalance
}
kind: ConfigMap
metadata:
name: coredns
namespace: kube-system
1.2 批量执行yaml
for i in $(ls ./); do cd ./$i && kubectl apply -f . && cd .. ; done
for i in $(ls ./); do cd ./$i && kubectl delete -f . && cd .. ; done
kubectl apply -f .
kubectl delete -f .