AWS Builder Center

Karpenter subnet selection preference for Amazon EKS

Resolve: Subnets associated with your cluster does not have enough available IP addresses for Amazon EKS

Series: AWS Platform Engineering (8 articles)

  1. 2
    Karpenter subnet selection preference for Amazon EKS This article
We got alert notification to resolve Amazon EKS cluster health issues for AWS Account. IMPAIRED: One or more of the subnets associated with your cluster does not have enough available IP addresses for Amazon EKS to perform cluster management operations. Free up addresses in the subnet(s), or associate different subnets to your cluster using the Amazon EKS update-cluster-config API.
Resolution: We have been using Karpenter with AWS Blueprints. We used Karpenter subnet selection preference feature using subnetSelectorTerms based on  NodeClasses | Karpenter . We created a new subnet and tagged it value as required for the karpenter selection. We observed karpenter distributed the nodes and ip address got distributed equally. This resolved the IP address issue. refer for best practises  Karpenter - Amazon EKS 
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: default
spec:
template:
spec:
nodeClassRef:
group: karpenter.k8s.aws
kind: EC2NodeClass
name: default
---
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
name: default
spec:
subnetSelectorTerms:
# Select on any subnet that has the "karpenter.sh/discovery: ${CLUSTER_NAME}"
# AND the "environment: test" tag OR any subnet with ID "subnet-09fa4a0a8f233a921"
- tags:
karpenter.sh/discovery: "${CLUSTER_NAME}"
environment: test
- id: subnet-09fa4a0a8f233a921


Series: AWS Platform Engineering (8 articles)

  1. 2
    Karpenter subnet selection preference for Amazon EKS This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article