To expose a Minikube cluster to the internet, you can follow these steps:
- Make sure you have Minikube installed and running on your local machine.
- Open a terminal and start the Minikube cluster:
- Enable the Minikube dashboard:
minikube addons enable dashboard
- Open the dashboard in your browser:
This will open the Minikube dashboard in a new browser tab, allowing you to monitor and manage your cluster.
- To expose a specific service to the internet, you can use the kubectl expose command. For example,
kubectl expose deployment/my-app --type=LoadBalancer --name=my-service
This will create a LoadBalancer service in Kubernetes, which will be assigned an external IP address.
- To check the status of the service and get the external IP address, use the command:
kubectl get services
Look for the service you exposed and note down the external IP address.
Note: In a local Minikube cluster, the external IP address might show pending or "
- To access the exposed service from your local machine, you can use the external IP address noted in the previous step. Open your web browser and enter the IP address followed by the port number specified in the service's configuration.
For example, if the external IP address is 192.168.49.2 and the service is listening on port 80, enter http://192.168.49.2:80 in the browser's address bar.
That's it! Your Minikube cluster is now exposed to the internet, and you can access the services from your local machine using the external IP address.