What is the equivalent of Kubernetes Namespaces on Docker swarm

68 views Asked by At

I'm trying to build a CI/CD pipeline to train myself, in order to do that i want to create a Docker swarm cluster with 3 nodes, 1 manager and 2 workers, I would like to know how can I do to isolate prod and preprod like we can do in kubernetes using namespaces?

1

There are 1 answers

0
Chris Becke On

The stack name is actually a namespace and is even stored as such on labels on containers, services, volumes and networks: com.docker.stack.namespace.

docker stack deploy can be given a list of compose files to deploy into one "stack namespace", or can be called multiple times with a different compose file each time to do partial updates. Obviously you can't use --prune in the latter case.