Docker
Run K2K in Docker containers.
Deploy K2K using the official container image. For Kubernetes deployments, use the Helm chart instead.
Prerequisites
Docker installed on the host
At least 1 GB memory per K2K process (2 GB recommended for high-throughput pipelines)
Network access to source and target Kafka clusters
A pipeline YAML file — see Minimal Configuration
Pin the image version to match your Helm chart or release — see Releases and compatibility.
Configure the pipeline
Create a pipeline YAML file (for example pipeline.yaml) that defines source and target cluster connections, replication rules, and feature toggles. See Minimal Configuration for structure and examples.
Keep secrets in a separate overlay file mounted alongside the base pipeline:
k2k start -f /pipelines/base_pipeline.yml -f /pipelines/secrets_overrides.ymlRun the replicator
Mount the directory containing your pipeline files and start the replicator:
docker run --rm -d \
-v "$(pwd):/pipelines" \
-e OTEL_SERVICE_NAME="k2k" \
-e OTEL_METRICS_EXPORTER=otlp \
-e OTEL_EXPORTER_OTLP_ENDPOINT="http://otel-collector:4317" \
--name k2k-replicator \
lensesio/k2k:2.1.0 \
k2k start -f /pipelines/pipeline.yaml -tReplace 2.1.0 with your target version. See Deployment for CLI options and Observability for metrics configuration.
Run the offset mapper
When offset mapping is enabled, run a second container with the same pipeline files:
When features.offsetMapping is enabled, deploy and run both k2k and k2k-offset-mapping. Enabling the feature in the pipeline file does not translate consumer offsets by itself.
See Deployment for when both applications are required.
Validate before production
Test routing and schema handling without writing to the target cluster:
See the Validation checklist for a full pre-deployment workflow.
Resource guidance
Replicator (default)
1–2 GB
Increase for high partition counts or large messages
Offset mapper
512 MB–1 GB
Scales with number of consumer groups translated
Run multiple replicator containers with the same pipeline to scale horizontally — see Horizontal scaling.
Deployment placement
Deploy containers close to the target Kafka cluster to minimize producer latency. See Deployment.
Using k2k-tool
The k2k-tool administration CLI and web UI are included in the same image:
See K2K Standalone Tool.
Last updated
Was this helpful?

