Managing server/client status fully declaratively
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 43
Description
#### Use Case(s)
Like many, I use a fully declarative deployment tool to manage my infrastructure. I found it impossible to degrade a Consul `server` to a mere `client` declaratively, without having to run `consul leave` explicitly.
#### Feature Description
I noticed that changing `/etc/consul.json` from `"server":true` to `"server":false` and restarting the agent would NOT do as expected.
The agent stays a server (e.g. in `consul members`) despite the configuration, and only running `consul leave` fixes it. However, it also has the (documented) side effect of terminating the agent process, so instead of being degraded from server to client, the machine is now completely out of the cluster, and I need to restart the agent manually.
It would be great if there was a way to allow managing the server/non-server status fully declaratively in the config file.
---
If this is already possible, it would be great if it could be documented on:
* https://learn.hashicorp.com/tutorials/consul/add-remove-servers?in=consul/datacenter-operations#add-a-server-with-agent-configuration
* which already mentions how to _add_ servers declaratively (my means of configuration), but now how to remove them that way
* https://www.consul.io/commands/leave, as a link to how to do it declaratively
Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.