Skip to content

[Question] How to scale up the stack, can I use docker service scale? #264

@danieljfarrell

Description

@danieljfarrell

I have successfully got the stack running on a swarm of 2 Linodes and deployed to staging domain stag.example.com.

Running the command below shows that the various services in the stack stag-example-com have been deployed to different nodes in the swarm,

> docker stack ps stag-example-com
ID                  NAME                                IMAGE                                      NODE                    DESIRED STATE       CURRENT STATE           ERROR               PORTS
zjmpa3qyvtf9        stag-example-com_celeryworker.1     celeryworker:stag                          worker1.example.com     Running             Running 7 minutes ago                       
ych5hat6x4wx        stag-example-com_backend.1          backend:stag                               leader.example.com      Running             Running 7 minutes ago                       
uic3vqy2jly1        stag-example-com_queue.1            rabbitmq:3                                 worker1.example.com     Running             Running 7 minutes ago                       
w66qpin8heyz        stag-example-com_proxy.1            traefik:v2.2                               leader.example.com      Running             Running 7 minutes ago                       
pyygqylsy6ad        stag-example-com_pgadmin.1          dpage/pgadmin4:latest                      worker1.example.com     Running             Running 7 minutes ago                       
o4o84ghdevfp        stag-example-com_frontend.1         frontend:stag                              leader.example.com      Running             Running 7 minutes ago                       
gvo5u3cdyfcj        stag-example-com_flower.1           mher/flower:latest                         worker1.example.com     Running             Running 7 minutes ago                       
y7ta4ekqedk9        stag-example-com_db.1               timescale/timescaledb-postgis:1.7.4-pg12   worker1.example.com     Running             Running 7 minutes ago   

I believe this is because of docker-auto-labels part of the deploy.sh script which assigns services to random nodes.

From what I can tell docker-auto-labels part of the deploy.sh script just added a single label which constrains the database volume stag-example-com_app-db-data to always be on the same node as the database service stag-example-com_db; that's all. So the question is still open, how does this scale?

OK, docker-auto-labels is a bit of red herring.

Normally when I want to scale up a service I would,

  1. add new Linode to the swarm
  2. run docker service <name> scale=3

However, this seems not to be possible with this approach because stag-example-com are already distributed across the stack.

Is the intended way of scaling up the deployed stack?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions