Put etcd and Patroni's API on TLS, and move a running cluster there in maintenance mode

Members' etcd speaks TLS to peers and clients with a certificate from the
cluster's authority and asks clients for one; Patroni reaches it with the
member's certificate and serves its API over TLS. A running plain-HTTP
cluster is moved with Patroni paused, so PostgreSQL serves throughout:
Patroni's lease-free keys are carried over to the new etcd.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-04 12:07:17 +02:00
1 parent fed8c75c6c
commit 191c65e3db
12 files changed
+730 -105

No files matched your search

+1
View File
@@ -352,6 +352,7 @@ func (sa *serverAdd) storeAccess(ctx context.Context) error {
if b, err := os.ReadFile(patroniRestFile(sa.etcDir)); err == nil { //nolint:gosec // our own secret
rest = strings.TrimSpace(string(b))
}
_ = pgha.SetRESTCA(filepath.Join(sa.etcDir, "ca.pem"))
changed, err := pgha.AllowClient(ctx, hosts, sa.ip, rest)
if err != nil {
return err