Skip to content

operator: harden the Broker controller's adoption and identity handling - #1792

Open
hidalgopl wants to merge 1 commit into
mainfrom
pb/broker-controller-hardening
Open

operator: harden the Broker controller's adoption and identity handling#1792
hidalgopl wants to merge 1 commit into
mainfrom
pb/broker-controller-hardening

Conversation

@hidalgopl

Copy link
Copy Markdown
Contributor

Hardens broker-mode machinery that already ships on main. Broker pods now carry the StatefulSet identity labels so any external tooling can't tell pod-management flavors apart, orphaned pods are adopted on the orphaning event instead of a periodic requeue, and adoption/deletion decisions read through the uncached API reader - with adoption barred while the owner is rolling back, so a cached ghost CR can't grab pods the GC would then silently delete. Also generalizes the rotation-key backfill and introduces the kind constants and V2 annotation parser the guard reads.

Four fixes to broker-mode machinery already on main, one PR ahead of the
V2 Redpanda broker-mode support that exercises them harder:

- Broker pods now carry the StatefulSet identity labels
  (statefulset.kubernetes.io/pod-name, apps.kubernetes.io/pod-index):
  external tooling selects on them and pods must be indistinguishable
  across pod-management flavors.
- Orphaned broker pods are adopted on the orphaning event instead of
  waiting for the periodic requeue.
- Destructive/adoption decisions read through the uncached API reader,
  and pod/PVC adoption is barred while the owner is rolling back (a
  cached ghost CR must not re-adopt pods mid-rollback and leave them
  referencing a deleted owner for the GC to collect silently).
- reconcilePod backfills any missing rotation identity key, not just the
  config checksum.

Also introduces the kind-name constants and the V2 annotation parser the
guard reads (the V2 reconciler itself lands separately).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@secpanda

secpanda commented Sep 1, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants