coredns (kube-dns)
•
kubernetes 클러스터 내부의 주소 해석이나 서비스 디스커버리에 사용되는 내부 DNS서버 (Add-on)
•
kube 1.12 버전 전에는 kube-dns라는 이름이었으나, 이후에는 CoreDNS라는 이름을 사용
•
기본 포트 : 53
# coredns 구성확인
kubectl describe configmap coredns -n kube-system
# 도메인 호출 테스트
kubectl create ns app
# 테스트 pod (nginx) 생성
kubectl run nginx --image=nginx -n app
kubectl get pod -n app
kubectl get pod -n app -o wide
# curl pod 생성
kubectl run curl -it --rm --image curlimages/curl -- sh
# dns 호출
curl 10-244-0-6.app.pod.cluster.local
# 도메인 호출 테스트
# resolv.conf 확인 (curl pod 안에서)
cat /etc/resolv.conf
Shell
복사