Why do I need kubernetes Ingress for custom domain?

11/22/2018

I deployed my app using kubernetes and now Id like to add custom domain to the app. I am using this tutorial and it uses ingress to set the custom domain.
I noticed that the app load balancer has an ip. Why shouldn't I use that ip? What is the reason I need ingress?

-- Naor
kubernetes
kubernetes-ingress
nginx-ingress

2 Answers

11/22/2018

Using domains over IPs has it's obvious advantages of not having to memorize 158.21.72.879 instead of mydomain.com.

Next, using mydomain.com, you can change your IP as many times as you like without having to change your calls to mydomain.com.

Ingress comes in different flavors, is highly configurable, allows for traffic redirection using kubernetes service names and some of them even have their own stats page so you can monitor your requests.

Furthermore, if you are using gcloud or the like, the LoadBalancer IP could change (unless confiugred otherwise), assigning you any available IP from your IP pool.

The real question is - why NOT use an Ingress?

-- Urosh T.
Source: StackOverflow

11/22/2018

If you want to expose your app, you could just as easily use a service of type NodePort instead of an Ingress. You could also use the type LoadBalancer. LoadBalancer is a superset of NodePort and assigns a fixed ip. With the type LoadBalancer you could assign a domain to this fixed IP. How to do this depends on where you have registered your domain.

To answer your questions:

  • You do not need an Ingress you could use a NodePort service or LoadBalander service.
  • To assign a domain to your app, you do not need an Ingress, you could use a LoadBalancer service
  • In any case, you could just use the ip, but as already pointed out, a domain is more convenient.

If you just want to try out your app, you could just use the IP. A domain can be assigned later.

Here is a official kubernetes tutorial on how to expose an app: https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-intro/

-- mbuechmann
Source: StackOverflow