coredns自定义的解析记录
- coredns
- 2024-08-04
- 50热度
- 0评论
找到kube-system命名空间的名称为coredns的configmap:
kubectl get configmap coredns -n kube-system
NAME DATA AGE
coredns 1 9d
编辑这个configmap:
kubectl edit configmap coredns -n kube-system
apiVersion: v1
data:
Corefile: |
.:53 {
errors
health
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
upstream
fallthrough in-addr.arpa ip6.arpa
ttl 30
}
hosts {
10.0.0.22 cos6-data1.test.alltest.com
10.0.0.23 cos6-data2.test.alltest.com
10.0.0.24 cos6-data3.test.alltest.com
10.0.0.25 cos6-data4.test.alltest.com
10.0.0.26 cos6-data5.test.alltest.com
10.0.0.41 cos6-datanode6.test.alltest.com
10.0.0.42 cos6-datanode7.test.alltest.com
10.0.0.43 cos6-datanode8.test.alltest.com
10.0.0.44 cos6-datanode9.test.alltest.com
}
prometheus :9153
forward . "/etc/resolv.conf"
cache 30
loop
reload
loadbalance
}
kind: ConfigMap
metadata:
name: coredns
namespace: kube-system
重启coredns:
kubectl scale deployment coredns -n kube-system --replicas=0
deployment.extensions/coredns scaled
kubectl scale deployment coredns -n kube-system --replicas=2
deployment.extensions/coredns scaled