Posts

Showing posts from August, 2022

how to apply K8S HPA(Horizontal Pod Autoscaling)

Image
Outline  HPA refers to the replica expansion of the Pod inside the K8S node. The goal is to designate replication of deployed POD according to CPU usage so that the service can operate smoothly. (This is different from Instance Autoscaling, which increases instances of work nodes to be described later.) Apply sequence (based on AWS EKS) 1. Create a Kubernetes metrics server. Metrics Server aggregates resource usage data across the Kubernetes cluster. Metrics such as CPU and memory usage of a worker node or container are collected through 'kubelet' installed on each worker node. kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml If the installation is complete, please check the command below for proper installation kubectl get deployment metrics-server -n kube-system 2. Create a replica of the pod that you want to use HPA. Create one of the default values here. Please refer to deployment.yaml below deployment.yaml --- api