Is it possible to change manager instance type?

I know the docs say that scaling managers is not currently supported, but is it possible to change the manager instance type? We made a swarm with m4.large managers expecting to use them as workers too, but now we are concerned about resource starvation on manager nodes. If we are no longer using managers as workers, I think we can get by with a much smaller instance type for managers. But I don’t want to have to start over from scratch with a new swarm.

Hi, Tai,

If you are only using the CLI (and not EE), you can demote a manager to a worker by using a command similar to the following:

docker node demote NODE

Once you demote a manager node, it’s generally a good idea to wait a bit for the swarm to propagate the new state across the necessary nodes. Once you’ve demoted a manager and the swarm state is resolved and stable, you can then remove that node from the swarm using a command similar to the following

docker node rm NODE

You can then terminate the instance, spin up a new instance, add it to the cluster, and run the commands needed to join the replacement node to the cluster.

Thanks for this. But I’m not sure how this fits into Docker for AWS, where the number and type of manager and worker nodes are all defined in a CloudFormation template.

If I were to go manually terminating EC2s and manually spinning up new EC2s and manually joining the swarm as a new manager, I imagine that would completely break the Docker for AWS CloudFormation template’s ability to upgrade or properly autoscale?

And how would I even create a new EC2 with the properly configured CloudStor plugin installed and enabled etc?

What I really want to know is, can I just update the CloudFormation template and change the manager instance type and click apply, to have CloudFormation make the changes for me?

I know the docs say that I cannot scale the number of managers this way, but it doesn’t say I can’t update the manager instance type, and it does say I can update the worker instance type (and I’ve done that, and it worked).