Navigating the Cloud: Demystifying Amazon VPC CNI for EKS Networking
Soumyadip Chatterjee
AWS DevOps Engineer| EPAM Systems |Ex-TCS| Terraform ???, |Docker ?? | K8's??| Snowflake ?? | Argo CD?? | Helm ?? | GitLab ?? | Ansible ?? | Certifications:- 2x AWS ??, 1x Azure???, 1x OCI??, 1x Commvault
In this blog we will cover some of the most important concept relate with EKS cluster and why its a special one which has been widely used by enterprises now a days .
Topics in this Blog :-
What is AWS CNI ?
AWS CNI is the default plugin or an add-ons while we install EKS cluster through cluster or via Terraform . This CNI ensures complete networking communication between pods & containers .
Let's deep dive step by step .
Why AWS CNI ?
In typical enterprise where we have couple of Clusters spans across multiple AZ and they have certain Nodes and underneath pods exists .
Let's take this scenario as follows :-
a. We have multiple EKS clusters spanning across multiple AZ's for the sake of HA , DR purpose .
b. Each cluster having 5 nodes with 20 pods .
c. I have to ensure pods across nodes can communicate using namespaces , label in each AZ's .
d. In peak traffic scale the nodes up to Desired :- 7, Min :- 5 Max :-10
Now how the CNI will assist us to ensure proper networking between pods across nodes and also between nodes in a cluster within an AZ ?
Benefits of CNI
What is Network namespaces and how it's relate with CNI ?
How They Relate to CNI:
Imagine Apartment A (Namespace A) and Apartment B (Namespace B). Apartment A has a kitchen (container A1) and a bedroom (container A2).Apartment B has a living room (container B1) and a bathroom (container B2) . CNI sets up a hallway (virtual network) connecting these apartments: Containers A1 and B1 can chat in the hallway (cross-namespace communication).Containers A2 and B2 can’t directly see each other but can use the hallway to talk .
How shall I ensure that CNI installed in my EKS cluster ?
To ensure that the Amazon VPC Container Network Interface (VPC CNI) plugin is installed in your Amazon EKS cluster, follow these steps:
kubectl get addon -A
Verify the Environment Variable:
kubectl describe pod aws-node-<random-string> -n kube-system
kubectl get ENIConfig -A -o yaml
Remember to replace <random-string> with the actual Pod name.
In conclusion AWS CNI offers rich and powerful features to manage network and its traffic across pods within nodes and across nodes to scale , deploy and expose our application .
Keep Exploring , Keep Learning new things .