3 ms·
You can do some amazing things based on convention. In kube it's pretty common to use Services for service discovery. Essentially all a Service is is a smart DN
by gravypod 5y ago
You can do some amazing things based on convention. In kube it's pretty common to use Services for service discovery. Essentially all a Service is is a smart DNS name that points to a collection of pods (netns). If you want to mirror that setup you can create a virtual bridge network setup the same docker-compose does which would let you have a container with a hostname of `database` and then `ping database` would resolve to the correct container. To match kube's conventions you could do this: https://kubernetes.io/docs/concepts/services-networking/service/#dns https://kubernetes.io/docs/concepts/services-networking/serv...
Another thing you could do is generate environment variables similar to what kube does: https://kubernetes.io/docs/concepts/services-networking/service/#environment-variables https://kubernetes.io/docs/concepts/services-networking/serv...