2

Issue:

I want my web-server to have either a Kubernetes config and a Docker-Compose config.

I run them on a MacBook (no native containers support), so at the moment I

  • run docker-compose on Docker Desktop
  • run kubectl on a Minikube VM
    (I stick to Minikube because of the convenient commands like minikube ip & minikube service, that I rely on in my scripts)

This makes slow and inconvenient to switch from one setup to the other (suspend Minikube, start Docker Desktop, rebuild the images, re-run the services; and vice-versa).
They won't share built images or containers, and they run in different environments.


Attempt

I tried running docker-compose on Docker from the Minikube VM.
Works fine, but I cannot connect to the service, because there is no tunnelling or port-forwarding from the Host machine to the Minikube machine
(while compose takes care of the inner forwarding from $(minikube ip):8081 to docker-container-webserver:8080.

Question

How to open the connection from the Host machine (browser) to the container (web-server) running inside Minikube?

I tried minikube tunnel but it didn't seem to help (it is designed to work with Kubernetes LoadBalancer services).

Kamafeather
  • 8,663
  • 14
  • 69
  • 99
  • Which version of Kubernetes did you use? – Mikołaj Głodziak Sep 29 '21 at 11:38
  • It's `v1.20.7`; but it shouldn't matter. The issue is about `docker-compose` over Minikube, regardless of the cluster. – Kamafeather Sep 29 '21 at 15:37
  • Are you sure that properly ports are open? Did you see [this topic](https://stackoverflow.com/questions/40767164/expose-port-in-minikube)? – Mikołaj Głodziak Oct 01 '21 at 10:29
  • Nope sorry, I had to go on with the project and Minikube stopped working on Virtualbox (simply doing `minikube delete && minikube start`); doesn't even provision the VM anymore ‍♂️. I'm fed up with Minikube; it wasted more time than it saved since I started using it; too many hard to diagnose problems and instability; imho one additional layer too much. Maybe there's no way to reach *docker-compose* services, because the VM is focused on running Kubernetes (`minikube tunnel`, `ingress-dns`, port-forwarding). I gave up and am now running either Compose and K8s Cluster via Docker Desktop. – Kamafeather Oct 12 '21 at 14:11

0 Answers0