Cluster Autoscaler configure on AWS EKS -1.25.
Cluster Autoscaler plays a vital role in a Kubernetes cluster by ensuring adequate computing resources are available by adding nodes to a cluster and keeping infrastructure costs down by removing nodes.
Published Mar 30, 2024
The Kubernetes Cluster Autoscaler automatically adjusts the number of nodes in your cluster when pods fail or are rescheduled onto other nodes. The Cluster Autoscaler uses Auto Scaling groups. For more information, see Cluster Autoscaler on AWS.
- performed Step 1 : to step 5 : Click here
Node :
Pods:
IAM OIDC is used for authorizing the Cluster Autoscaler to launch or terminate instances under an Auto Scaling group. Open EKS Dashboard and copy a OpenID Connect Provider link
- Open a IAM Providers
- Click “Add provider,” select “OpenID Connect,” and click “Get thumbprint” as shown below:
Then enter the “Audience” (sts.amazonaws.com in our example pointing to the AWS STS, also known as the Security Token Service) and click the add provider.
- Adding identity information on identity providers
Step 4: Create IAM Policy
Create a Policy with necessary permission.
- To create the policy with the necessary permissions, save the below file as AmazonEKSClusterAutoscalerPolic
Review and create a policy
- Create role
Select the web identity
- Select identity provide and audience click next.
Add Policy
AmazonEKSClusterAutoscalerPolicy
Click Next and provide Role Name : EKS_Autoscaler
verify the IAM role and make sure the policy is attached.
Edit the “Trust relationships.”
Before Edit “Trust relationships.”
After Edit “Trust relationships.”
Then click “Update Trust Policy” to save it.
Next, we deploy Cluster Autoscaler. To do so, you must use the Amazon Resource Names (ARN) number of the IAM role created in our earlier step.The content intended to save into a file (make sure you copy all of the content presented over the next page):
Modify below two lines
- Line 8 : change IAM Role name
- Line 159 : --node-group-auto-discovery = This is used by CA to discover the Auto Scaling group based on its tag.
To deploy CA, save the following content presented after the command below in a file and run this provided command:
The expected results are displayed below.
Configure metrics-server plugins :
URL : kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
verify the logs by issuing this command:
Cluster Autoscaler plays a vital role in a Kubernetes cluster by ensuring adequate computing resources are available by adding the nodes to a cluster and keeping infrastructure costs down by removing nodes