Build from Source
Klag is a Java 21 / Vert.x project built with Gradle.
Requirements
Section titled “Requirements”- Java 21 (use SDKMAN if needed:
sdk use java 21.0.9-tem). - Use
./gradlewlocally; CI usesgradledirectly (no wrapper JAR committed).
Common tasks
Section titled “Common tasks”./gradlew compileJava # Compile./gradlew test # Run tests./gradlew assemble # Package (fat JAR)./gradlew run # Run with hot-reloadHelm chart template tests
Section titled “Helm chart template tests”Fast and offline. Lints the chart and renders every values permutation:
./scripts/test-helm-chart.shEnd-to-end tests (k3d + real Kafka)
Section titled “End-to-end tests (k3d + real Kafka)”The canonical integration test spins up a disposable k3d cluster,
deploys a real single-node KRaft Kafka, builds the Klag image from the local
Dockerfile, installs the Helm chart, generates real lag, and asserts Klag exposes it
via /metrics. Nothing is mocked.
./scripts/e2e-test.sh # Full e2e + cleanup./scripts/e2e-test.sh --auto-install # Install k3d/kubectl/helm via Homebrew./scripts/e2e-test.sh --skip-cleanup # Keep the cluster for inspectionKLAG_IMAGE=themoah/klag:0.1.12 ./scripts/e2e-test.sh # Test a published imageKAFKA_IMAGE=apache/kafka:3.7.0 ./scripts/e2e-test.sh # Test an older broker./scripts/e2e-test.sh --cleanup # Delete the test clusterStrimzi compatibility tests
Section titled “Strimzi compatibility tests”See Strimzi:
./scripts/e2e-strimzi-test.shKAFKA_VERSION=4.1.0 ./scripts/e2e-strimzi-test.sh./scripts/e2e-strimzi-matrix.sh 4.1.0 4.2.0Prerequisites: Docker, k3d, helm, kubectl (--auto-install installs via Homebrew). Both
e2e suites run in CI on every PR (.github/workflows/e2e.yml).
Native image
Section titled “Native image”See Native Image for the GraalVM build.