Ingress service type

12/28/2018

I understand the principle of Ingress, how it routes to services by feeding an Ingress resource to the Ingress controller.

I use Docker for mac with the following Ingress controller: https://github.com/kubernetes/ingress-nginx/blob/master/docs/deploy/index.md#docker-for-mac

There is just one thing I don't quite understand, and that is what type of service you are supposed to use.

Is it ok to use replica sets as you would do with regular load balancer services, and should you provide a resource of 'Kind' 'service' while omitting the 'spec/type' attribute in the service resource altogether?

-- Trace
kubernetes

1 Answer

12/28/2018

For your apps use a Service of type ClusterIP as you would for a cluster-internal Service. This is because they are now internal and it is only the ingress controller which is external. See examples in https://kubernetes.io/docs/concepts/services-networking/ingress/

For the Ingress controller itself you typically use LoadBalancer but it is your choice how you expose themselves ingress controller externally. You can use NodePort if that suits your cluster (e.g. it is on-prem). In that docker for Mac example the ingress controller is LoadBalancer type - https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/cloud-generic.yaml This is typically used for cloud providers but docker for Mac supports it - Docker for Mac(Edge) - Kubernetes - LoadBalancer

-- Ryan Dawson
Source: StackOverflow