Skip to content

docs(book): Recipe 7 gates a CI pipeline on Kafka, on either install mode - #443

Merged
bmscomp merged 1 commit into
mainfrom
docs/ci-recipe
Oct 21, 2026
Merged

bmscomp merged 1 commit into
mainfrom
docs/ci-recipe

Conversation

@bmscomp

@bmscomp bmscomp commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Why

After #439 and #441 there are two ways to install Kates. A cluster admin installs it cluster-wide with chaos, and a team with only edit installs it in its own namespace (rbac.scope=namespace). The book covered CI only in pieces: test apply --wait in Scenario Files, --fail-on-sla-breach in Chaos Practice, --output-junit in Conformity Checks. Nothing said how a runner reaches the API under either install, or which gates each install can run.

What changes

docs/book/14-recipes.md gains Recipe 7: Gate a CI Pipeline on Kafka, plus its row in the recipes table, an intro bullet and a Summary bullet. The recipe covers:

  • Which gates each install mode can run: scenario gates, kates gate, the conformity check, and the chaos SLA, which needs a cluster-wide install with a chaos provider.

  • Reaching the API:

    • an in-cluster runner uses the Service URL;
    • an outside runner goes through an Ingress, or through kubectl port-forward, which edit allows.

    The chart's NetworkPolicy admits port 8080 from any namespace.

  • The API key: from the kates-api-key Secret, or your own Secret via apiKey.existingSecret. The CLI reads KATES_URL and KATES_API_KEY ahead of any context, so the runner needs no config file.

  • A scenario file with LOAD and INTEGRITY gates, and every gate command's exit codes.

  • A GitHub Actions workflow:

    • installs a pinned CLI and verifies it against the release's checksums.txt;
    • port-forwards to the API, runs each gate as its own step, and uploads the JUnit reports;
    • runs the chaos gate only when the repository variable KATES_CHAOS is true.
  • Limits:

    • no chaos under namespace scope;
    • conformity rules that come back UNKNOWN there;
    • the conformity check needs a 1.27.0+ API;
    • a cancelled job leaves a disruption plan running.

Evidence

  • Live on panda, with only KATES_URL and KATES_API_KEY set and no CLI config:
    • kates test apply -f kafka-gates.yaml --wait -o json exited 1: LOAD broke p99=1484ms > 500ms, while INTEGRITY met all three integrity gates.
    • kates report export <id> --format junit wrote JUnit for both runs.
    • kates gate --min-grade C exited 1, with grade F on the Kind lab.
    • The lab's older native image answered the conformity check with a 404, and the CLI exited 2, which the Limits section describes. The conformity check itself was verified on 1.27.0+ in feat(chart,conformity): rbac.scope=namespace runs tests and conformity checks without cluster admin #439.
  • actionlint passes on the recipe's workflow.
  • Format check: checksums.txt is the concatenated shasum -a 256 lines (release.yml), which the install step's grep | sha256sum -c matches.
  • Fact-check: four checkers went through every claim, each followed by a skeptic that tried to refute what it reported. Five findings survived, all fixed in this PR:
    • --fail-on-sla-breach exits 0 for a plan without an sla block, or one that ends PARTIAL or FAILED, so the recipe says to give the plan an sla;
    • exec in the test step, so cancelling the job reaches kates and cancels the run;
    • a chaos gate needs a chaos provider;
    • monitoring.podMonitor can also be UNKNOWN under namespace scope;
    • the "two recipes disrupt" count in the intro was stale.
  • Book: check-book-style.sh passes, the metrics ratchet doesn't rise, and a scratch Quarto render shows no warnings.

Not done

  • The workflow hasn't run on GitHub itself. The recipe's step that keeps a port-forward running from one step into the next relies on documented GitHub Actions behaviour, and I haven't tried it.
  • The chaos gate wasn't run live, because it disrupts the lab. Its exit codes come from cli/cmd/disruption.go and the Kates API's orchestrator.

…mode

How a runner reaches the Kates API (in-cluster Service, Ingress or a
port-forward with edit rights), where the API key comes from and that
KATES_URL and KATES_API_KEY need no CLI config, a scenario file with LOAD
and INTEGRITY gates, each gate command's exit codes, and a GitHub Actions
workflow that installs a pinned, checksum-verified CLI. The chaos gate runs
only on a cluster-wide install with a chaos provider, and fails only on a
breached sla block. Outcomes were captured on panda; the workflow passes
actionlint.
@bmscomp
bmscomp merged commit b30120f into main Oct 21, 2026
55 checks passed
bmscomp added a commit that referenced this pull request Oct 21, 2026
…dminless plan with what shipped (#444)

The book teaches the conformity language in its Conformity Checks
chapter, but had no place that lists every field, value kind, rule id,
report field and lint code. A new appendix does, after the version
matrix; the chapter, the CLI Reference, the Reference part's intro and
the README point to it.

It is written against main as of #443:
- a key set twice to the same value is a lint error that fmt fixes (#437);
- with rbac.scope=namespace, zones, skew and rack awareness read the
  EndpointSlices of the brokers' headless Service when nodes can't be
  listed, and podMonitor looks in the Kafka namespace only (#439);
- a refused get of the Kafka resource is a 503 naming the grant (#439),
  which the API Reference now says too;
- the chart sets the checked namespace and cluster from
  networkPolicy.kafka.namespace and kafka.clusterName (#441).

plans/adminless-kubernetes.md is the plan behind #439, with a status
block naming what shipped in #439 and #441-#443, where the work departed
from it (EndpointSlice zones; orphan recovery left on), and what is
still open.
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