Search code examples
ipamazon-ekswhitelist

How to attach public IP to EKS pod


I'm working on a project which is running on EKS/AWS. We have a node in the system which need to communicate with an external system with a IP white-list.

I found out that the nodes have a public IP but this isn't working because that would mean I need to add all the nodes to the whitelist..

My question is; how can I set a public IP to a specific pod in my K8s deployment?


Solution

  • You can setup NAT with Elastic IP address and route your cluster egress thru this NAT. This way you only need to whitelist the NAT public IP. On top of that, you can opt to place all your worker nodes in the private subnet for better security. See Public+Private subnets for more details.