I am running EKS in private subnet and thus unable to create an internet facing load balancer but was able to create Internal LoadBalancer.
Is there any way I can create Loadbalancer(probably Manually) in public subnet and point to the pods running in EKS in the private subnet.
I was thinking of creating the chain of load balancer in which External load balancer will point to internal load balancer but that too is not possible as the IP address of the internal load balancer is reserved IP.
Can I try some other way to route the traffic from the internet to pod?
The instances in the public subnet can send outbound traffic directly to the internet, whereas the instances in the private subnet can't. Instead, the instances in the private subnet can access the internet by using a network address translation (NAT) gateway that resides in the public subnet.
If you want to access your private subnet from outside of the VPC you need to add a bastion host to the public subnet. The bastion host should have a security group which only allows connections from the IP of your personal machine (if this is where your accessing from).
If your pods run on Windows in an Amazon EKS cluster, a single service with a load balancer can support up to 1024 back-end pods. Each pod has its own unique IP address. We recommend only creating new Network Load Balancers with the AWS Load Balancer Controller.
However, if you have them in your VPC, you can deploy self-managed nodes and Kubernetes resources to these types of subnets. The subnets must use IP address based naming. Amazon EC2 resource-based naming isn't supported with Amazon EKS. The subnets can be a public or private.
I had the same issue and it was because I did not tag the VPC subnets properly: https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html
I had to add the key: kubernetes.io/cluster/{eks-cluster-name} value: shared tag to the VPC
Then you can create a LB using a service with the type LoadBalancer
apiVersion: v1
kind: Service
metadata:
name: helloworld
labels:
app: helloworld
spec:
ports:
- port: 80
targetPort: 8080
selector:
app: helloworld
type: LoadBalancer
This might help during the service creation: https://blog.giantswarm.io/load-balancer-service-use-cases-on-aws/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With