AWS EKS : Pod Autoscaler

bo-yoon·2021년 7월 14일
0

aws

목록 보기
1/1

참고

https://docs.aws.amazon.com/ko_kr/eks/latest/userguide/vertical-pod-autoscaler.html
https://kubernetes.io/ko/docs/tasks/run-application/horizontal-pod-autoscale/


Pod Autoscaler

  • aws에서 Pod의 크기나 개수를 CPU사용률에 따라 자동으로 조정
  • 종류 : Vertical Pod Autoscaler, Horizontal Pod Autoscaler

Vertical Pod Autoscaler

  • Pod 에 부하가 올때 자동으로 Pod에 정의 되어있는 cpu, memory 스팩을 변경하여 새로운 파드를 생성한다.

  • 고려할 점 : 워커로드의 사양 고려, 또한 msa 구조로 되어있을 경우 다른 서비스에 영향을 줄수 있음

설치 방법 ) 설치 후 자동으로 조정


# git clone
git clone https://github.com/kubernetes/autoscaler
cd autoscaler/vertical-pod-autoscaler/

# 기존 vpa 삭제 후 설치
./hack/vpa-down.sh
./hack/vpa-up.sh


# 생성 확인
kubectl get pods -n kube-system

Horizontal Pod Autoscaler

  • 같은 종류의 Pod 수를 해당 리소스의 CPU 사용량에 따라 개수를 늘리고 줄임으로 자동으로 조정
  • 주로 사용

사용 방법)

명령어로 기준 cpu 사용량, pod 최소 개수, 최대 개수 지정

kubectl autoscale deployment sample-deployment --cpu-percent=50 --min=1 --max=5


kubectl delete deployment.apps/sample-deployment service/sample horizontalpodautoscaler.autoscaling/sample 

관련 명령어)

kubectl describe hpa

kubectl get hpa
profile
개발 로그 🍎 🍎 🍎

0개의 댓글