I have created an EKS private cluster along with a node group. I'm accessing the cluster through the bastion host. I'm able to access the cluster and run the pods in the cluster but the pods don't have any internet access.
EKS nodes have internet access and it is able to pull the public docker images but the pods running inside it don't have internet access. I'm not using any different networking like calico or anything.
Can someone please help to fix this issue?
Below are the troubleshooting steps for your problem:
By default pods are not isolated and they will accept traffic from any source. Please check whether you have met networking requirements or not from this page.
You need to expose your pods to the service
Ex:
$ kubectl run nginx --image=nginx --replicas=5 -n web deployment.apps/nginx created
$ kubectl expose deployment nginx --port=80 -n web service/nginx exposed
$ kubectl get svc -n web NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE nginx ClusterIP 10.100.94.70 <none> 80/TCP 2s
# kubectl exec -ti busybox -n web -- nslookup nginx Server: 10.100.0.10 Address 1: 10.100.0.10 ip-10-100-0-10.ap-southeast-2.compute.internal Name: nginx Address 1: 10.100.94.70 ip-10-100-94-70.ap-southeast-2.compute.internal
And if it fails; check DNS troubleshooting.