Load To Technical Architect
[AWS] EKS Horizontal Pod Autoscaler ( HPA ) 구성 방법 본문
728x90
AWS EKS (Elastic Kubernetes Service)에서 Horizontal Pod Autoscaler (HPA)를 활용한 Pod AutoScaling 구성하는 방법
AWS EKS Document : https://docs.aws.amazon.com/eks/latest/userguide/horizontal-pod-autoscaler.html
[ 사전 준비 ]
- EKS Cluster에 접속 할 환경에 kubectl, git 설치
- 최소 하나 이상의 deployment가 cluster에 배포되어있어야 함
- deployment에 리소스(CPU) 사용량이 아래의 예시와 같이 정해져있어야 함
resources:
requests:
cpu: "500m"
[ CLI 작업 ]
1. hpa ( metric-server ) 배포
$ kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
2. hpa 적용
$ kubectl autoscale deployment -n <namespace> <deployment name> --min <최소 pod 수> --max <최대 pod 수 > --cpu-percent=<autoscaling trigger cpu usage>
ex) $ kubectl autoscale deployment -n test test-deployment --min 1 --max 2 --cpu-percent=20
3. 적용된 hpa 확인
$ kubectl get hpa -n <namespace> -w
4. hpa 수정
$ kubectl edit hpa -n <namepsace> <deployment name>
728x90
'Cloud > AWS' 카테고리의 다른 글
[AWS] EKS 리소스 사용량을 Cloudwatch Container Insights에서 모니터링 하는 방법 (0) | 2021.11.18 |
---|---|
[AWS] Fluentd를 사용하여 EKS Log를 CloudWatch로 전송하는 방법 (9) | 2021.11.18 |
[AWS] EKS Load Balancer Controller 구성 방법 (0) | 2021.11.18 |
[AWS] EC2에 ec2-user가 아닌 다른 사용자로 ssh 연결 (0) | 2021.09.02 |
[AWS] Personalize (0) | 2020.06.16 |
Comments