Kubernetes: When do I have to choose a service of type loadbalancer above using ingress + ClusterIP?

8/5/2018

When do I have to choose a service of type loadbalancer above using ingress + clusterIP? It seems to me they can just do the same. I know ingress is not a real type of service but using an ingress above a service of type clusterIP seems to do the same as just using a loadbalancer (which is more expensive)?

-- DenCowboy
kubernetes
kubernetes-ingress
service

1 Answer

8/5/2018

You might choose LoadBalancer for the simplicity or portability you get with it. Ingress rules are effectively proxying configurations and there are different types of proxy with different features. This makes Ingress both powerful and complex and also means there's significant scope for variation. LoadBalancer may be implemented differently on clusters on different cloud providers but the variation is less than the variation in features across Ingress options (in particular features like how to add or restrict special headers for authorisation or cors or the types of traffic that can be proxies). A good article on this is https://medium.com/google-cloud/kubernetes-nodeport-vs-loadbalancer-vs-ingress-when-should-i-use-what-922f010849e0

-- Ryan Dawson
Source: StackOverflow