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

+6
View File
@@ -196,6 +196,12 @@ func newServerCmd() *cobra.Command {
// Patroni. One host is a single PostgreSQL, which has none.
if addr, err := storepkg.ResolveAddress(cfg.Auth.Store); err == nil && storepkg.IsPostgres(addr) {
if hosts, _, _, err := storepkg.SplitPostgres(strings.TrimSpace(addr)); err == nil && len(hosts) > 1 {
if cfg.AgentTLS.CA != "" {
// Members' APIs, once on TLS, verified against it.
if err := pgha.SetRESTCA(cfg.AgentTLS.CA); err != nil {
log.Warn("the store's API cannot be verified", "err", err)
}
}
storeHA = pgha.NewCollector(hosts)
if err := rt.RegisterMetrics(storeHA); err != nil {
return err