Maybe I am dumb, maybe am I just not using the good words, but I can't find even one answer anywhere on Stackexchange or the whole Web.
I have created lots of website, mostly with Wordpress, Drupal, ...
(And recently, I have begun experiencing with Scala and Go, trying to create a website to gain some knowledge about these languages.)
My DNS provider is mostly DNSMadeEasy.
At first, I was using just one big dedicated server, under Debian, with my different websites just being in different folders, and Nginx, PHP-FPM, ... serving all my websites. Traditional setup.
Then few years ago, I switched to a Docker setup, still on one single host, with one Nginx container, one PHP-FPM container, one MySQL container, ... per website.
And one nginx reverse-proxy container in front of everything, to redirect the visitor of website example.com to the example.com containers.
Either with the traditional setup or the Docker-based setup, I was assigning the IP Address of my host to the A record of my different websites in DNSMadeEasy, and voilà, everything would work as expected.
NOW, I would like to switch from a single-host setup to several-host aka Cluster setup, using Docker Swarm (1.12 Swarm) or Kubernetes, to be able to scale more easily, as this was the purpose of switching to Docker in the first place.
As such, the containers for my different websites will be distributed accross the different hosts of my cluster.
I am planning to use a European cloud running on OpenStack, as I can't (<> privacy laws) and don't want to use (<> too expensive) American clouds like Google Cloud Engine or AWS EC2 (<> Patriot Act <> European Data), so please, don't tell me to use these clouds. I already have been able to setup a Kubernetes cluster, and a Docker Swarm cluster, in this Openstack cloud.
MY QUESTION : What I can't understand, is how do you point your websites DYNAMICALLY to the new services & pods which are automatically created ?
Let's say I have four hosts (1 master & 3 workers).
If I just do Round Robin DNS resolution, putting all the four IP of my four hosts in the A record of my websites so that it goes to any of the four, it will be a nightmare and a total mess, with the cache headers and everything. Moreover, with DNSMadeEasy, they have an API to automatically add and delete records, so I suppose it should be possible to automatically update the A record or the CNAME record of the websites like this plugin does with AWS Route53: https://github.com/wearemolecule/route53-kubernetes? (We can see that this use an external LoadBalancer so I suppose I need an external lb too for my setup, if I should follow that solution ?)
I am aware that both Kubernetes and Docker Swarm use DNS for service discovery, and etcd/consul for registration & election.
But from what I understand, this is used as an internal DNS System, not an external one, no ?
Or should I point the NS to my hosts and use my hosts instead of DnsMadeEasy !!??
Am I missing something ? Am I doing it wrong ?
Please someone help me, I begin to have huge headaches trying to sort things out :)