개요 : EC2 에서 k8s 를 구성하여 사용중 pod 에서 AWS Network 대역대 DNS 를 찾지 못한 현상이 발생하여, k8s CoreDns 에 지정된 DNS 조회 주소를 변경
방법 : CoreDns ConfigMap 수정 후 pod 재실행
기본 설정된 내용은 아래와 같습니다.
- 아래 yaml 파일중 forward . /etc/resolv.conf 부분을 forward . 169.254.169.253 로 변경
- 169.254.169.253 IP 는 AWS Private Subnet 에서 사용하는 DNS 서버 IP 입니다.
k edit cm -n kube-system coredns
##기본 설정된 내용
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
}
https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html
'k8s' 카테고리의 다른 글
k8s v1.28 install on AWS EC2(Ubuntu22.04) with calico and crio-o (2023-11-15) (0) | 2023.06.24 |
---|