DEV Community

Cover image for Do you know that EKS Auto Mode enforces a 21-day maximum node lifetime?
Vijay Kodam
Vijay Kodam

Posted on

Do you know that EKS Auto Mode enforces a 21-day maximum node lifetime?

EKS Auto mode cluster manages worker nodes on your behalf.
Karpenter deletes worker nodes in EKS auto mode nodepools after 21 days of node lifetime. This is the maximum node lifetime. It will be replaced with a new node.

This is needed for:

  • providing security patches
  • OS updates
  • component upgrades
  • improves security posture

What if you want to modify the maximum node lifetime?

You can reduce the maximum node lifetime by creating a custom NodePool with “spec.template.spec.expireAfter” with a value of node lifetime in hours. Max is 21 days.

How to disable it?

If for some reason, you do not want to delete worker nodes so frequent or if you want to keep the nodes static then you can create a new Managed Node Group and add nodes in it.
You can create both EKS Auto mode nodepools and Managed Node groups (without auto mode) in the same EKS cluster. These are called mixed-mode clusters.
I will be covering more about mixed-mode clusters in future posts.

For more insights on EKS, AWS, Kubernetes, and Cloud Architecture, follow me in LinkedIn and check out my blog for all my blog posts in one place.

Top comments (0)