Difficulty: Beginner
Estimated Time: 15 minutes

The Horizontal Pod Autoscaler automatically scales the number of Pods in a replication controller, deployment, replica set or stateful set based on some metrics.

By default, you can autoscale workloads based on metrics exposed by Metrics Server, a standard component of a Kubernetes cluster. Metrics Server enables, for example, the kubectl top command.

-> kubectl top pods                     
NAME                       CPU(cores)   MEMORY(bytes)   
apache2-7c444757d6-rwsdn   1m           6Mi

Usually, you scale via CPU usage, putting a target value on the average utilization. Once exceeded, the Deployment will scale accordingly.

But what about using something more meaningful? Or something that is not an indirect metric?

What I'm talking about is, for example, trying to scale a web application serving traffic using CPU usage. But, CPU usage is only a side effect of traffic increase. The natural evolution is using HTTP metrics!

Let's go!

Scale workloads with ingress traffic 🇬🇧

Step 1 of 3

Step 1 - Install prerequisites

Let's download the demo repository:

mkdir /root/demo
cd /root/demo
git clone https://github.com/sighupio/blog-posts-example.git
cd blog-posts-example/scale-workloads-with-ingress-traffic

Now, let's install all the Fury prerequisites, proceed applying all the manifests using the kustomize/kubectl combo:

kustomize build . | kubectl apply -f -

Wait that the apiserver is ready to serve the new CRDs (usually 10 seconds top) and re-apply the manifests:

kustomize build . | kubectl apply -f -

Check that everything is up & running:

kubectl get pods -n monitoring
kubectl get pods -n ingress-nginx

All done. Let’s move on. 💪