Score:0

How to switch from docker swarm to kubernetes?

uz flag

We have a docker swarm setup on four aws ec2 ubuntu machines. Two of them acting as managers.

Now, instead of managing ourselves, we want to port to a managed service like aks/eks for kubernetes.

I am not able to find any so far, so thought to migrate our work loads to kubernetes.

As part of that, we are running docker service command for different databases so that whenever a test database is required(postgres,oracle,mysql,etc) we run a command in docker swarm to create a service and we get a random port which we connect using the manager public ip.

Example:

for postgres:

docker service create --name postgres_31 -p target=5432 -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_USER=admin -e POSTGRES_DB=testdb -d postgres:9.6.18

The above will create a random port for postgres for 5432 port

like below it generated 30048

So, the user connects with public ip of manager node and port 30048 which will redirect to 5432 port of database.

docker service ls
p45fazswicxc        postgres_31         replicated          1/1                 postgres:13                                  *:30048->5432/tcp

In this way, we used to create multiple databases of postgres (or other databases) on swarm (for testing purposes for dev team).

How to replicate this environment on kubernetes?

In kubernetes, it seems it generates separate public IP for the load balancer type service for each deployment, but we need a single one. I thought of keeping an azure load balancer externally and redirect all, but the configuration is for http only I guess and can be only for a single port not with multiple random ports, correct me if I am wrong.

Daigo avatar
ao flag
Do you mean you need a single IP:PORT that points to multiple containers?
uday kiran avatar
uz flag
IP is same, port changes
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.