I have installed minikube on my ubuntu using docker. I could create the pod and service using nginx image on minikube. However I could not access the service url generated by ‘minikube service --url’ on my local host.
Am i missing something to access url generated using minikube installed using docker on ubuntu laptop?
Any help much appreciated.
minikube v1.28.0 on Ubuntu 20.04
Automatically selected the docker driver. Other choices: none, ssh
Using Docker driver with root privileges
Starting control plane node minikube in cluster minikube
Pulling base image …
…
–minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
minikube-m02
type: Worker
host: Running
kubelet: Running
minikube-m03
type: Worker
host: Running
kubelet: Running
Hello @learn.prabhachandra,
Locally, you can try some options as below:
- Expose your pod using
port-forward
feature
kubectl port-forward pod/nginx 8080:80
Forwarding from 127.0.0.1:8080 -> 80
You can then access it from your host browser
- You can access to the minikube cluster using minikube ssh and curl service IP from there.
nginx-service NodePort 10.97.225.49 <none> 80:30224/TCP 103s
trungtran@Trungs-MacBook-Air ~ % minikube ssh
Last login: Sat Nov 12 03:24:34 2022 from 192.168.49.1
docker@minikube:~$ curl 10.97.225.49
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
Thanks,
Trung.
1 Like
Thanks Trung! I got the solution using 'kubectl port-forward.
I was having problem with minikube ssh. I have minikube with multiple nodes. However it got resolved when i ssh to specific node and curl from there.
Nice, thanks for getting back on that @learn.prabhachandra.