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 에 부하가 올때 자동으로 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
사용 방법)
명령어로 기준 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