When it comes to networking in EKS clusters, here are some key points to remember about subnets:
if we use private subnets only, our applications can’t be exposed to the web
if we use private subnets only, our worker nodes will be exposed to the internet
the AWS documentation recommends a mix of public and private subnets
There are two security groups which you can control:
When you create a cluster, Amazon EKS creates a security group that’s named:
eks-cluster-sg-<cluster-uniqueID>
This security group has the following default rules:
Here are the minimum required rules required for the cluster:
Here’s a visual diagram of the recommended ports for the master node security group and the worker node security group.
An EKS cluster is shipped with the Amazon VPC CNI Plugin which enables each Pod to receive 1 IP address that’s linked to an ENI (Elastic Network Interface)
However, it has some subnet limitations:
In addition to this, it also has EC2 limitations:
To learn more, check out EC2 ENI and IP Limits.
This is a third-party project that allows you to use network policies instead of using the AWS security groups.
To learn more, check out the Calico add-on in EKS.