# coreDNS deployment 확인
kubectl get configmap -n kube-system
# NAME DATA AGE
# coredns 1 319d
# extension-apiserver-authentication 6 319d
# kube-apiserver-legacy-service-account-token-tracking 1 319d
# kube-proxy 2 319d
# kube-root-ca.crt 1 319d
# kubeadm-config 1 319d
# kubelet-config 1 319d
# configmap 수정
kubectl edit deployment coredns -n kube-system
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
}
cache 30
loop
reload
loadbalance
# 여기부터
hosts {
192.168.0.1 subdomain.domain.net
192.168.0.2 subdomain2.domain.net
fallthrough
}
# 여기까지 추가 또는 수정한다.
# kubernetes 전역적으로 host 정보가 변경된다.
}
kind: ConfigMap
metadata:
creationTimestamp: "2023-01-09T05:14:26Z"
name: coredns
namespace: kube-system
resourceVersion: "6696678"
uid: b55dc799-081c-47a1-88ff-9dac0c1a1658