- EKS의 worker node 는 EC2 instacne이며 아무리 작은 크기의 pod 라고 해도 무한정으로 pod를 배포 시킬 수 없음
- 여러개의 pod 가 만들어지면 node 가 가득 차버려서 나머지 pod 들은 pending 상태가 되어 버림
- 이러한 문제를 해결하기 위해서 사용하는 것이 Cluster Autoscaler (CA)
- Cluster Autoscaler (CA) 이란?
- node의 자원이 부족하여 pod 가 pending 될 때 node의 수를 늘려주는 것
- Cluster Autoscaler 로직
- node의 자원이 부족하여 pending 상태가 된 pod 가 있는지 확인
- CA가 desired capacity의 갯수를 바꿈
- AWS 가 새로운 EC2를 생성하며 이에 해당하는 EC2가 새로운 worker node
- 시간이 꽤 많이 소요 됨
- pending 상태의 pod 들이 새로운 worker node에 스케줄링 됨
CA 설정
- Cluster AutoScaling Yaml 파일 다운로드
curl -o cluster-autoscaler-autodiscover.yaml https://raw.githubusercontent.com/kubernetes/autoscaler/master/cluster-autoscaler/cloudprovider/aws/examples/cluster-autoscaler-autodiscover.yaml
- 다운 받은 Cluster Autoscaler Yaml 파일 편집 및 적용
파일 편집기를 통해 your-cluster-name 이라고 적힌 부분 수정
- --node-group-auto-discovery=asg:tag=k8s.io/cluster-autoscaler/enabled,k8s.io/cluster-autoscaler/<your-cluster-name>
command:
- ./cluster-autoscaler
- --v=4
- --stderrthreshold=info
- --cloud-provider=aws
- --skip-nodes-with-local-storage=false
- --expander=least-waste
- --node-group-auto-discovery=asg:tag=k8s.io/cluster-autoscaler/enabled,k8s.io/cluster-autoscaler/ydy-eks-cluster
파일 적용
kubectl apply -f cluster-autoscaler-autodiscover.yaml
'AWS' 카테고리의 다른 글
[AWS] EKS에 Karpenter 적용 (2) | 2024.10.14 |
---|---|
[AWS] WEB/WAS/RDS 연동하기 (0) | 2024.10.14 |
[AWS] EKS - Horizontal Pod AutoScaler ( HPA ) 설정 (8) | 2024.09.29 |
[AWS] EKS - Nginx Ingress Controller 설치 및 NLB 생성 (0) | 2024.09.29 |
[AWS] EKS - Load Balancer Controller 설치 및 ALB 생성 (0) | 2024.09.29 |