AWS EKS and Pod sizing per Node considerations

ismail yenigül
Feb 22, 2019 · 3 min read
Image for post
Image for post
AWS EKS Pod Networking

From https://docs.aws.amazon.com/eks/latest/userguide/pod-networking.html

Amazon EKS supports native VPC networking via the Amazon VPC CNI plugin for Kubernetes. Using this CNI plugin allows Kubernetes pods to have the same IP address inside the pod as they do on the VPC network.

Note: This limitation is exist only if you are using the default Amazon VPC CNI plugin for Kubernetes. There is no problem if you using other CNI plugins

This is really a great feature. But there is a one import limitation we will encounter if you want to run so many Pods in a EC2 worker node. Whenever you deploy a Pod in the EKS worker node, EKS creates a new IP address from VPC subnet and attach to the instance.

Image for post
Image for post

You can check how many ethernet interfaces and max IP per interface from https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI

Here is the formula for max Pods numbers.

Max Pods = Maximum supported  Network Interfaces for instance type ) * ( IPv4 Addresses per Interface ) - 1

For example, if you have a t3.medium instance which support max 3 ethernets and 6 IPs per interface. You can create only 17 pods including the kubernetes internal Pods, Because One IP is reserved for nodes itself.

3 * 6 - 1 = 17

You can see run the following commands to see how many Pods are running.

# kubectl get pods — all-namespaces | grep -i running | wc -l
17

If you want to deploy more pods in the EC2 worker node, you should deploy larger EC2 instance type.

Note: I faced this problem when I was deploying alb-ingress-controller Pod.

# kubectl logs -n kube-system $(kubectl get po -n kube-system | egrep -o alb-ingress[a-zA-Z0–9-]+)
...
Failed create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container “ae9a4d174c7c1251ddddcc2304a81520162d5dd788e04448d545e0980c14c816” network for pod “alb-ingress-controller-78cf6874c9-qjk6x”: NetworkPlugin cni failed to set up pod “alb-ingress-controller-78cf6874c9-qjk6x_kube-system” network: add cmd: failed to assign an IP address to container

Ismail YENIGUL

Devops Engineer

Image for post
Image for post

Follow us on Twitter 🐦 and Facebook 👥 and join our Facebook Group 💬.

To join our community Slack 🗣️ and read our weekly Faun topics 🗞️, click here⬇

Image for post
Image for post

FAUN

The Must-Read Publication for Creative Developers & DevOps Enthusiasts

By FAUN

Medium’s largest and most followed independent DevOps publication. Join thousands of aspiring developers and DevOps enthusiasts Take a look

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

ismail yenigül

Written by

Devops Engineer

FAUN

FAUN

The Must-Read Publication for Creative Developers & DevOps Enthusiasts. Medium’s largest DevOps publication.

ismail yenigül

Written by

Devops Engineer

FAUN

FAUN

The Must-Read Publication for Creative Developers & DevOps Enthusiasts. Medium’s largest DevOps publication.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store