EKS - Pod Limit in a Node

 https://github.com/awslabs/amazon-eks-ami/blob/master/files/eni-max-pods.txt

이번에는 eks cluster 의 worker node 를 fargate 대신, managed 혹은 un-managed node group 으로 관리할 때 생길 수 있는 이슈인 Pod Limit 에 대해 정리해보겠다.

제일 먼저 올린 링크에서 확인할 수 있듯이, ec2 type 에 따라 pod 를 deploy 할 수 있는 제한이 있다.

t3.micro 의 경우 pod 제한이 4개, t3.nano 도 pod 제한이 4개 이다.




Pod Limit 이 어떤 상황을 야기시킬 수 있을지 테스트해보자.

먼저, cluster 를 만든다.

eksctl create cluster --version 1.17 --name pod-test --node-type t3.micro --nodes 2


kubectl get ns 명령어로 namespace 를 확인한다. kube-system namespace 의 pods 들을 확인할 수 있다. 
해당 pod 들은 k8s 시스템에서 생성한 오브젝트들로, k8s cluster 구성에 필수적인 컴포넌트들과 설정값 들이다. 이미 위에서 t3.micro type 으로 node 를 생성했고, t3.micro 의 pod limit 은 4 이다.

이미, kube-system 네임스페이스에 6개의 pod 가 running 하고 있다. 
2 node (t3.micro)  * 4 (pod limit per t3.micro) = 8 (pod limit) 이며, 즉 추가적으로 running 가능한 pod 의 수는 2개가 된다. 

그렇다면 이제 2개 이상의 pod 를 deploy 해보자.

해당 yaml 파일을 통해서 replicas 3 을 통해 desired pod 수는 3이다. 하지만, 결과는 1개의 pod 는 pending status 라는 것을 확인할 수 있다?

원인은 바로
0/2 nodes are avaliable: 2 Insufficient pods. 라는 message 이다. 이미 pod limit 이 가득 차서, 더 이상 pod 를 올릴 수 없다.

이만 여기까지 정리하고, 내 돈이 타는 것을 막기위해 cluster 를 삭제하자.



댓글

이 블로그의 인기 게시물

About Kafka Basic

About JVM Warm up

About idempotent

About G1 GC

About ZGC

Spring Boot Actuator readiness, liveness probes on k8s

sneak peek jitpack

Optimistic Concurrency Control VS Pessimistic Concurrency Control - What should i choose?

DDD(Domain Driven Design) - Aggregate (어그리게잇)

Strategy Pattern In Spring (feat. JPA)