How to use `minikube tunnel` over WSL2 and docker-desktop backend?

Viewed 18

Context

I've a minikube cluster which run into WSL2 context and docker driver (from docker-desktop).

~ » minikube profile list                                                         
|----------|-----------|---------|--------------|------|---------|---------|-------|--------|
| Profile  | VM Driver | Runtime |      IP      | Port | Version | Status  | Nodes | Active |
|----------|-----------|---------|--------------|------|---------|---------|-------|--------|
| minikube | docker    | docker  | 192.168.49.2 | 8443 | v1.24.3 | Running |     1 | *      |
|----------|-----------|---------|--------------|------|---------|---------|-------|--------|

I've setup a LoadBalancer service, then I run minikube tunnel command.

~ » kubectl get svc my-svc-loadbalancer                                         
NAME                  TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
my-svc-loadbalancer   LoadBalancer   10.105.11.182   127.0.0.1     8080:31684/TCP   18h

My problem

When trying to access 127.0.0.1:8080 from my browser, I'm getting a ERR_EMPTY_RESPONSE error code.

What I have noticed:

  • Without minikube tunnel command, accessing to 127.0.0.1:8080 result into a ERR_CONNECTION_REFUSED - which make sense.
  • The same service configuration but as NodePort and minikube service command works and I can access my deployment, but I would like to access it as LoadBalancer.
0 Answers
Related