Members keep trusting the CA they started with after ca.crt changes in the TLS Secret

Aperta
#381 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, kubernetes

Direzione di ricerca

The issue names the client CA flags --trusted-ca-file and --peer-trusted-ca-file, which are loaded once at member startup, and the TLS Secret's ca.crt. Start by finding where the operator builds those flags and where it computes pod annotations for its existing rollout logic. Done would mean a CA change in the Secret triggers a one-at-a-time member roll, and a condition reports when a running member's trusted CA differs from its Secret. This is design work and needs maintainer input first.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

etcd reloads its serving certificate on every handshake, but builds the client CA pool (--trusted-ca-file, --peer-trusted-ca-file) once at startup. When ca.crt in the TLS Secret changes, a running member keeps verifying clients against the old CA, while members started afterwards use the new one. The cluster ends up with members that reject each other's clients, and nothing restarts the old members.

How it happened

The CA was re-issued once shortly after install, but the leaf certificates issued by the first CA were not re-issued at that time, so everything kept working on the first CA for two months. When the leaves were renewed, the Secrets switched to the new CA:

  • a member running since before the renewal served the new certificate but still accepted only clients signed by the old CA (remote error: tls: unknown certificate authority for every new connection, including the local etcdctl);
  • members started after the renewal trusted only the new CA;
  • long-lived clients with old certificates kept working over existing connections, new connections failed.

It surfaced during a site partition: leadership could not be moved off the stale member, and an apiserver on the other side crash-looped. Deleting the stale member's pod fixed it.

Proposal

When ca.crt (or the peer CA) in a member's TLS Secrets changes, roll the members one at a time, waiting for each to rejoin healthy before the next, the same way a spec change would. A checksum of the referenced CA bundles in the pod annotations would make the change visible to the existing rollout logic.

A related check that would have caught this early: report a condition when the CA a running member trusts differs from the one in its Secret.

Lingua principale
Go
Stelle
154
Fork
31
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cozystack/etcd-operator

Tutte le issue di cozystack/etcd-operator

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.