Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS EKS - NodeGroup Update Instance Types

I'm currently have a Kubernetes Application using AWS EKS. I also created nodegroup; initial I provisioned low instance capacity on that nodeGroup can only handle 4 pods. When I tried to rollout an update on my deployments error occurred insufficient pods, this is mainly due to the under capacity instance type that I initially provision. My question is it possible to update the live nodeGroup instancetype?

I solved the problem though by creating additional nodegroup with scaled up instance type. I'm just wondering if it's possible to edit the live nodegroup instance type for scaling up.

like image 765
Edcel Cabrera Vista Avatar asked Apr 05 '20 06:04

Edcel Cabrera Vista


People also ask

What is an EKS Nodegroup?

Amazon EKS managed nodegroups is a feature that automates the provisioning and lifecycle management of nodes (EC2 instances) for Amazon EKS Kubernetes clusters. Customers can provision optimized groups of nodes for their clusters and EKS will keep their nodes up to date with the latest Kubernetes and host OS versions.

Does EKS create EC2 instances?

Amazon EKS Networking The EKS control plane runs in an Amazon-managed VPC. It creates and manages network interfaces in your account related to each EKS cluster you create. EC2 and Fargate instances use these network interfaces to connect to the EKS control plane.

Does EKS support spot instances?

The Amazon EKS managed node group handles Spot Instance interruptions automatically without any additional tools. The underlying Amazon EC2 Auto Scaling group is opted in to Capacity Rebalancing.

How long does it take to update EKS cluster?

It will take as long as 20 minutes for the EKS cluster's version to be updated, and you can track its progress in the AWS console or using the output from terraform.

Can eks managed node groups be used for AWS spot instances?

Similarly, customers have expressed strong interest in using EKS managed node groups for launching and managing Spot Instances. Amazon EC2 Spot Instances allow AWS customers to run EC2 instances at steep discounts by tapping into EC2 spare capacity pools.

How does the default Amazon EKS node AWS CloudFormation template work?

The latest default Amazon EKS node AWS CloudFormation template is configured to launch an instance with the new AMI into your cluster before removing an old one, one at a time. This configuration ensures that you always have your Auto Scaling group's desired count of active instances in your cluster during the rolling update.

What can I do with the AWS managed node groups?

You can use the node group to apply Kubernetes labels to nodes and update them at any time. There are no additional costs to use Amazon EKS managed node groups, you only pay for the AWS resources you provision.

What is an Eks nodegroup?

The EKS nodegroups are in essence EC2 auto scaling groups, which use launch templates to scale the nodes up and down. Furthermore the launch template defines the instance type.


3 Answers

EKS nodegroups instance types cannot be changed after creation. You'll have to create a new node group every time you'd like a new instance type.

like image 70
Yaron Idan Avatar answered Oct 14 '22 05:10

Yaron Idan


The instance type can be changed by applying a new launch template version. However as any node related changes are immutable in nature, beware that this will in reality create new EC2 instances and get rid of the old ones (depending on the use case), and won't change instance types on the existing nodes. The EKS nodegroups are in essence EC2 auto scaling groups, which use launch templates to scale the nodes up and down. Furthermore the launch template defines the instance type. Hence by defining a new launch template, any new nodes that would be spun up would use the new instance type (plus, in case the number of nodes doesn't change, then the change can be executed via a rolling update to minimize the impact to the cluster). Steps to update in AWS console:

  1. Navigate to auto scaling groups under the EC2 service
  2. Find the launch template corresponding to the auto scaling group for the nodegroup
  3. Create a new version by selecting Actions - Modify template (create new version) This will take the existing template, so only the instance type needs to be modified.
  4. Set default version for the launch template by clicking on Actions - Set default version
  5. Applying the change
    • Number of nodes remain the same:
      • Open the auto scaling group

      • Click on Start instance refresh

      • Set appropriate minimum healthy percentage and instance warmup

        An instance refresh replaces instances. Each instance is terminated first and then replaced, which temporarily reduces the capacity available within your Auto Scaling group. Learn more

        In case there is only a single node, then it could make sense to temporarily scale up to 2 nodes for the refresh process to be able to reschedule the workload evicted from the node being refreshed.

    • Number of nodes reduces:
      • The nodegroup can be scaled down via eksctl scale nodegroup. But bear in mind, that this will terminate all instances in the nodegroup and create the new instances based on the updated launch template.
    • Number of nodes increases:
      • The nodegroup can be scaled up via eksctl scale nodegroup. The new instances that will be created will based on the updated launch template.

Reference with screenshots

like image 21
Kornel Chlebovics Avatar answered Oct 14 '22 07:10

Kornel Chlebovics


You can not update instance type , use autoscaling or create a new node group & make pods schedule over there

like image 1
R. Pandey Avatar answered Oct 14 '22 07:10

R. Pandey