Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 541
Chris G. Avatar asked Jan 13 '18 20:01

Chris G.


People also ask

Can I run Kubernetes on my Mac?

Kubernetes is available in Docker for Mac for 18.06 Stable or higher and includes a Kubernetes server and client, as well as integration with the Docker executable. The Kubernetes server runs locally within your Docker instance and it is similar to the Docker on Windows solution.

How do I deploy ingress?

How to deploy NGINX Ingress Controller on Kubernetes using kubectlPrerequisitesStep 1 - Install NGINX Ingress ControllerStep 2 - Exposing the NGINX Ingress ControllerLoad BalancerNodePortStep 3 - Validate the NGINX Ingress ControllerStep 4 - Exposing Services using NGINX Ingress ControllerConclusionInterested in more ...


1 Answers

Both type LoadBalancer and NodePort work on Docker for Mac Kubernetes. It's a lovely bit of magic, actually. Just hit localhost:[port]. For NodePort, a port is automatically assigned unless specified in the service definition. For type LoadBalancer, it is also specified in the service definition. Note that in using LoadBalancer, the status from kubectl will be shown as <pending> for EXTERNAL-IP but it does work.

This guy notes that it's exposed through vpnkit though I think another source would be helpful:

https://github.com/jnewland/local-dev-with-docker-for-mac-kubernetes

Edit: updated because Kubernetes is now available in stable versions of DfM.

like image 158
citizenrich Avatar answered Nov 16 '22 02:11

citizenrich