How to do DNS pointing to aws eks

3/22/2021

I am running aws eks. I am trying to install the sample Nginx app and point a subdomain to it. I have hooked aws eks to an existing rancher portal. I can able to install my Nginx app using the rancher. It has a service file and ingress file. Here is my Nginx helm chart https://github.com/clayrisser/charts/tree/master/alpha/nginx

When I went through the many docs online i have seen aws eks requires aws load balancer controller which auto creates and load balancer of type we specify through our ingress and service file and we need to Alias point to domian. How can we alias point if our domain is a root domain?

How can we eliminate creating Lb's for each app. Is there a way to create and use only one LB for the whole cluster? and all apps can use this LB?

Is there a way to have IP for the elb instead of generated one?

If there is a better way of doing

-- m9m9m
amazon-eks
amazon-elb
amazon-web-services
kubernetes
kubernetes-ingress

1 Answer

3/22/2021

How can we eliminate creating Lb's for each app. Is there a way to create and use only one LB for the whole cluster? and all apps can use this LB?

Yeah, you can install an ingress controller in your cluster with service type LoadBalancer. This will create a LoadBalancer in your account. Some of the popular ones are Nginx, Traefik, Contour etc.

The ingress resources you create now can use this ingress controller using annotation kubernetes.io/ingress.class. Make sure your app service type is not LoadBalancer as it will create a new LB.

Is there a way to have IP for the elb instead of generated one?

Yeah, some cloud providers (including AWS) allow you to specify the loadBalancerIP. In those cases, the load-balancer is created with the user-specified loadBalancerIP. Service should look something like this:

apiVersion: v1
kind: Service
spec:
  type: LoadBalancer
  loadBalancerIP: xx.xx.xx.xx
  ...

But as you're looking for a single LB, you should probably use the loadBalancerIP option with an ingress controller. For eg, nginx ingress controller provides this option. The configuration would look something like:

values:
  controller:
    service:
      loadBalancerIP: "12.234.162.41"
      xxx 

https://github.com/helm/charts/blob/master/stable/nginx-ingress/values.yaml#L271

-- rock'n rolla
Source: StackOverflow