-
Notifications
You must be signed in to change notification settings - Fork 2
docs: add procedure for reconfiguring etcd mode (server ↔ client) #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tsivaprasad
wants to merge
2
commits into
main
Choose a base branch
from
PLAT-315-ability-to-reconfigure-a-hosts-etcd-configuration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| # Etcd Mode Reconfiguration | ||
|
|
||
|
|
||
| This guide explains how to change a Control Plane host's etcd mode after cluster initialization. | ||
|
|
||
|
|
||
| ## Overview | ||
|
|
||
|
|
||
| The Control Plane supports two etcd modes: | ||
|
|
||
|
|
||
| - **Server mode**: Runs an embedded etcd server and participates as a voting member | ||
| - **Client mode**: Connects to the etcd cluster as a client only | ||
|
|
||
|
|
||
| **Recommended topology:** | ||
| - 1-3 hosts: All should be etcd servers | ||
| - 4-7 hosts: 3 etcd servers, rest as clients | ||
| - 8+ hosts: 5 etcd servers, rest as clients | ||
|
|
||
|
|
||
| !!! warning "Maintain Odd Numbers" | ||
| Etcd requires an **odd number** of servers (3 or 5) for proper quorum. | ||
|
|
||
|
|
||
| ## How It Works | ||
|
|
||
|
|
||
| Etcd mode reconfiguration is **fully automatic**: | ||
|
|
||
|
|
||
| 1. Stop the container | ||
| 2. Update `PGEDGE_ETCD_MODE` environment variable | ||
| 3. Restart the container | ||
| 4. The system automatically handles all cluster operations | ||
|
|
||
|
|
||
| **What happens automatically:** | ||
| - **Client→Server**: Discovers cluster, obtains credentials, joins as voting member | ||
| - **Server→Client**: Removes itself from membership, transitions to client mode | ||
|
|
||
|
|
||
| No manual API calls or configuration needed! | ||
|
|
||
|
|
||
| ## Procedures | ||
|
|
||
|
|
||
| ### Promoting a Client to Server (Example - host-4) | ||
|
|
||
|
|
||
| ```bash | ||
| # 1. Stop the container | ||
| docker stop control-plane-host-4 | ||
|
|
||
|
|
||
| # 2. Update docker-compose.yaml environment: | ||
| PGEDGE_ETCD_MODE: server # was: client | ||
|
|
||
|
|
||
| # 3. Restart | ||
| docker-compose up -d host-4 | ||
|
|
||
|
|
||
| # 4. Verify (check logs) | ||
| docker logs control-plane-host-4 | ||
| ``` | ||
|
|
||
|
|
||
| ### Demoting a Server to Client (Example - host-4) | ||
|
|
||
|
|
||
| !!! warning "Quorum Check" | ||
| Ensure at least 2 other healthy servers remain before demotion. | ||
|
|
||
|
|
||
| ```bash | ||
| # 1. Stop the container | ||
| docker stop control-plane-host-4 | ||
|
|
||
|
|
||
| # 2. Update docker-compose.yaml environment: | ||
| PGEDGE_ETCD_MODE: client # was: server | ||
|
|
||
|
|
||
| # 3. Restart | ||
| docker-compose up -d host-4 | ||
|
|
||
|
|
||
| # 4. Verify (check logs) | ||
| docker logs control-plane-host-4 | ||
| ``` | ||
|
|
||
|
|
||
| ## Troubleshooting | ||
|
|
||
|
|
||
| ### Promotion Issues | ||
|
|
||
|
|
||
| **Problem**: Host fails to join cluster | ||
| **Solution**: Check logs for connection errors. Verify network connectivity and that other hosts are healthy. | ||
|
|
||
|
|
||
| **Problem**: "Permission denied" errors | ||
| **Solution**: System automatically obtains new credentials. If issue persists, check RBAC is enabled on cluster. | ||
|
|
||
|
|
||
| ### Demotion Issues | ||
|
|
||
|
|
||
| **Problem**: Host fails to remove itself from membership | ||
| **Solution**: Check remaining servers have quorum. System continues transition even if removal fails. | ||
|
|
||
|
|
||
| **Problem**: Old data directory persists | ||
| **Solution**: System automatically cleans up etcd directory. If persists, manually remove after verifying host transitioned. | ||
|
|
||
|
|
||
| ### General Troubleshooting | ||
|
|
||
|
|
||
| Check cluster health: | ||
|
|
||
|
|
||
| ```bash | ||
| docker exec control-plane-host-1 etcdctl member list | ||
| ``` | ||
|
|
||
|
|
||
| All members should show `STATUS=started`. | ||
|
|
||
|
|
||
| ## Best Practices | ||
|
|
||
|
|
||
| - **Change one host at a time** - Wait for completion before reconfiguring another | ||
| - **Monitor cluster health** - Verify all servers healthy before/after changes | ||
| - **Maintain odd numbers** - Always keep 3 or 5 etcd servers, never 2 or 4 | ||
|
|
||
| ## Summary | ||
|
|
||
|
|
||
| Etcd mode reconfiguration is fully automatic - just update the environment variable and restart. The Control Plane handles all cluster operations including credential provisioning, membership changes, and configuration updates without manual intervention. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.