Skip to content

feat(operator)!: remove KatesTest and KafkaCompliance - #675

Merged
bmscomp merged 1 commit into
mainfrom
feat/operator-remove-run-kinds
Nov 15, 2026
Merged

bmscomp merged 1 commit into
mainfrom
feat/operator-remove-run-kinds

Conversation

@bmscomp

@bmscomp bmscomp commented Nov 15, 2026

Copy link
Copy Markdown
Owner

O3b of plans/operator-kates-kind.md. 0.2.0 deprecated both run kinds (D5: deprecate first, remove in 0.3.0), and this removes them. The operator now reconciles the Kates kind alone. 34 files: 232 lines added, 4,139 deleted.

What goes

  • Kinds and CRDs. Both reconcilers, both CRDs and their schema module (wire.rs), the examples, and operator/e2e.sh with its CI step.
  • What existed only for them:
    • The kates-connection Secret lookup and connection.fallback. connection.rs is now just the per-URL client cache the Kates kind uses.
    • The Strimzi Kafka watch, kafka.namespaces, rbac.kafkaNamespaceRole and templates/kafka-reader.yaml.
    • The kates_operator_tests and kates_operator_compliance_rules gauges.
    • Client calls only they made: create, get, cancel, report, compliance, capabilities.
    • The deprecation warning at start, and the kates.io/reconcile-at annotation, which only they read.
  • RBAC. Rules, aggregated roles and the CRD hook's resourceNames lose both kinds. The Secret rule narrows to kates-api-key.
  • CI. The kubeconform step now checks the Kates CRD and refuses an unknown key (replica). The test-request schema leaves the Rust path filter.

Breaking change

  • Values. The chart's schema refuses kafka, connection and rbac.kafkaNamespaceRole, so helm upgrade --reuse-values from 0.2.x fails, naming the key.
  • Upgrade order. The README's new "Upgrading to 0.3.0" gives it: delete the resources while 0.2.x runs (0.3.0 no longer clears a live KatesTest's finalizer), upgrade, then delete the two CRDs. Helm leaves CRDs in place.
  • Scheduled runs. "Replacing the run kinds" (CronJob plus kates CLI) stays, and now reads its key from a Secret of your own.

Proof

  • cargo fmt, clippy -D warnings, cargo test (workspace); crdgen regenerated, so chart/crds holds kates.kates.io.yaml alone; helm lint; both RBAC scopes and watchAnyNamespace render; kubeconform v0.6.7 accepts a valid Kates and refuses replica.
  • Upgrade on a three-node Kind lab running 0.2.x:
    • --reuse-values was refused with additional properties 'kafka', 'connection' not allowed.
    • A clean upgrade went through, the two CRDs deleted cleanly, and the existing three-member Kates stayed Ready with its leader.
  • operator/e2e-kates.sh on that lab: 36/36.
    • A first run failed its three LOAD checks because the lab's Kafka was broken after earlier node-loss tests; Strimzi's topic operator couldn't reach the broker either.
    • After restarting the Kafka pods, a run ended DONE and the e2e passed in full.
  • Not checked locally: cargo deny, which isn't installed here. No dependency was added.

O3b of plans/operator-kates-kind.md: 0.2.0 deprecated both run kinds, and
0.3.0 removes them. The operator now reconciles the Kates kind alone.

Gone with them: both reconcilers and CRDs, their examples and e2e.sh; the
kates-connection Secret and the connection.fallback mount; the Strimzi Kafka
watch, kafka.namespaces, rbac.kafkaNamespaceRole and the kafka-reader Role;
the kates_operator_tests and kates_operator_compliance_rules gauges; the
client calls only they made (create, get, cancel, report, compliance,
capabilities); the deprecation warning at start; the reconcile-at
annotation, which only they read.

BREAKING CHANGE: values setting kafka, connection or rbac.kafkaNamespaceRole
are refused by the chart's schema. Delete every KatesTest and
KafkaCompliance while 0.2.x runs, since 0.3.0 no longer clears a live
KatesTest's finalizer, then upgrade, then delete the two CRDs. The chart
README's "Upgrading to 0.3.0" gives the order.
@bmscomp
bmscomp merged commit ac36927 into main Nov 15, 2026
62 checks passed
bmscomp added a commit that referenced this pull request Nov 16, 2026
…on an empty disk (#679)

* test(operator): print the quorum members' logs when the PostgreSQL handover check fails

The resource is deleted before the workflow's Show the stack step, so a
failed handover left nothing to read. main fails this check on every
run since #675 merged on top of #674.

* fix(quorum): a failed hand-over is retried at the next check, with another member

A leader cut off from PostgreSQL handed over to the next member in
kates.quorum.peers, and a failed transfer counted as a hand-over: the
next try waited 2 minutes. In the e2e that member was the one fenced a
step before; its outbound connections had not recovered, its election
got no votes, and the old leader won the next one. Main has failed the
check on every Operator run since.

A transfer that fails, or after which this member still leads, no
longer starts the 2-minute rest, and the next check, 5 s on, asks the
member after the one that failed.

e2e-node-loss.sh: on two nodes, a follower sharing one gets a new
volume, which the scheduler places on the third, instead of failing.
The anti-affinity is preferred, and a local volume pins a member.

* ci(operator): untaint Kind's control plane for the node-loss test

Kind keeps the control plane's NoSchedule taint when the cluster has
workers, so the three members ran on two nodes and the node-loss test
had no third to spread them over.

* test(operator): print the leader's and the replaced member's logs when it has not caught up

* test(operator): the node-loss test takes a worker without the test database

The test PostgreSQL could share the lost node: every member then lost
it, and the leader handed over by design while the test checked that it
led throughout. The database now prefers the control plane, which the
test never takes, and the lost node is never the database's.

* fix(quorum): a member rebuilt on an empty disk has the leader step down

Ratis 3.3.1's leader keeps the index a member matched before it lost its
disk: it answers the member's INCONSISTENCY nextIndex=0 with heartbeats
from that index, and the member stays at applied index -1 until the
leader changes. A follower whose log is still empty 15 s after it knows
a leader now asks that leader to step down, at most once a minute; the
next leader starts replication over and sends the whole log.

The node-loss e2e checks the leader only while the member is gone, and
gives the catch-up 90 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
bmscomp added a commit that referenced this pull request Nov 16, 2026
Chart and appVersion 0.3.0, and the README's install, verify and pull
commands on it. The chart description drops the run kinds 0.3.0 removes
(#675), and the CronJob example pins kates-tester 1.41.0.

0.2.0 was published before publish-operator.yml attested the chart (#677),
so kates deploy --kates-mode operator refuses it; 0.3.0 is pushed, signed
and attested.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant