kubernetesminikubekubernetes-helmdocker-for-mac

Starting an Ingress service on Docker for Mac


Using:

kubectl expose deployment <Name-Of-Servce> --name=loadbalancer --port=8080 --target-port=8080 --type=LoadBalancer

The kubectl get services is showing pending:

loadbalancer                 LoadBalancer   <x.x.x.x>   <pending>     8080:32670/TCP   2m

Before Docker surported Kubernetes, I could use MiniKube and Helm:

helm install stable/jenkins
kubectl get services // To get the service name
minikube service original-llama-jenkins // << The service name

Now that we have Docker for Mac(Edge) supporting Kubernetes, how do you add an EXTERNAL-IP?


Solution

  • Unless something seriously magical has happened with "Docker for Mac," then the type: LoadBalancer is only designed for a cloud environment, where the Ingress controller can provision a cloud load balancer (i.e. AWS's ELB, GKE's ... whatever they use).

    That said, one can see from your output that kubernetes has behaved as if it was type: NodePort (with your specific example showing that port 32670 goes to port 8080 on your Service). It's unclear whether you can just use that NodePort-ish port as-is, or whether the Service in "pending" state somehow means traffic will not route as expected. I guess maybe just try it?

    Or you can skip the pretense and create the Service legitimately of type: NodePort, and then you and kubernetes will be on the same page about what is happening.

    The other way you can chose to do things is run an in-cluster Ingress controller, such as ingress-nginx, and use virtual-hosting to expose all your services on just one port. That can be far more convenient if you have a lot of Services to expose, but it would likely be too big of a headache to set up just for one or two of them.