SlideShare a Scribd company logo
1 of 35
Download to read offline
© 2023, Amazon Web Services, Inc. or its affiliates.
© 2023, Amazon Web Services, Inc. or its affiliates.
알아두면 쓸모있는 Amazon EKS
네트워킹 팁 몇 가지
Yongho Choi
Solutions Architect
AWS
© 2023, Amazon Web Services, Inc. or its affiliates.
© 2023, Amazon Web Services, Inc. or its affiliates.
Amazon EKS를 위한
네트워크 구성은?
© 2023, Amazon Web Services, Inc. or its affiliates.
잠깐! IP 기본 지식
• 사설 IP (Private IP)란 무엇이고 왜 쓸까요?
A 스타트업 (192.168.0.0/16)
© 2023, Amazon Web Services, Inc. or its affiliates.
(참고) 주소 범위 CIDR 이해하기
예) 사설 IP 대역 (RFC1918)
192.168.0.0/16
255.255.0.0
11111111.11111111.00000000.00000000
8 8
16
http://www.subnet-calculator.com/cidr.php
Subnet
Bits(CIDR)
# of hosts
/16 65,534
/17 32,766
/18 18,382
/19 8,190
/20 4,094
/21 2,046
/22 1,022
/23 510
/24 254
/25 128
/26 62
/27 30
/28 14
© 2023, Amazon Web Services, Inc. or its affiliates.
Subnet Subnet
Subnet Subnet
VPC
Availability Zone
ap-northeast-2A
Availability Zone
ap-northeast-2B
VPC 생성 : 서브넷 정의 및 IPv4 주소 대역 할당
172.31.0 172.31.1
172.31.128 172.31.129
© 2023, Amazon Web Services, Inc. or its affiliates.
가용영역 레벨의 고가용성 구성
• 최소 2개 이상의 가용 영역 사용 권장
AWS Cloud
Region
Availability Zone
Amazon VPC
인스턴스 1 인스턴스 2
Availability Zone
© 2023, Amazon Web Services, Inc. or its affiliates.
퍼블릭 서브넷
• 인터넷과 양방향 통신이 필요한가?
Amazon VPC
가용 영역 가용 영역
/16
프라이빗 서브넷
퍼블릭 서브넷
프라이빗 서브넷
퍼블릭 서브넷
/22
0.0.0.0/0 IGW
10.1.0.0/16 Local
Destination Target
© 2023, Amazon Web Services, Inc. or its affiliates.
프라이빗 서브넷
• 프라이빗 서브넷도 인터넷과 아웃바운드 통신은 필요하다면? – NAT
게이트웨이
Amazon VPC
가용 영역 가용 영역
/16
프라이빗 서브넷
퍼블릭 서브넷
프라이빗 서브넷
퍼블릭 서브넷
/22
0.0.0.0/0 IGW
10.1.0.0/16 Local
Destination Target
NAT 게이트웨이
EIP: 11.22.33.44
인스턴스 B
NAT GW
0.0.0.0/0
10.1.0.0/16 Local
Destination Target
© 2023, Amazon Web Services, Inc. or its affiliates.
NAT 게이트웨이
• NAT 게이트웨이 이중화 구성을 통한 가용 영역(AZ) 수준의 가용성 확보
Amazon VPC
가용 영역 가용 영역
/16
프라이빗 서브넷
퍼블릭 서브넷
프라이빗 서브넷
퍼블릭 서브넷
/22
0.0.0.0/0 IGW
10.1.0.0/16 Local
Destination Target
NAT 게이트웨이
EIP: 11.22.33.44
인스턴스 B
NAT GW
0.0.0.0/0
10.1.0.0/16 Local
Destination Target
EIP: 11.33.44.55
© 2023, Amazon Web Services, Inc. or its affiliates. 10
그럼 Amazon EKS에서는 어떻게 서브넷을 구성해야 할까요?
© 2023, Amazon Web Services, Inc. or its affiliates.
10.0.11.0/20 10.0.12.0/20 10.0.13.0/20
AZ 1A
Amazon EKS Networking
Customer VPC 10.0.0.0/16
Amazon Managed VPC
API Server
EKS Control Plane
Data Plane
10.0.1.0/28
AZ 1B AZ 1C
10.0.2.0/28
워커 노드들은 프라이빗 서브넷에 생성
© 2023, Amazon Web Services, Inc. or its affiliates. 12
그럼 외부에서 들어오는 트래픽을
어떻게 노드 또는 Pod로 전달할까요?
© 2023, Amazon Web Services, Inc. or its affiliates. 13
Pod A
Pod B
Application Load Balancer
Service A -Target Group
(인스턴스모드)
Service B -Target Group
(인스턴스모드)
Service C-Target Group
(IP 모드)
Network Load Balancer
Pod A
Pod B Pod C
Pod A
Pod D
ALB Ingress
Controller
Pod C
Pod D
NP-
B NP-
A NP-
B NP-
A
Pod C
NP-
A
https://github.com/kubernetes-sigs/aws-load-balancer-controller
상태 업데이트
Watch
규칙: /dog 규칙: /cat 규칙: /pets
API Server
로드밸런서를 사용하여 외부 트래픽 Pod로 분배
© 2023, Amazon Web Services, Inc. or its affiliates.
서브넷 자동 탐색
Private Subnet
Public Subnet
Tags:
kubernetes.io/role/elb: 1
kubernetes.io/cluster/${cluster-name}: shared*
Tags:
kubernetes.io/role/internal-elb: 1
kubernetes.io/cluster/${cluster-name}: shared*
로드 밸런서는 서브넷에 할당된 태그를 기반으로 서브넷에 배치됩니다.
* Not needed in versions 1.19 or later
© 2023, Amazon Web Services, Inc. or its affiliates.
EKS에서 Network Load Balancer 프로비저닝
kind: Service
apiVersion: v1
metadata:
name: nginx-service
namespace: ingress-nginx
annotations:
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: 'true’
service.beta.kubernetes.io/aws-load-balancer-type: nlb
service.beta.kubernetes.io/aws-load-balancer-internal: "true"
spec:
type: LoadBalancer
externalTrafficPolicy: Cluster
selector:
app: nginx
ports:
- name: http
protocol: TCP
port: 8080
targetPort: 80
in-tree service controller 사용
© 2023, Amazon Web Services, Inc. or its affiliates.
EKS에서 Network Load Balancer 프로비저닝
Customer VPC
Data Plane
Pod Pod
NodePort
kubectl apply –f
Cloud Controller Manager
EKS VPC
Control Plane
Service Controller
CLB/NLB
provisioning
Listener
Target Group
© 2023, Amazon Web Services, Inc. or its affiliates.
EKS에서 Network Load Balancer 프로비저닝
kubectl apply –f
NodePort: 31245
ClusterIP: 172.20.84.55
Port: 80
Service
Pod
10.0.1.101:8080
Pod
10.0.1.102:8080
Node1
31245
Node2
31245
EKS VPC
Control Plane
Cloud Controller Manager
Service Controller
CLB/NLB
provisioning
© 2023, Amazon Web Services, Inc. or its affiliates.
Network Load Balancer 프로비저닝 시 Target 유형 지정
kind: Service
apiVersion: v1
metadata:
name: nginx-service
namespace: ingress-nginx
annotations:
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: “true”
service.beta.kubernetes.io/aws-load-balancer-type: "external"
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: “instance"
service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
spec:
type: LoadBalancer
selector:
app: nginx
ports:
- name: http
protocol: TCP
port: 8080
targetPort: 80
AWS Load Balancer controller 사용
version 2.2.0 이상 필요
© 2023, Amazon Web Services, Inc. or its affiliates.
AWS Load Balancer Controller에 의한 Target 유형 설정
kubectl apply –f
EKS VPC
Control Plane
Cloud Controller Manager
Service Controller
Customer VPC
Data Plane
Listener
Target Group
Pod Pod
NodePort
AWS Load
Balancer
Controller
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: instance
NLB provisioning
© 2023, Amazon Web Services, Inc. or its affiliates.
AWS Load Balancer Controller에 의한 Target 유형 설정
kubectl apply –f
EKS VPC
Control Plane
Cloud Controller Manager
Service Controller
Customer VPC
Data Plane
Listener
Target Group
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
AWS Load
Balancer
Controller
NLB provisioning
Pod Pod
© 2023, Amazon Web Services, Inc. or its affiliates.
AWS Load
Balancer
Controller
AWS Load Balancer Controller에 의한 Target 유형 설정
kubectl apply –f
EKS VPC
Control Plane
Cloud Controller Manager
Service Controller
Customer VPC
Data Plane
Pod1
10.0.1.101:8080
Pod2
10.0.1.102:8080
NLB provisioning
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
© 2023, Amazon Web Services, Inc. or its affiliates.
EKS에서 Application Load Balancer 프로비저닝
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: echoserver-ingress
namespace: echoserver
annotations:
alb.ingress.kubernetes.io/security-groups: sg-010fc3455c73f0a58, sg-049e999c68a291976
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/group.name: web-services
kubernetes.io/ingress.class: alb
spec:
ingressClassName: alb-ingress-class
rules:
- host: echoserver.example.com
http:
paths:
- path: /*
backend:
serviceName: echoserver-svc
servicePort: 80
kubernetes-sigs/aws-load-balancer-controller
apiVersion: networking.k8s.io/v1beta1
kind: IngressClass
metadata:
name: alb-ingress-class
spec:
controller: ingress.k8s.aws/alb
© 2023, Amazon Web Services, Inc. or its affiliates.
AWS Load
Balancer
Controller
Ingress Rule을 사용하여 대상 서비스로 라우팅
kubectl apply –f
EKS VPC
Control Plane
Customer VPC
Data Plane
Listener
Target Group
Echo Pod Echo Pod
ALB provisioning
Ingress Rules
© 2023, Amazon Web Services, Inc. or its affiliates.
AWS Load
Balancer
Controller
IngressGroup으로 여러 Ingress 리소스를 단일 ALB로 결합
kubectl apply –f
Application
Load balancer
provisioning
EKS VPC
Control Plane
Customer VPC
Data Plane
Listener
Target Group 2
App1 Pod App1 Pod
App2 Pod App2 Pod
Target Group 1
alb.ingress.kubernetes.io/group.name: web-services
Ingress Rules
(App1)
Ingress Rules
(App2)
© 2023, Amazon Web Services, Inc. or its affiliates.
© 2023, Amazon Web Services, Inc. or its affiliates.
DNS 성능 문제를 해결하려면?
© 2023, Amazon Web Services, Inc. or its affiliates.
How DNS Works in Kubernetes
VPC
10.0.0.0/16
Route 53
Resolver
10.0.0.2
Upstream DNS
Name Server
• CoreDNS add-on은 EKS 클러스터 내에서
리소스들의 DNS명을 확인(resolve)함
• VPC 용 기본 Route 53 Resolver는 VPC
내에서 클러스터 외부에 있는 리소스를
확인함
• VPC 내부에서 찾을 수 없다면 외부
리소스를 확인하기 위해 업스트림 DNS
name server로 요청
© 2023, Amazon Web Services, Inc. or its affiliates.
How CoreDNS Works
nameserver 10.100.0.10
search default.svc.cluster.local svc.cluster.local cluster.local us-west-2.compute.internal
options ndots:5
각 컨테이너들은 Kubelet에 의해 /etc/resolv.conf 를 상속 받음
Lookup DNS Name
Is this a FQDN?
CoreDNS
ClusterIP: 10.100.0.10
Yes
No
Query with FQDN
Query with each search domain as suffix
Upstream
Resolver
getaddrinfo
syscall
© 2023, Amazon Web Services, Inc. or its affiliates.
How CoreDNS Works
nameserver 10.100.0.10
search default.svc.cluster.local svc.cluster.local cluster.local us-west-2.compute.internal
options ndots:5
Lookup aws.com.
Is this a FQDN?
CoreDNS
ClusterIP: 10.100.0.10
Yes
Query with aws.com.
점(.)으로 끝났기 때문에 FQDN으로 처리됨
각 컨테이너들은 Kubelet에 의해 /etc/resolv.conf 를 상속 받음
© 2023, Amazon Web Services, Inc. or its affiliates.
How CoreDNS Works
nameserver 10.100.0.10
search default.svc.cluster.local svc.cluster.local cluster.local us-west-2.compute.internal
options ndots:5
Lookup ABC123.gr7.us-west-2.eks.amazonaws.com
Is this a FQDN?
CoreDNS
ClusterIP: 10.100.0.10
Yes
Query with ABC123.gr7.us-west-2.eks.amazonaws.com
5개의 점(.)을 포함
각 컨테이너들은 Kubelet에 의해 /etc/resolv.conf 를 상속 받음
© 2023, Amazon Web Services, Inc. or its affiliates.
app.nodejs.svc.default.svc.cluster.local.
app.nodejs.svc.svc.cluster.local.
app.nodejs.svc.cluster.local.
app.nodejs.svc.us-west-2.compute.internal.
app.nodejs.svc.
How CoreDNS Works
nameserver 10.100.0.10
search default.svc.cluster.local svc.cluster.local cluster.local us-west-2.compute.internal
options ndots:5
No
Lookup app.nodejs.svc
Is this a FQDN?
CoreDNS
ClusterIP: 10.100.0.10
Query
with
5개보다 점(.)이 부족
각 컨테이너들은 Kubelet에 의해 /etc/resolv.conf 를 상속 받음
© 2023, Amazon Web Services, Inc. or its affiliates.
Tuning CoreDNS
spec:
containers:
- name: node
image: nodeapp:v1.0.0
resources:
requests:
cpu: "128m"
memory: "128Mi”
dnsConfig:
options:
- name: ndots
value: 2
• ndots는 주소가 FQDN인지 확인하는 데 사용
• Kubernetes 기본값은 5
• Pod 사양에서 dnsConfig로 재정의됨
• 워크로드별로 개별 지정
• ndots = 2로 설정
• aws.amazon.com과 같이 dot이 2개 이상인
경우 suffix를 붙이지 않고 FQDN으로 인식
• CoreDNS로 쿼리가 줄기 때문에 부하 감소
© 2023, Amazon Web Services, Inc. or its affiliates.
Scaling CoreDNS
• 기본적으로 CoreDNS는 EKS 클러스터에 2개의 복제본으로 배포됨
• CoreDNS 배포를 자동 확장하는 두 가지 방법
• CPA(Cluster Proportional Autoscaling) : 클러스터 규모에 따라 확장
• HPA(Horizontal Pod Autoscaling) : Pod 리소스 임계치 기반의 확장
© 2023, Amazon Web Services, Inc. or its affiliates.
CoreDNS 모니터링
linklocal_allowance_exceeded : PPS가 네트워크 인터페이스의 최대값을 초과하여 삭제된 패킷의 수
• Link local은 인터넷으로 나가지 않는 내부 패킷을 의미
© 2023, Amazon Web Services, Inc. or its affiliates.
Node Local DNS Cache 사용
© 2023, Amazon Web Services, Inc. or its affiliates.
Thank you!
© 2023, Amazon Web Services, Inc. or its affiliates.

More Related Content

Similar to amazon eks network some of count help tip

AWS Summit Seoul 2023 | Amazon EKS, 중요한 건 꺾이지 않는 안정성
AWS Summit Seoul 2023 | Amazon EKS, 중요한 건 꺾이지 않는 안정성AWS Summit Seoul 2023 | Amazon EKS, 중요한 건 꺾이지 않는 안정성
AWS Summit Seoul 2023 | Amazon EKS, 중요한 건 꺾이지 않는 안정성Amazon Web Services Korea
 
AWS 기반 Kubernetes 정복하기::정영준:: AWS Summit Seoul 2018
AWS 기반 Kubernetes 정복하기::정영준:: AWS Summit Seoul 2018 AWS 기반 Kubernetes 정복하기::정영준:: AWS Summit Seoul 2018
AWS 기반 Kubernetes 정복하기::정영준:: AWS Summit Seoul 2018 Amazon Web Services Korea
 
AWS Summit Seoul 2023 | AWS의 관리형 VDI 서비스! 알고 계셨나요?
AWS Summit Seoul 2023 | AWS의 관리형 VDI 서비스! 알고 계셨나요?AWS Summit Seoul 2023 | AWS의 관리형 VDI 서비스! 알고 계셨나요?
AWS Summit Seoul 2023 | AWS의 관리형 VDI 서비스! 알고 계셨나요?Amazon Web Services Korea
 
[Partner TechShift 2017] 클라우드 시대 기존 Legacy에서 벗어나는 방법
[Partner TechShift 2017] 클라우드 시대 기존 Legacy에서 벗어나는 방법[Partner TechShift 2017] 클라우드 시대 기존 Legacy에서 벗어나는 방법
[Partner TechShift 2017] 클라우드 시대 기존 Legacy에서 벗어나는 방법Amazon Web Services Korea
 
AWS Summit Seoul 2023 | 혁신의 키워드는 '조직'과 '문화' - 하이브리드 클라우드 플랫폼과 agile 조직이 만드는 혁신
AWS Summit Seoul 2023 | 혁신의 키워드는 '조직'과 '문화' - 하이브리드 클라우드 플랫폼과 agile 조직이 만드는 혁신AWS Summit Seoul 2023 | 혁신의 키워드는 '조직'과 '문화' - 하이브리드 클라우드 플랫폼과 agile 조직이 만드는 혁신
AWS Summit Seoul 2023 | 혁신의 키워드는 '조직'과 '문화' - 하이브리드 클라우드 플랫폼과 agile 조직이 만드는 혁신Amazon Web Services Korea
 
Amazon VPC와 ELB/Direct Connect/VPN 알아보기 - 김세준, AWS 솔루션즈 아키텍트
Amazon VPC와 ELB/Direct Connect/VPN 알아보기 - 김세준, AWS 솔루션즈 아키텍트Amazon VPC와 ELB/Direct Connect/VPN 알아보기 - 김세준, AWS 솔루션즈 아키텍트
Amazon VPC와 ELB/Direct Connect/VPN 알아보기 - 김세준, AWS 솔루션즈 아키텍트Amazon Web Services Korea
 
AWS Summit Seoul 2023 | 팬덤을 위한 아티스트 IP 기반의 디지털 콜렉터블 플랫폼
AWS Summit Seoul 2023 | 팬덤을 위한 아티스트 IP 기반의 디지털 콜렉터블 플랫폼AWS Summit Seoul 2023 | 팬덤을 위한 아티스트 IP 기반의 디지털 콜렉터블 플랫폼
AWS Summit Seoul 2023 | 팬덤을 위한 아티스트 IP 기반의 디지털 콜렉터블 플랫폼Amazon Web Services Korea
 
AWS 클라우드 네트워크 서비스 알아보기::서지혜::AWS Summit Seoul 2018
AWS 클라우드 네트워크 서비스 알아보기::서지혜::AWS Summit Seoul 2018AWS 클라우드 네트워크 서비스 알아보기::서지혜::AWS Summit Seoul 2018
AWS 클라우드 네트워크 서비스 알아보기::서지혜::AWS Summit Seoul 2018Amazon Web Services Korea
 
간단한 게임을 쉽고 저렴하게 서비스해보자! ::: AWS Game Master 온라인 시리즈 #1
간단한 게임을 쉽고 저렴하게 서비스해보자! ::: AWS Game Master 온라인 시리즈 #1간단한 게임을 쉽고 저렴하게 서비스해보자! ::: AWS Game Master 온라인 시리즈 #1
간단한 게임을 쉽고 저렴하게 서비스해보자! ::: AWS Game Master 온라인 시리즈 #1Amazon Web Services Korea
 
쿠키런: 킹덤 대규모 인프라 및 서버 운영 사례 공유 [데브시스터즈 - 레벨 200] - 발표자: 용찬호, R&D 엔지니어, 데브시스터즈 ...
쿠키런: 킹덤 대규모 인프라 및 서버 운영 사례 공유 [데브시스터즈 - 레벨 200] - 발표자: 용찬호, R&D 엔지니어, 데브시스터즈 ...쿠키런: 킹덤 대규모 인프라 및 서버 운영 사례 공유 [데브시스터즈 - 레벨 200] - 발표자: 용찬호, R&D 엔지니어, 데브시스터즈 ...
쿠키런: 킹덤 대규모 인프라 및 서버 운영 사례 공유 [데브시스터즈 - 레벨 200] - 발표자: 용찬호, R&D 엔지니어, 데브시스터즈 ...Amazon Web Services Korea
 
[금융고객을 위한 Resiliency in the Cloud] AWS를 활용한 금융사 Resiliency 구성...
[금융고객을 위한 Resiliency in the Cloud] AWS를 활용한 금융사 Resiliency 구성...[금융고객을 위한 Resiliency in the Cloud] AWS를 활용한 금융사 Resiliency 구성...
[금융고객을 위한 Resiliency in the Cloud] AWS를 활용한 금융사 Resiliency 구성...AWS Korea 금융산업팀
 
AWS 클라우드 핵심 서비스로 클라우드 기반 아키텍처 빠르게 구성하기 - 문종민 솔루션즈 아키텍트, AWS :: AWS Summit Seo...
AWS 클라우드 핵심 서비스로 클라우드 기반 아키텍처 빠르게 구성하기 - 문종민 솔루션즈 아키텍트, AWS :: AWS Summit Seo...AWS 클라우드 핵심 서비스로 클라우드 기반 아키텍처 빠르게 구성하기 - 문종민 솔루션즈 아키텍트, AWS :: AWS Summit Seo...
AWS 클라우드 핵심 서비스로 클라우드 기반 아키텍처 빠르게 구성하기 - 문종민 솔루션즈 아키텍트, AWS :: AWS Summit Seo...Amazon Web Services Korea
 
클라우드 네이티브 환경에 맞는 IT 운영 원칙과 모범사례 - 권신중 솔루션즈 아키텍트, AWS :: AWS Summit Seoul 2019
클라우드 네이티브 환경에 맞는 IT 운영 원칙과 모범사례 - 권신중 솔루션즈 아키텍트, AWS :: AWS Summit Seoul 2019클라우드 네이티브 환경에 맞는 IT 운영 원칙과 모범사례 - 권신중 솔루션즈 아키텍트, AWS :: AWS Summit Seoul 2019
클라우드 네이티브 환경에 맞는 IT 운영 원칙과 모범사례 - 권신중 솔루션즈 아키텍트, AWS :: AWS Summit Seoul 2019Amazon Web Services Korea
 
클라우드 허브: 멀티클라우드 시대의 디지털 비즈니스 핵심 전략
클라우드 허브: 멀티클라우드 시대의 디지털 비즈니스 핵심 전략클라우드 허브: 멀티클라우드 시대의 디지털 비즈니스 핵심 전략
클라우드 허브: 멀티클라우드 시대의 디지털 비즈니스 핵심 전략KINX
 
진정한 하이브리드 환경을 위한 올바른 선택, AWS Outposts! - 강동환 AWS 솔루션즈 아키텍트 :: AWS Summit Seou...
진정한 하이브리드 환경을 위한 올바른 선택, AWS Outposts! - 강동환 AWS 솔루션즈 아키텍트 :: AWS Summit Seou...진정한 하이브리드 환경을 위한 올바른 선택, AWS Outposts! - 강동환 AWS 솔루션즈 아키텍트 :: AWS Summit Seou...
진정한 하이브리드 환경을 위한 올바른 선택, AWS Outposts! - 강동환 AWS 솔루션즈 아키텍트 :: AWS Summit Seou...Amazon Web Services Korea
 
‘VR로 랜선 응원을’  - LG유플러스, 프로 야구 포스트 시즌 8K VR 생중계 - 김기남 AWS 어카운트 매니저 / 김현욱 박사, L...
‘VR로 랜선 응원을’  - LG유플러스, 프로 야구 포스트 시즌 8K VR 생중계 - 김기남 AWS 어카운트 매니저 / 김현욱 박사, L...‘VR로 랜선 응원을’  - LG유플러스, 프로 야구 포스트 시즌 8K VR 생중계 - 김기남 AWS 어카운트 매니저 / 김현욱 박사, L...
‘VR로 랜선 응원을’  - LG유플러스, 프로 야구 포스트 시즌 8K VR 생중계 - 김기남 AWS 어카운트 매니저 / 김현욱 박사, L...Amazon Web Services Korea
 
AWS로 게임 기반 다지기 - 김병수, 박진성 :: AWS Game Master 온라인 세미나 #3
AWS로 게임 기반 다지기 - 김병수, 박진성 :: AWS Game Master 온라인 세미나 #3 AWS로 게임 기반 다지기 - 김병수, 박진성 :: AWS Game Master 온라인 세미나 #3
AWS로 게임 기반 다지기 - 김병수, 박진성 :: AWS Game Master 온라인 세미나 #3 Amazon Web Services Korea
 
AWS Summit Seoul 2023 | 플로 AWS All-in 전략을 통해 음원서비스의 혁신을 이루다
AWS Summit Seoul 2023 | 플로 AWS All-in 전략을 통해 음원서비스의 혁신을 이루다AWS Summit Seoul 2023 | 플로 AWS All-in 전략을 통해 음원서비스의 혁신을 이루다
AWS Summit Seoul 2023 | 플로 AWS All-in 전략을 통해 음원서비스의 혁신을 이루다Amazon Web Services Korea
 
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...Amazon Web Services Korea
 
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018Amazon Web Services Korea
 

Similar to amazon eks network some of count help tip (20)

AWS Summit Seoul 2023 | Amazon EKS, 중요한 건 꺾이지 않는 안정성
AWS Summit Seoul 2023 | Amazon EKS, 중요한 건 꺾이지 않는 안정성AWS Summit Seoul 2023 | Amazon EKS, 중요한 건 꺾이지 않는 안정성
AWS Summit Seoul 2023 | Amazon EKS, 중요한 건 꺾이지 않는 안정성
 
AWS 기반 Kubernetes 정복하기::정영준:: AWS Summit Seoul 2018
AWS 기반 Kubernetes 정복하기::정영준:: AWS Summit Seoul 2018 AWS 기반 Kubernetes 정복하기::정영준:: AWS Summit Seoul 2018
AWS 기반 Kubernetes 정복하기::정영준:: AWS Summit Seoul 2018
 
AWS Summit Seoul 2023 | AWS의 관리형 VDI 서비스! 알고 계셨나요?
AWS Summit Seoul 2023 | AWS의 관리형 VDI 서비스! 알고 계셨나요?AWS Summit Seoul 2023 | AWS의 관리형 VDI 서비스! 알고 계셨나요?
AWS Summit Seoul 2023 | AWS의 관리형 VDI 서비스! 알고 계셨나요?
 
[Partner TechShift 2017] 클라우드 시대 기존 Legacy에서 벗어나는 방법
[Partner TechShift 2017] 클라우드 시대 기존 Legacy에서 벗어나는 방법[Partner TechShift 2017] 클라우드 시대 기존 Legacy에서 벗어나는 방법
[Partner TechShift 2017] 클라우드 시대 기존 Legacy에서 벗어나는 방법
 
AWS Summit Seoul 2023 | 혁신의 키워드는 '조직'과 '문화' - 하이브리드 클라우드 플랫폼과 agile 조직이 만드는 혁신
AWS Summit Seoul 2023 | 혁신의 키워드는 '조직'과 '문화' - 하이브리드 클라우드 플랫폼과 agile 조직이 만드는 혁신AWS Summit Seoul 2023 | 혁신의 키워드는 '조직'과 '문화' - 하이브리드 클라우드 플랫폼과 agile 조직이 만드는 혁신
AWS Summit Seoul 2023 | 혁신의 키워드는 '조직'과 '문화' - 하이브리드 클라우드 플랫폼과 agile 조직이 만드는 혁신
 
Amazon VPC와 ELB/Direct Connect/VPN 알아보기 - 김세준, AWS 솔루션즈 아키텍트
Amazon VPC와 ELB/Direct Connect/VPN 알아보기 - 김세준, AWS 솔루션즈 아키텍트Amazon VPC와 ELB/Direct Connect/VPN 알아보기 - 김세준, AWS 솔루션즈 아키텍트
Amazon VPC와 ELB/Direct Connect/VPN 알아보기 - 김세준, AWS 솔루션즈 아키텍트
 
AWS Summit Seoul 2023 | 팬덤을 위한 아티스트 IP 기반의 디지털 콜렉터블 플랫폼
AWS Summit Seoul 2023 | 팬덤을 위한 아티스트 IP 기반의 디지털 콜렉터블 플랫폼AWS Summit Seoul 2023 | 팬덤을 위한 아티스트 IP 기반의 디지털 콜렉터블 플랫폼
AWS Summit Seoul 2023 | 팬덤을 위한 아티스트 IP 기반의 디지털 콜렉터블 플랫폼
 
AWS 클라우드 네트워크 서비스 알아보기::서지혜::AWS Summit Seoul 2018
AWS 클라우드 네트워크 서비스 알아보기::서지혜::AWS Summit Seoul 2018AWS 클라우드 네트워크 서비스 알아보기::서지혜::AWS Summit Seoul 2018
AWS 클라우드 네트워크 서비스 알아보기::서지혜::AWS Summit Seoul 2018
 
간단한 게임을 쉽고 저렴하게 서비스해보자! ::: AWS Game Master 온라인 시리즈 #1
간단한 게임을 쉽고 저렴하게 서비스해보자! ::: AWS Game Master 온라인 시리즈 #1간단한 게임을 쉽고 저렴하게 서비스해보자! ::: AWS Game Master 온라인 시리즈 #1
간단한 게임을 쉽고 저렴하게 서비스해보자! ::: AWS Game Master 온라인 시리즈 #1
 
쿠키런: 킹덤 대규모 인프라 및 서버 운영 사례 공유 [데브시스터즈 - 레벨 200] - 발표자: 용찬호, R&D 엔지니어, 데브시스터즈 ...
쿠키런: 킹덤 대규모 인프라 및 서버 운영 사례 공유 [데브시스터즈 - 레벨 200] - 발표자: 용찬호, R&D 엔지니어, 데브시스터즈 ...쿠키런: 킹덤 대규모 인프라 및 서버 운영 사례 공유 [데브시스터즈 - 레벨 200] - 발표자: 용찬호, R&D 엔지니어, 데브시스터즈 ...
쿠키런: 킹덤 대규모 인프라 및 서버 운영 사례 공유 [데브시스터즈 - 레벨 200] - 발표자: 용찬호, R&D 엔지니어, 데브시스터즈 ...
 
[금융고객을 위한 Resiliency in the Cloud] AWS를 활용한 금융사 Resiliency 구성...
[금융고객을 위한 Resiliency in the Cloud] AWS를 활용한 금융사 Resiliency 구성...[금융고객을 위한 Resiliency in the Cloud] AWS를 활용한 금융사 Resiliency 구성...
[금융고객을 위한 Resiliency in the Cloud] AWS를 활용한 금융사 Resiliency 구성...
 
AWS 클라우드 핵심 서비스로 클라우드 기반 아키텍처 빠르게 구성하기 - 문종민 솔루션즈 아키텍트, AWS :: AWS Summit Seo...
AWS 클라우드 핵심 서비스로 클라우드 기반 아키텍처 빠르게 구성하기 - 문종민 솔루션즈 아키텍트, AWS :: AWS Summit Seo...AWS 클라우드 핵심 서비스로 클라우드 기반 아키텍처 빠르게 구성하기 - 문종민 솔루션즈 아키텍트, AWS :: AWS Summit Seo...
AWS 클라우드 핵심 서비스로 클라우드 기반 아키텍처 빠르게 구성하기 - 문종민 솔루션즈 아키텍트, AWS :: AWS Summit Seo...
 
클라우드 네이티브 환경에 맞는 IT 운영 원칙과 모범사례 - 권신중 솔루션즈 아키텍트, AWS :: AWS Summit Seoul 2019
클라우드 네이티브 환경에 맞는 IT 운영 원칙과 모범사례 - 권신중 솔루션즈 아키텍트, AWS :: AWS Summit Seoul 2019클라우드 네이티브 환경에 맞는 IT 운영 원칙과 모범사례 - 권신중 솔루션즈 아키텍트, AWS :: AWS Summit Seoul 2019
클라우드 네이티브 환경에 맞는 IT 운영 원칙과 모범사례 - 권신중 솔루션즈 아키텍트, AWS :: AWS Summit Seoul 2019
 
클라우드 허브: 멀티클라우드 시대의 디지털 비즈니스 핵심 전략
클라우드 허브: 멀티클라우드 시대의 디지털 비즈니스 핵심 전략클라우드 허브: 멀티클라우드 시대의 디지털 비즈니스 핵심 전략
클라우드 허브: 멀티클라우드 시대의 디지털 비즈니스 핵심 전략
 
진정한 하이브리드 환경을 위한 올바른 선택, AWS Outposts! - 강동환 AWS 솔루션즈 아키텍트 :: AWS Summit Seou...
진정한 하이브리드 환경을 위한 올바른 선택, AWS Outposts! - 강동환 AWS 솔루션즈 아키텍트 :: AWS Summit Seou...진정한 하이브리드 환경을 위한 올바른 선택, AWS Outposts! - 강동환 AWS 솔루션즈 아키텍트 :: AWS Summit Seou...
진정한 하이브리드 환경을 위한 올바른 선택, AWS Outposts! - 강동환 AWS 솔루션즈 아키텍트 :: AWS Summit Seou...
 
‘VR로 랜선 응원을’  - LG유플러스, 프로 야구 포스트 시즌 8K VR 생중계 - 김기남 AWS 어카운트 매니저 / 김현욱 박사, L...
‘VR로 랜선 응원을’  - LG유플러스, 프로 야구 포스트 시즌 8K VR 생중계 - 김기남 AWS 어카운트 매니저 / 김현욱 박사, L...‘VR로 랜선 응원을’  - LG유플러스, 프로 야구 포스트 시즌 8K VR 생중계 - 김기남 AWS 어카운트 매니저 / 김현욱 박사, L...
‘VR로 랜선 응원을’  - LG유플러스, 프로 야구 포스트 시즌 8K VR 생중계 - 김기남 AWS 어카운트 매니저 / 김현욱 박사, L...
 
AWS로 게임 기반 다지기 - 김병수, 박진성 :: AWS Game Master 온라인 세미나 #3
AWS로 게임 기반 다지기 - 김병수, 박진성 :: AWS Game Master 온라인 세미나 #3 AWS로 게임 기반 다지기 - 김병수, 박진성 :: AWS Game Master 온라인 세미나 #3
AWS로 게임 기반 다지기 - 김병수, 박진성 :: AWS Game Master 온라인 세미나 #3
 
AWS Summit Seoul 2023 | 플로 AWS All-in 전략을 통해 음원서비스의 혁신을 이루다
AWS Summit Seoul 2023 | 플로 AWS All-in 전략을 통해 음원서비스의 혁신을 이루다AWS Summit Seoul 2023 | 플로 AWS All-in 전략을 통해 음원서비스의 혁신을 이루다
AWS Summit Seoul 2023 | 플로 AWS All-in 전략을 통해 음원서비스의 혁신을 이루다
 
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
 
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
 

More from HeeJung Chae

[Ansible] Solution Guide V0.4_20181204.pdf
[Ansible] Solution Guide V0.4_20181204.pdf[Ansible] Solution Guide V0.4_20181204.pdf
[Ansible] Solution Guide V0.4_20181204.pdfHeeJung Chae
 
AI - I fnd you service - 발표자료_최종v1.0.pdf
AI  - I fnd you service - 발표자료_최종v1.0.pdfAI  - I fnd you service - 발표자료_최종v1.0.pdf
AI - I fnd you service - 발표자료_최종v1.0.pdfHeeJung Chae
 
64a4f8f874749655fe090218_OpenMSA 솔루션 소개서_v1.12.pdf
64a4f8f874749655fe090218_OpenMSA 솔루션 소개서_v1.12.pdf64a4f8f874749655fe090218_OpenMSA 솔루션 소개서_v1.12.pdf
64a4f8f874749655fe090218_OpenMSA 솔루션 소개서_v1.12.pdfHeeJung Chae
 

More from HeeJung Chae (6)

[Ansible] Solution Guide V0.4_20181204.pdf
[Ansible] Solution Guide V0.4_20181204.pdf[Ansible] Solution Guide V0.4_20181204.pdf
[Ansible] Solution Guide V0.4_20181204.pdf
 
AI - I fnd you service - 발표자료_최종v1.0.pdf
AI  - I fnd you service - 발표자료_최종v1.0.pdfAI  - I fnd you service - 발표자료_최종v1.0.pdf
AI - I fnd you service - 발표자료_최종v1.0.pdf
 
64a4f8f874749655fe090218_OpenMSA 솔루션 소개서_v1.12.pdf
64a4f8f874749655fe090218_OpenMSA 솔루션 소개서_v1.12.pdf64a4f8f874749655fe090218_OpenMSA 솔루션 소개서_v1.12.pdf
64a4f8f874749655fe090218_OpenMSA 솔루션 소개서_v1.12.pdf
 
java_1장
java_1장java_1장
java_1장
 
java_2장.pptx
java_2장.pptxjava_2장.pptx
java_2장.pptx
 
java_1장.pptx
java_1장.pptxjava_1장.pptx
java_1장.pptx
 

amazon eks network some of count help tip

  • 1. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. 알아두면 쓸모있는 Amazon EKS 네트워킹 팁 몇 가지 Yongho Choi Solutions Architect AWS
  • 2. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. Amazon EKS를 위한 네트워크 구성은?
  • 3. © 2023, Amazon Web Services, Inc. or its affiliates. 잠깐! IP 기본 지식 • 사설 IP (Private IP)란 무엇이고 왜 쓸까요? A 스타트업 (192.168.0.0/16)
  • 4. © 2023, Amazon Web Services, Inc. or its affiliates. (참고) 주소 범위 CIDR 이해하기 예) 사설 IP 대역 (RFC1918) 192.168.0.0/16 255.255.0.0 11111111.11111111.00000000.00000000 8 8 16 http://www.subnet-calculator.com/cidr.php Subnet Bits(CIDR) # of hosts /16 65,534 /17 32,766 /18 18,382 /19 8,190 /20 4,094 /21 2,046 /22 1,022 /23 510 /24 254 /25 128 /26 62 /27 30 /28 14
  • 5. © 2023, Amazon Web Services, Inc. or its affiliates. Subnet Subnet Subnet Subnet VPC Availability Zone ap-northeast-2A Availability Zone ap-northeast-2B VPC 생성 : 서브넷 정의 및 IPv4 주소 대역 할당 172.31.0 172.31.1 172.31.128 172.31.129
  • 6. © 2023, Amazon Web Services, Inc. or its affiliates. 가용영역 레벨의 고가용성 구성 • 최소 2개 이상의 가용 영역 사용 권장 AWS Cloud Region Availability Zone Amazon VPC 인스턴스 1 인스턴스 2 Availability Zone
  • 7. © 2023, Amazon Web Services, Inc. or its affiliates. 퍼블릭 서브넷 • 인터넷과 양방향 통신이 필요한가? Amazon VPC 가용 영역 가용 영역 /16 프라이빗 서브넷 퍼블릭 서브넷 프라이빗 서브넷 퍼블릭 서브넷 /22 0.0.0.0/0 IGW 10.1.0.0/16 Local Destination Target
  • 8. © 2023, Amazon Web Services, Inc. or its affiliates. 프라이빗 서브넷 • 프라이빗 서브넷도 인터넷과 아웃바운드 통신은 필요하다면? – NAT 게이트웨이 Amazon VPC 가용 영역 가용 영역 /16 프라이빗 서브넷 퍼블릭 서브넷 프라이빗 서브넷 퍼블릭 서브넷 /22 0.0.0.0/0 IGW 10.1.0.0/16 Local Destination Target NAT 게이트웨이 EIP: 11.22.33.44 인스턴스 B NAT GW 0.0.0.0/0 10.1.0.0/16 Local Destination Target
  • 9. © 2023, Amazon Web Services, Inc. or its affiliates. NAT 게이트웨이 • NAT 게이트웨이 이중화 구성을 통한 가용 영역(AZ) 수준의 가용성 확보 Amazon VPC 가용 영역 가용 영역 /16 프라이빗 서브넷 퍼블릭 서브넷 프라이빗 서브넷 퍼블릭 서브넷 /22 0.0.0.0/0 IGW 10.1.0.0/16 Local Destination Target NAT 게이트웨이 EIP: 11.22.33.44 인스턴스 B NAT GW 0.0.0.0/0 10.1.0.0/16 Local Destination Target EIP: 11.33.44.55
  • 10. © 2023, Amazon Web Services, Inc. or its affiliates. 10 그럼 Amazon EKS에서는 어떻게 서브넷을 구성해야 할까요?
  • 11. © 2023, Amazon Web Services, Inc. or its affiliates. 10.0.11.0/20 10.0.12.0/20 10.0.13.0/20 AZ 1A Amazon EKS Networking Customer VPC 10.0.0.0/16 Amazon Managed VPC API Server EKS Control Plane Data Plane 10.0.1.0/28 AZ 1B AZ 1C 10.0.2.0/28 워커 노드들은 프라이빗 서브넷에 생성
  • 12. © 2023, Amazon Web Services, Inc. or its affiliates. 12 그럼 외부에서 들어오는 트래픽을 어떻게 노드 또는 Pod로 전달할까요?
  • 13. © 2023, Amazon Web Services, Inc. or its affiliates. 13 Pod A Pod B Application Load Balancer Service A -Target Group (인스턴스모드) Service B -Target Group (인스턴스모드) Service C-Target Group (IP 모드) Network Load Balancer Pod A Pod B Pod C Pod A Pod D ALB Ingress Controller Pod C Pod D NP- B NP- A NP- B NP- A Pod C NP- A https://github.com/kubernetes-sigs/aws-load-balancer-controller 상태 업데이트 Watch 규칙: /dog 규칙: /cat 규칙: /pets API Server 로드밸런서를 사용하여 외부 트래픽 Pod로 분배
  • 14. © 2023, Amazon Web Services, Inc. or its affiliates. 서브넷 자동 탐색 Private Subnet Public Subnet Tags: kubernetes.io/role/elb: 1 kubernetes.io/cluster/${cluster-name}: shared* Tags: kubernetes.io/role/internal-elb: 1 kubernetes.io/cluster/${cluster-name}: shared* 로드 밸런서는 서브넷에 할당된 태그를 기반으로 서브넷에 배치됩니다. * Not needed in versions 1.19 or later
  • 15. © 2023, Amazon Web Services, Inc. or its affiliates. EKS에서 Network Load Balancer 프로비저닝 kind: Service apiVersion: v1 metadata: name: nginx-service namespace: ingress-nginx annotations: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: 'true’ service.beta.kubernetes.io/aws-load-balancer-type: nlb service.beta.kubernetes.io/aws-load-balancer-internal: "true" spec: type: LoadBalancer externalTrafficPolicy: Cluster selector: app: nginx ports: - name: http protocol: TCP port: 8080 targetPort: 80 in-tree service controller 사용
  • 16. © 2023, Amazon Web Services, Inc. or its affiliates. EKS에서 Network Load Balancer 프로비저닝 Customer VPC Data Plane Pod Pod NodePort kubectl apply –f Cloud Controller Manager EKS VPC Control Plane Service Controller CLB/NLB provisioning Listener Target Group
  • 17. © 2023, Amazon Web Services, Inc. or its affiliates. EKS에서 Network Load Balancer 프로비저닝 kubectl apply –f NodePort: 31245 ClusterIP: 172.20.84.55 Port: 80 Service Pod 10.0.1.101:8080 Pod 10.0.1.102:8080 Node1 31245 Node2 31245 EKS VPC Control Plane Cloud Controller Manager Service Controller CLB/NLB provisioning
  • 18. © 2023, Amazon Web Services, Inc. or its affiliates. Network Load Balancer 프로비저닝 시 Target 유형 지정 kind: Service apiVersion: v1 metadata: name: nginx-service namespace: ingress-nginx annotations: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: “true” service.beta.kubernetes.io/aws-load-balancer-type: "external" service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: “instance" service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing spec: type: LoadBalancer selector: app: nginx ports: - name: http protocol: TCP port: 8080 targetPort: 80 AWS Load Balancer controller 사용 version 2.2.0 이상 필요
  • 19. © 2023, Amazon Web Services, Inc. or its affiliates. AWS Load Balancer Controller에 의한 Target 유형 설정 kubectl apply –f EKS VPC Control Plane Cloud Controller Manager Service Controller Customer VPC Data Plane Listener Target Group Pod Pod NodePort AWS Load Balancer Controller service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: instance NLB provisioning
  • 20. © 2023, Amazon Web Services, Inc. or its affiliates. AWS Load Balancer Controller에 의한 Target 유형 설정 kubectl apply –f EKS VPC Control Plane Cloud Controller Manager Service Controller Customer VPC Data Plane Listener Target Group service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip AWS Load Balancer Controller NLB provisioning Pod Pod
  • 21. © 2023, Amazon Web Services, Inc. or its affiliates. AWS Load Balancer Controller AWS Load Balancer Controller에 의한 Target 유형 설정 kubectl apply –f EKS VPC Control Plane Cloud Controller Manager Service Controller Customer VPC Data Plane Pod1 10.0.1.101:8080 Pod2 10.0.1.102:8080 NLB provisioning service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
  • 22. © 2023, Amazon Web Services, Inc. or its affiliates. EKS에서 Application Load Balancer 프로비저닝 apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: echoserver-ingress namespace: echoserver annotations: alb.ingress.kubernetes.io/security-groups: sg-010fc3455c73f0a58, sg-049e999c68a291976 alb.ingress.kubernetes.io/target-type: ip alb.ingress.kubernetes.io/scheme: internet-facing alb.ingress.kubernetes.io/group.name: web-services kubernetes.io/ingress.class: alb spec: ingressClassName: alb-ingress-class rules: - host: echoserver.example.com http: paths: - path: /* backend: serviceName: echoserver-svc servicePort: 80 kubernetes-sigs/aws-load-balancer-controller apiVersion: networking.k8s.io/v1beta1 kind: IngressClass metadata: name: alb-ingress-class spec: controller: ingress.k8s.aws/alb
  • 23. © 2023, Amazon Web Services, Inc. or its affiliates. AWS Load Balancer Controller Ingress Rule을 사용하여 대상 서비스로 라우팅 kubectl apply –f EKS VPC Control Plane Customer VPC Data Plane Listener Target Group Echo Pod Echo Pod ALB provisioning Ingress Rules
  • 24. © 2023, Amazon Web Services, Inc. or its affiliates. AWS Load Balancer Controller IngressGroup으로 여러 Ingress 리소스를 단일 ALB로 결합 kubectl apply –f Application Load balancer provisioning EKS VPC Control Plane Customer VPC Data Plane Listener Target Group 2 App1 Pod App1 Pod App2 Pod App2 Pod Target Group 1 alb.ingress.kubernetes.io/group.name: web-services Ingress Rules (App1) Ingress Rules (App2)
  • 25. © 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. DNS 성능 문제를 해결하려면?
  • 26. © 2023, Amazon Web Services, Inc. or its affiliates. How DNS Works in Kubernetes VPC 10.0.0.0/16 Route 53 Resolver 10.0.0.2 Upstream DNS Name Server • CoreDNS add-on은 EKS 클러스터 내에서 리소스들의 DNS명을 확인(resolve)함 • VPC 용 기본 Route 53 Resolver는 VPC 내에서 클러스터 외부에 있는 리소스를 확인함 • VPC 내부에서 찾을 수 없다면 외부 리소스를 확인하기 위해 업스트림 DNS name server로 요청
  • 27. © 2023, Amazon Web Services, Inc. or its affiliates. How CoreDNS Works nameserver 10.100.0.10 search default.svc.cluster.local svc.cluster.local cluster.local us-west-2.compute.internal options ndots:5 각 컨테이너들은 Kubelet에 의해 /etc/resolv.conf 를 상속 받음 Lookup DNS Name Is this a FQDN? CoreDNS ClusterIP: 10.100.0.10 Yes No Query with FQDN Query with each search domain as suffix Upstream Resolver getaddrinfo syscall
  • 28. © 2023, Amazon Web Services, Inc. or its affiliates. How CoreDNS Works nameserver 10.100.0.10 search default.svc.cluster.local svc.cluster.local cluster.local us-west-2.compute.internal options ndots:5 Lookup aws.com. Is this a FQDN? CoreDNS ClusterIP: 10.100.0.10 Yes Query with aws.com. 점(.)으로 끝났기 때문에 FQDN으로 처리됨 각 컨테이너들은 Kubelet에 의해 /etc/resolv.conf 를 상속 받음
  • 29. © 2023, Amazon Web Services, Inc. or its affiliates. How CoreDNS Works nameserver 10.100.0.10 search default.svc.cluster.local svc.cluster.local cluster.local us-west-2.compute.internal options ndots:5 Lookup ABC123.gr7.us-west-2.eks.amazonaws.com Is this a FQDN? CoreDNS ClusterIP: 10.100.0.10 Yes Query with ABC123.gr7.us-west-2.eks.amazonaws.com 5개의 점(.)을 포함 각 컨테이너들은 Kubelet에 의해 /etc/resolv.conf 를 상속 받음
  • 30. © 2023, Amazon Web Services, Inc. or its affiliates. app.nodejs.svc.default.svc.cluster.local. app.nodejs.svc.svc.cluster.local. app.nodejs.svc.cluster.local. app.nodejs.svc.us-west-2.compute.internal. app.nodejs.svc. How CoreDNS Works nameserver 10.100.0.10 search default.svc.cluster.local svc.cluster.local cluster.local us-west-2.compute.internal options ndots:5 No Lookup app.nodejs.svc Is this a FQDN? CoreDNS ClusterIP: 10.100.0.10 Query with 5개보다 점(.)이 부족 각 컨테이너들은 Kubelet에 의해 /etc/resolv.conf 를 상속 받음
  • 31. © 2023, Amazon Web Services, Inc. or its affiliates. Tuning CoreDNS spec: containers: - name: node image: nodeapp:v1.0.0 resources: requests: cpu: "128m" memory: "128Mi” dnsConfig: options: - name: ndots value: 2 • ndots는 주소가 FQDN인지 확인하는 데 사용 • Kubernetes 기본값은 5 • Pod 사양에서 dnsConfig로 재정의됨 • 워크로드별로 개별 지정 • ndots = 2로 설정 • aws.amazon.com과 같이 dot이 2개 이상인 경우 suffix를 붙이지 않고 FQDN으로 인식 • CoreDNS로 쿼리가 줄기 때문에 부하 감소
  • 32. © 2023, Amazon Web Services, Inc. or its affiliates. Scaling CoreDNS • 기본적으로 CoreDNS는 EKS 클러스터에 2개의 복제본으로 배포됨 • CoreDNS 배포를 자동 확장하는 두 가지 방법 • CPA(Cluster Proportional Autoscaling) : 클러스터 규모에 따라 확장 • HPA(Horizontal Pod Autoscaling) : Pod 리소스 임계치 기반의 확장
  • 33. © 2023, Amazon Web Services, Inc. or its affiliates. CoreDNS 모니터링 linklocal_allowance_exceeded : PPS가 네트워크 인터페이스의 최대값을 초과하여 삭제된 패킷의 수 • Link local은 인터넷으로 나가지 않는 내부 패킷을 의미
  • 34. © 2023, Amazon Web Services, Inc. or its affiliates. Node Local DNS Cache 사용
  • 35. © 2023, Amazon Web Services, Inc. or its affiliates. Thank you! © 2023, Amazon Web Services, Inc. or its affiliates.