lockVariables & Secrets

Control parameters and secrets using the pipeline definition.

circle-exclamation

K2K enables the inclusion of variables in the replication definition, allowing secrets to be injected at runtime without being embedded directly in the pipeline definition. See Variables and Secrets for more details.

This tutorial assumes the following files exist (See Setting up for more details):

name: "my-first-replication"
features:
  autoCreateControlTopics: enabled
  autoCreateTopics: enabled
source:
  kafka:
    common:
      "bootstrap.servers": "kafka-source:9092"
    consumer:
      "group.id": "k2k.my-first-k2k"
target:
  kafka:
    common:
      "bootstrap.servers": "kafka-target:9092"
replication:
  - source:
      topic: ".*"
  - sink:
      topic: source
      partition: source

To ensure a clean start, execute this command to reset any prior configurations from earlier tutorials.

1

Define variables in the pipeline definition

The pipeline file includes two variables that will be substituted when the pipeline is loaded.

2

Add the environment variables to the docker compose

3

Start Kafka Clusters

To start two local Kafka clusters, use this command:

4

Run K2K

Use the following command to run the K2K replicator app:

Was this helpful?