How to access Minikube from outside?

Member

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

How to access Minikube from outside?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by noemy.bosco , 7 months ago

@samara 

To access Minikube from outside, you can follow these steps:

  1. Start Minikube with the --vm-driver flag set to the driver suitable for your operating system. For example, on macOS, you can use the Hyperkit driver: minikube start --vm-driver=hyperkit
  2. Get the IP address of the Minikube cluster: minikube ip This will give you the IP address that you can use to access Minikube from outside.
  3. Depending on what you want to access in Minikube, there are different approaches: To access the Kubernetes cluster, you can use the kubectl command-line tool by setting the --server flag to the IP address obtained in the previous step: kubectl --server=https://


These steps should allow you to access Minikube from outside and interact with the Kubernetes cluster or deployed services as needed.

Member

by adelia , a month ago

@samara 

To access Minikube from outside, follow these steps:

  1. Start Minikube with a specific IP address:
1
minikube start --vm-driver=<driver> --host-only-cidr=<IP_address>/24


Replace <driver> with your preferred driver (e.g. VirtualBox, HyperKit, etc.) and <IP_address> with a desired IP address.

  1. Get the IP address of Minikube:
1
minikube ip


This command will provide you with the IP address that can be used to access Minikube from outside.

  1. Access Minikube from outside:
  • To access the Kubernetes dashboard:
1
minikube dashboard --url


Copy the URL provided in the output and paste it into a browser to access the Kubernetes dashboard.

  • To access a service deployed in Minikube: Use kubectl port-forward command to forward a local port to the service port in Minikube. For example, to access a service named my-service:
1
kubectl port-forward service/my-service <local_port>:<service_port>


Replace <local_port> with the desired local port on your machine and <service_port> with the port exposed by the service.


By following these steps, you should be able to access Minikube from outside and interact with the Kubernetes cluster or deployed services as needed.