EKS Elastic IP with service type node port

9/11/2018

I'm trying to configure an elastic ip with Amazon's Elastic Kubernetes service so I can expose a static public IP address. So far it seems the only way to expose a static public IP address is through a load balancer which is kind of a waste since I have a static private IP address endpoint for the service but no way to expose it publicly. And I only need 1 instance of the service running since HA isn't a requirement here. I have tried everything I can think of even to manually configuring an elastic ip but it seems that if that is a solution, the steps are a little convoluted and seems odd that you would have to do such a thing.

-- Josh Woodcock
amazon-eks
kubernetes

2 Answers

9/11/2018

Short answer: AFAIK it's not possible through K8s. If you don't want to waste EIPs then why don't you use an Ingress Controller (Something like traefik or nginx) that way your ingress uses a single IP as a service and then you can expose other services from there.

nginx

traefik

Also, you can track or open issues in kube-aws or in k8s itself in the AWS provider part of the code

-- Rico
Source: StackOverflow

9/11/2018

The only possible way with EKS is to use a Load Balancer. In our case, we needed to have a fixed CNAME to use in Route53. We ended up using a Load Balancer that points to our web server, that was set up as a Deployment. As you mentioned I thought that using a Load Balancer was a waste because we only have 1 deployment, but it ended up to be quite helpful, especially because we configure the deployment to use a readinessProbe, in that way the Balancer switch to the Pod only when it's ready. The Load Balancer CNAME is then used as a RecordSet in Route53.

-- nicor88
Source: StackOverflow