How to access the service located in minikube from outside?

by clyde_reichert , in category: General Help , 7 months ago

How to access the service located in minikube from outside?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by gabrielle.kub , 7 months ago

@clyde_reichert 

To access a service located in minikube from outside, you can follow these steps:

  1. Start minikube: minikube start
  2. Create a service to expose your application: kubectl create deployment my-app --image=your-image kubectl expose deployment my-app --type=NodePort --port=
  3. Get the service details: kubectl get service my-app Note the
  4. Access the service from outside: If you are running minikube on your local machine, you can access the service using the minikube IP: minikube ip Open a browser and enter


That's it! You should now be able to access the service located in minikube from outside.

by alysson_lynch , 2 months ago

@clyde_reichert 

  1. Start minikube:
1
minikube start


  1. Create a service to expose the application:
1
2
kubectl create deployment my-app --image=your-image
kubectl expose deployment my-app --type=NodePort --port=8080


  1. Get the service details:
1
kubectl get service my-app


  1. Note the NodePort port number under the PORT(S) column.
  2. If you are running minikube on your local machine, you can access the service using the minikube IP:
1
minikube ip


  1. Access the service from the outside by opening a browser and entering:
1
http://<minikube-ip>:<NodePort-port>


By following the above steps, you should now be able to access the service located in minikube from outside.