cubesHelm

This page describes installing Standalone K2K in Kubernetes via Helm.

Prerequisites

  • Kubernetes 1.23+

  • Helm 3.8.0+

  • Available local Kafka Clusters

Introduction

The K2K Helm chart deploys two modules onto your Kubernetes cluster:

K2K Replicator -- the core component that continuously replicates Kafka topics from a source cluster to a target cluster. It supports exactly-once delivery, schema replication via Confluent-compatible Schema Registries, flexible topic routing, and automatic topic creation on the target cluster.

Offset Mapper -- an optional companion module that maps consumer group offsets between the source and target clusters. This enables consumers to resume from the correct position on the target cluster after a migration or failover. The Offset Mapper shares the base replicationConfig from K2K and can optionally override specific values (e.g. its own consumer group ID).

Both modules are independently configurable under the k2k and offsetMapper sections in values.yaml. When the Offset Mapper is enabled, the chart enforces that both offsetMapper.enabled: true and k2k.replicationConfig.features.offsetMapping: "enabled" are set together -- omitting either one will cause the chart to fail with a clear error message.

Configure K2K

To configure Lenses K2K properly we have to understand the parameter groups that the Chart offers. Under the k2k parameter there are some key parameter groups that are used to set up HQ:

  1. licence

    • Definition that configures EULA acceptance.

  2. otelConfig

    • Defines metric, traces and log exporters

  3. replicationConfig

    • Defines core K2K configuration file which included:

      • connection to source and destination Kafka Cluster / Schema Registry

      • replication semantics, replication options and many more

Moving forward, in the same order you can start configuring your Helm chart.

1

Configure licence

Before using K2K as a standalone application, you must agree to the End User License Agreement (EULA) and request a free license token by contacting [email protected]. Ensure this section is included in the replicationConfig yaml values:

2

Configure OTEL options

If you would like to monitor your K2K applications and by monitor we mean, export:

  • logs;

  • metrics;

Then you would have to configure following block:

Note: The export functionality for warning logs and traces is currently unavailable.

3

Replication Configuration

The configuration file is in YAML and has 8 basic sections:

  • source: defines the source cluster details (required)

  • target: defined the target cluster details (required)

  • replication: defines the set of topics to replicate and how to replicate (required)

  • coordination: defines the setting for the coordinator, for example, the offsets (required)

  • features: defines the extra functionality, such as exactly once (optional)

  • errorHandling: defines how to handle errors (optional)

  • tracing: defines the open tracing components (optional)

circle-info

More about configuration blocks and descriptions read it here: K2K Replicator

Helm definition of replicationConfig parameter is as an object

Therefore, all the yaml parameters that one can find under the configuration document above can be freely copy/pasted.

circle-check

Example of Kafka2Kafka replicationConfig that can be used.

4

(Optional) Configure Service Accounts

Lenses Kafka2Kafka, by default, uses the default Kubernetes service account but you can choose to use a specific one.

If the user defines the following:

The chart will create a new service account in the defined namespace for Kafka2Kafka to use.

Configure Offset Mapper

To configure Lenses K2K Offset Mapper properly we have to understand the parameter groups that the Chart offers. Under the offsetMapper parameter there are some key parameter groups that are used to set up HQ:

1

Enablement

To enable K2K Offset Mapper following fields have to be set

2

Core Configuration

Because the Offset Mapper is an optional companion module to the K2K it reuses the base k2k.replicationConfig (source/target Kafka connection details, replication settings, etc.) and optionally allows overriding specific values via offsetMapper.overrideConfig.

Therefore if you followed steps to configure K2K connections for the source and target, you do not have to do it again, but maybe just reference Configuration Referencepage for some additional overrides or additions to configuration such as overriding replication configuration in the example below. Only the values you specify in overrideConfig will be overridden. Everything else is inherited from the base K2K replication config.

3

Configure OTEL options

If you would like to monitor your Offset Mapper application, configure the following block:

4

(Optional) Configure Service Account

The Offset Mapper, by default, uses the default Kubernetes service account. To use a specific one

5

Configure Deployment Options

Adjust the Offset Mapper deployment resources based on your workload:

chevron-rightExample of K2K + Offset Mapper deployment via Helm Charthashtag

Add chart repository

First, add the Helm Chart repository using the Helm command line:

Installing K2K & Offset Mapper

circle-info

Be aware that for the time being and for alpha purposes usage of --versionis mandatory when deploying Helm chart through Helm repository.

Last updated

Was this helpful?