Expose the URL for a service using the minikube service command
Run the following command to expose the service (this will launch a browser and open the service's URL):
If you are using a remote shell to access Minikube's server,
use the option --url=true to display the Kubernetes service URL instead of opening it in the browser:
Check the service endpoint:
Expose the LoadBalancer external IP address using the minikube tunnel command
Services of type LoadBalancer can be exposed using the minikube tunnel command:
Check the external IP of the LoadBalancer:
The external IP is exposed on the Minikube's host:
The minikube tunnel command should be kept running in a terminal window to keep the external IP of the LoadBalancer exposed.
You can enter Ctrl-C to stop exposing the external IP and clean up the network routes.
This will also clean up the file ~/.minikube/tunnels.json file:
In some cases, if Ctrl-C didn't work properly, you can force cleaning up all orphaned routes left in ~/.minikube/tunnels.json file file:
Mount a host directory into Minikube using the minikube mount command
minikube mount usage:
To allow containers running in Minikube to read/write from/into the host directory,
you have to set properly the following options uid, gid, mode.
Let's say the current user in the host has the uid "1000" and gid "1000":
Let's also say that the Dockerfile is running using the same uid and gid of the host's user:
To mount a local directory from the host into the Minikube, you use the following command: