Scale with CA
The Cluster Autoscaler component has been installed in our EKS cluster as part of the preparation for this lab. It runs as a deployment in the kube-system
namespace:
In this lab exercise, we'll update all of the application components to increase their replica count to 4. This will cause more resources to be consumed than are available in a cluster, triggering more compute to be provisioned.
apiVersion: apps/v1
kind: Deployment
metadata:
name: all
spec:
replicas: 4
Let's apply this to our cluster:
Some pods will be in the Pending
state, which triggers the cluster-autoscaler to scale out the EC2 fleet.
View the cluster-autoscaler logs
Check the EC2 AWS Management Console to confirm that the Auto Scaling groups are scaling up to meet demand. This may take a few minutes. You can also follow along with the pod deployment from the command line. You should see the pods transition from pending to running as nodes are scaled up.
Alternatively you can use kubectl
:
NAME STATUS ROLES AGE VERSION
ip-10-42-10-159.us-west-2.compute.internal Ready <none> 3d v1.25.6-eks-48e63af
ip-10-42-11-143.us-west-2.compute.internal Ready <none> 3d v1.25.6-eks-48e63af
ip-10-42-11-81.us-west-2.compute.internal Ready <none> 3d v1.25.6-eks-48e63af
ip-10-42-12-152.us-west-2.compute.internal Ready <none> 3m11s v1.25.6-eks-48e63af