-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed as not planned
Description
When using stacks with docker-compose or docker stack deploy (on SwarmKit), services are prefixed with the name of the stack. This came up in the review of #721 (comment)
When deploying a stack to Kubernetes, no prefix is added, which prevents multiple stacks with a service having the same name to be deployed.
For example:
version: '3.4'
services:
web:
image: nginx:alpine$ docker stack deploy -c docker-compose.yml stack1
Stack stack1 was created
Waiting for the stack to be stable and running...
- Service web has one container running
Stack stack1 is stable and runningDeploying the same stack again but with a different name;
$ docker stack deploy -c docker-compose.yml stack2
service web already present in stack named stack1We should either prefix service names (as we do in swarmkit/docker-compose), or automatically use a namespace for each stack, similar to;
$ docker stack deploy --namespace com.docker.stacks.stack2 -c docker-compose.yml stack2