Files
cozystack/packages/core
Aleksei Sviridkin af0db99c71 feat(platform): move Strimzi resources to the v1 API before Strimzi 1.x
Strimzi 1.0 removed v1beta2 from its CRDs, and the API server refuses
a CRD that drops a version its status still lists as stored. Every
stored object has to be rewritten as v1 before the new operator
arrives, which needs the CRDs of Strimzi 0.49 to 0.51 that serve both
versions and Strimzi's own conversion tool. The 0.45 operator is
stopped first: Strimzi supports the conversion only under an operator
that knows v1, and 0.45 keeps rewriting the Kafka status through
v1beta2. The conversion Job's ClusterRole can patch CRDs and write
ConfigMaps in every namespace, so it goes with its binding and
ServiceAccount once the Job has finished, successfully or not; a
failed Job stays for diagnosis, and a Job still running when the wait
times out keeps them, because the retry waits for that Job.

Two references to v1beta2 outlive the stored objects. Helm builds the
objects of a release before it upgrades or uninstalls it, so every
stored revision of every Kafka application is rewritten to v1. And the
API server refuses server-side apply to an object whose managedFields
still name a version the CRD no longer serves; when helm-controller
recovers by wiping them, a field a later chart drops is never removed.
Those entries move to v1 as well. A Helm action already running stores
the releases it read when it finishes, v1beta2 included, so the version
is not stamped while any Kafka release revision is still pending.

Strimzi 1.x also runs neither ZooKeeper nor Kafka 3.x. A ZooKeeper
cluster, or a shared broker pool still being drained, left by a
platform that moved past v1.7 before its ZooKeeper to KRaft migration
finished cannot be finished afterwards, so the migration stops
instead; Kafka applications on v3.8 or v3.9 move to v4.3. The
migration also stops, before it changes anything, while a Kafka
application topic or a KafkaTopic sets a config Kafka 4 removed or a
segment.bytes below the 1 MiB minimum of Kafka 4: the new kafka chart
refuses to render such a topic, and a Kafka 4 broker whose log holds
the small segment.bytes does not start. segment.bytes is read the way
Kafka reads it: trimmed, with an optional sign, leading zeros decimal.

Strimzi's conversion tool refuses some v1beta2 objects outright, and
convert-resource stops at the first one, with the operators already
stopped. While v1beta2 is served the migration lists every Strimzi
kind first and refuses, naming each object and the reason, before it
stops anything. The list follows the 0.51.0 tool the conversion Job
runs, and a test fails when that image changes.

The conversion deletes the Kafka's KRaft metadata state, and KRaft is
the state Strimzi never leaves. Before it stops the operators, the
migration records an annotation on every Kafka it accepts, so a retry
after the conversion still accepts a NotReady Kafka that passed on
its KRaft state.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-17 12:02:45 +03:00
..