Expand description
Kill-broker orchestration for the failover scenario.
This module uses the in-cluster kube API through the Job’s
ServiceAccount. That ServiceAccount needs pods: get,list,delete in the
target namespace, and it is mounted only when a failover scenario asks for
it.
partition0_leader resolves the topic metadata first and then maps the
partition leader’s broker id back to the matching StatefulSet pod. If that
metadata probe fails, the caller can fall back to the first broker pod by
name-sort for backwards-compatible smoke runs.
Functions§
- kill_
broker_ pod - Deletes the requested broker pod.
- kill_
first_ broker - Deletes the first broker pod in alphabetical order that matches the stack’s pod-name regex root. This stays as a compatibility wrapper for runs that do not target a partition.
- partition0_
leader_ from_ metadata - Queries the topic metadata and returns partition 0’s current leader broker id.
- try_
client - Discovers an in-cluster Kubernetes client, which uses the in-pod
serviceAccounttoken.