Quick start

Run kaf-mirror with Docker or Helm.

These commands are copied from the README. Paste them from a clone of the repository. The published v1.3.1 image does not include the password file location or the image listen-address change, so build from this repository until a newer tag is published.

1. Run locally with Docker

Start the app and two local Kafka brokers from the repo root:

make dev-up   # uses docker compose

The UI and API are at http://localhost:8080. The compose file uses configs/docker.yml, which binds 0.0.0.0 so the published port answers. Production requires TLS unless server.allow_insecure is set.

Data and logs are in the Docker volumes kaf-mirror_kaf-mirror-data (/app/data) and kaf-mirror_kaf-mirror-logs (/app/logs). They are kept when the container restarts or is recreated.

On first start, the server seeds roles and permissions and creates admin@localhost with a random password. The password is not printed. The server writes it to a file named kaf-mirror-bootstrap-<random> in the database directory and prints the file path in the log. In the container that directory is /app/data. Read the password, deliver it securely, then delete the file:

docker compose -p kaf-mirror logs kaf-mirror | grep "Password File"
docker compose -p kaf-mirror exec kaf-mirror sh -c 'cat /app/data/kaf-mirror-bootstrap-*'
docker compose -p kaf-mirror exec kaf-mirror sh -c 'rm /app/data/kaf-mirror-bootstrap-*'

Stop and clean. This also deletes the data and log volumes:

make dev-down

If you need to recreate roles or bootstrap again when the DB is empty:

docker compose -p kaf-mirror exec kaf-mirror ./admin-cli repair

To reset the initial admin password, admin-cli writes the new password to /tmp/kaf-mirror-admin-reset-<random> in the container and prints that path:

docker compose -p kaf-mirror exec kaf-mirror ./admin-cli reset-admin-password admin@localhost
docker compose -p kaf-mirror exec kaf-mirror sh -c 'cat /tmp/kaf-mirror-admin-reset-*'
docker compose -p kaf-mirror exec kaf-mirror sh -c 'rm /tmp/kaf-mirror-admin-reset-*'

1b. Run an image you build

Until a newer tag is published, build and run locally. Keep /app/data and /app/logs on named volumes so they survive a restart or a new container:

docker build -t kaf-mirror:local .
docker run -d --name kaf-mirror -p 8080:8080 \
  -v kaf-mirror-data:/app/data \
  -v kaf-mirror-logs:/app/logs \
  kaf-mirror:local

make docker-run does the same, in the foreground, with the local kaf-mirror:latest tag. After a newer image is published, replace kaf-mirror:local with ghcr.io/scalytics/kaf-mirror:<tag>. You can also use the latest tag once it includes this change:

docker pull ghcr.io/scalytics/kaf-mirror:latest

The UI and API will be at http://localhost:8080:

curl -s http://localhost:8080/health

Stop the container with docker stop -t 45 kaf-mirror, so it has time to stop its jobs.

The image sets KAF_MIRROR_SERVER_HOST=0.0.0.0, so the server listens on all container interfaces. The image runs in development mode. If you mount a config with mode: "production", give it TLS or set server.allow_insecure.

Read the bootstrap admin password, then delete the file:

docker logs kaf-mirror | grep "Password File"
docker exec kaf-mirror sh -c 'cat /app/data/kaf-mirror-bootstrap-*'
docker exec kaf-mirror sh -c 'rm /app/data/kaf-mirror-bootstrap-*'

2. Run with Helm

The Helm chart is in deploy/helm/kaf-mirror. A default install starts and answers /health. The chart's default image tag is v1.3.1. Until a newer tag is published, build the image from this repository, make it available to the cluster, and point the chart at it:

docker build -t kaf-mirror:local .
cat > km-values.yaml <<'VALUES'
image:
  repository: kaf-mirror
  tag: local
  pullPolicy: IfNotPresent
VALUES
helm upgrade --install km deploy/helm/kaf-mirror -f km-values.yaml --wait
kubectl port-forward svc/km-kaf-mirror 8088:8088

Pass -f km-values.yaml first on every later helm upgrade, followed by the values files of the other settings you use. Helm does not keep values from an earlier upgrade, so an upgrade without km-values.yaml goes back to the default image.

In another terminal:

curl -s http://localhost:8088/health

The bootstrap password is written to /app/data/kaf-mirror-bootstrap-<random> on the PVC. Read it with kubectl exec deploy/km-kaf-mirror -- sh -c 'cat /app/data/kaf-mirror-bootstrap-*', then delete the file.

  • TLS: by default the server runs without TLS (config.server.allowInsecure: true). For production, create a TLS Secret, set config.server.tls.existingSecret to its name and config.server.allowInsecure to false.
  • Kafka TLS: for a private CA or mTLS to the brokers, put the files in a Secret and set kafkaTLS.existingSecret. The Secret is mounted at /app/kafka-tls.
  • Tokens: secretEnv sets KAF_MIRROR_AI_TOKEN, KAF_MIRROR_AI_API_SECRET or KAF_MIRROR_MONITORING_SPLUNK_HEC_TOKEN from a Secret key. Do not pass secrets with --set.
  • AI: off by default. Set config.ai.provider to turn it on.
  • Upgrades: the Deployment uses the Recreate strategy, because SQLite on a ReadWriteOnce volume must not be opened by two pods. Keep one replica.

All values are listed in the Helm chart README.