Pod limit on Node – AWS EKS
Gần đây mình có 1 bất ngờ khi 1 pod của mình thông báo event:
0/3 nodes are available: 1 Too many pods, 2 node(s) didn't match Pod's node affinity/selector
Mình đã tìm hiểu ra là số pod trên node của eks sẽ bị giới hạn.
The formula for defining the maximum number of pods per instance is as follows:
N * (M-1) + 2
Where:
- N is the number of Elastic Network Interfaces (ENI) of the instance type
- M is the number of IP addresses of a single ENI
So, for t3.small, this calculation is 3 * (4-1) + 2 = 11
.
Values for N
and M
for each instance type in this document.
bạn có thể tham khảo chi tiết ở đây:
https://github.com/awslabs/amazon-eks-ami/blob/master/files/eni-max-pods.txt
an example of network interface IP address exhaustion
Gần đây mình có gặp lỗi là:
Network plugin cni failed to set up pod network: add cmd: failed to assign an IP address to container
Và mình tìm thấy 1 link nói về lỗi này:
https://aws.amazon.com/premiumsupport/knowledge-center/eks-failed-create-pod-sandbox/
như bài viết mô tả:
The following is an example of network interface IP address exhaustion:
Instance type Maximum network interfaces Private IPv4 addresses per interface IPv6 addresses per interface t3.medium 3 6 6
In this example, the instance t3.medium has a maximum of 3 network interfaces, and each network interface has a maximum of 6 IP addresses. The first IP address is used for the node and isn’t assignable. This leaves 17 IP addresses that the network interface can allocate.
Yeah với instance type t3.medium chúng ta có tối đa là 6 Private IPv4 addresses per interface
Mình tìm thêm được 1 tài liêu nữa:
https://aws.github.io/aws-eks-best-practices/networking/prefix-mode/
trong link trên có link:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI

ChatGPT cũng chỉ
To check network interface IP address exhaustion of an instance on AWS, you can use the following steps:
- Log in to the AWS Management Console.
- Navigate to the EC2 dashboard and select the instance for which you want to check network interface IP address exhaustion.
- Under the “Description” tab, locate the “Network interfaces” section.
- Count the number of network interfaces that are attached to the instance. By default, each interface has a private IP address, and if you’ve enabled public IP addresses, each interface will also have a public IP address.
- Check the number of available private IP addresses for each interface by selecting the network interface and viewing the “IPv4 Public IPs” and “IPv4 Private IPs” sections.
If you are running out of IP addresses, you can either increase the number of available private IP addresses by adding additional network interfaces or by using Elastic IP addresses. Additionally, you can check if your VPC IP address range has enough available IP addresses by reviewing your subnet configurations.

Và bạn có thể đọc bài này: