Sidecar: Service Discovery for All Docker Environments
relistan.com
relistan.com
Minikube does this so well: https://github.com/kubernetes/minikube
You can really learn alot rolling your own solutions, but k8s has already solved most of the pain points including service discovery. The great thing about minikube is you can easily apply the same concepts to a thousand node cluster or just your laptop.