13 Set Up Cluster Autoscaler
13 Set Up Cluster Autoscaler
This lesson will focus on how to set up Cluster Autoscaler in GKE, EKS and AKS.
export NAME=devops25
Adding permissions #
We’ll add a few additional permissions to the role created through eksctl. We
do not know the name of the role, but we do know the pattern used to create
it. Therefore, we’ll retrieve the name of the role, before we add a new policy
to it.
echo $IAM_ROLE
The output of the latter command should be similar to the one that follows.
eksctl-devops25-nodegroup-0-NodeInstanceRole-UU6CKXYESUES
We listed all the roles, and we used jq to filter the output so that only the one
with the name that starts with eksctl-$NAME-nodegroup-ng-143b-
NodeInstanceRole is returned. Once we filtered the roles, we retrieved the
RoleName and stored it in the environment variable IAM_ROLE .
Adding JSON #
Next, we need JSON that describes the new policy. I already prepared one, so
let’s take a quick look at it.
cat scaling/eks-autoscaling-policy.json
The output is as follows.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeTags",
"autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup"
],
"Resource": "*"
}
]
}
If you’re familiar with AWS (I hope you are), that policy should be
straightforward. It allows a few additional actions related to autoscaling .
Now that we added the required tags to the Autoscaling Group and that we
created the additional permissions that will allow Kubernetes to interact with
the group, we can install Cluster Autoscaler Helm Chart.
kubectl -n kube-system \
rollout status \
deployment aws-cluster-autoscaler
Once the Deployment is rolled out, the autoscaler should be fully operational.
Q
Cluster Autoscaler comes pre-configured and ready in ____?
COMPLETED 0%
1 of 1