<p>I am trying to enable communication between Kubernetes (K8s) pods and a Docker container but I cannot find how to do so on Windows. Help would be greatly appreciated.</p>

<p>Scenario description:</p>

<p>The n K8s pods are composed of one (and only) container: a Go microservice accessed by Postman at this time, itself supposed to access a database.</p>

<p>To enable a load-balanced access to the pods as one, a Kubernetes service is put on top, using a NodePort. So far everything is working.</p>

<p>But the K8s-Pod/Go-microservice &lt;> Docker-container/db part do not see each other. The Go microservice obviously says the "db" cannot be resolved. The container db is itself in a user-defined docker network (called "mynw"); its type is a bridge.</p>

<p>Would anyone know how to acheive this in the simplest way? (I mean without third-party/tierce things, heavy proxy configuration, etc.)</p>

<p>Thanks!</p>

willemavjc
<p>You can create a headless service in k8s, with an endpoint pointing to your database container. Then you have to direct your Go service to use that headless service as the db connection.</p>
