Subnet bị hết IP cấp cho pod
kubectl set env daemonset aws-node -n kube-system WARM_PREFIX_TARGET=1
kubectl set env daemonset aws-node -n kube-system WARM_IP_TARGET=10
The maximum number of IP addresses that you can assign to a network interface depends on the instance type. Each prefix that you assign to a network interface counts as one IP address. For example, a c5.large
instance has a limit of 10
IPv4 addresses per network interface. Each network interface for this instance has a primary IPv4 address. If a network interface has no secondary IPv4 addresses, you can assign up to 9 prefixes to the network interface. For each additional IPv4 address that you assign to a network interface, you can assign one less prefix to the network interface. Review the AWS EC2 documentation on IP addresses per network interface per instance type and assigning prefixes to network interfaces.
During worker node initialization, the VPC CNI assigns one or more prefixes to the primary ENI. The CNI pre-allocates a prefix for faster pod startup by maintaining a warm pool. The number of prefixes to be held in warm pool can be controlled by setting environment variables.
WARM_PREFIX_TARGET
, the number of prefixes to be allocated in excess of current need.WARM_IP_TARGET
, the number of IP addresses to be allocated in excess of current need.MINIMUM_IP_TARGET
, the minimum number of IP addresses to be available at any time.WARM_IP_TARGET
andMINIMUM_IP_TARGET
if set will overrideWARM_PREFIX_TARGET
.
As more Pods scheduled additional prefixes will be requested for the existing ENI. First, the VPC CNI attempts to allocate a new prefix to an existing ENI. If the ENI is at capacity, the VPC CNI attempts to allocate a new ENI to the node. New ENIs will be attached until the maximum ENI limit (defined by the instance type) is reached. When a new ENI is attached, ipamd will allocate one or more prefixes needed to maintain the WARM_PREFIX_TARGET
, WARM_IP_TARGET
, and MINIMUM_IP_TARGET
setting.
Nếu bạn còn bị run out of ip on eks
https://www.arhea.net/posts/2020-06-19-amazon-eks-secondary-cidr
https://viblo.asia/p/giai-phap-cho-aws-eks-khat-dia-chi-ip-v4-hon-khat-nuoc-BQyJK3AMJMe