907 B
907 B
HPA, VPA
HPA means Horizontal Pod Autoscaler
. It automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization (or, with custom metrics support, on some other application-provided metrics).
Let's take an example with CPU usage:
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: simple-hpa
spec:
maxReplicas: 10
minReplicas: 3
scaleTargetRef:
apiVersion: extensions/v1beta1
kind: Deployment
name: simple-deployment
targetCPUUtilizationPercentage: 80
spec
: the spec for the HPAmaxReplicas
: the maximum number of pods runningminReplicas
: the minimum number of pods runningscaleTargetRef
: what this HPA targets, here aDeployment
namedsimple-deployment
targetCPUUtilizationPercentage
: the percentage of CPU utilization to cross to activate the HPA