Chapter 119. KafkaMirrorMakerSpec schema reference
Used in: KafkaMirrorMaker
Full list of KafkaMirrorMakerSpec
schema properties
Configures Kafka MirrorMaker.
119.1. include
Use the include
property to configure a list of topics that Kafka MirrorMaker mirrors from the source to the target Kafka cluster.
The property allows any regular expression from the simplest case with a single topic name to complex patterns. For example, you can mirror topics A and B using A|B
or all topics using *
. You can also pass multiple regular expressions separated by commas to the Kafka MirrorMaker.
119.2. KafkaMirrorMakerConsumerSpec
and KafkaMirrorMakerProducerSpec
Use the KafkaMirrorMakerConsumerSpec
and KafkaMirrorMakerProducerSpec
to configure source (consumer) and target (producer) clusters.
Kafka MirrorMaker always works together with two Kafka clusters (source and target). To establish a connection, the bootstrap servers for the source and the target Kafka clusters are specified as comma-separated lists of HOSTNAME:PORT
pairs. Each comma-separated list contains one or more Kafka brokers or a Service
pointing to Kafka brokers specified as a HOSTNAME:PORT
pair.
119.3. logging
Kafka MirrorMaker has its own configurable logger:
-
mirrormaker.root.logger
MirrorMaker uses the Apache log4j
logger implementation.
Use the logging
property to configure loggers and logger levels.
You can set the log levels by specifying the logger and level directly (inline) or use a custom (external) ConfigMap. If a ConfigMap is used, you set logging.valueFrom.configMapKeyRef.name
property to the name of the ConfigMap containing the external logging configuration. Inside the ConfigMap, the logging configuration is described using log4j.properties
. Both logging.valueFrom.configMapKeyRef.name
and logging.valueFrom.configMapKeyRef.key
properties are mandatory. A ConfigMap using the exact logging configuration specified is created with the custom resource when the Cluster Operator is running, then recreated after each reconciliation. If you do not specify a custom ConfigMap, default logging settings are used. If a specific logger value is not set, upper-level logger settings are inherited for that logger. For more information about log levels, see Apache logging services.
Here we see examples of inline
and external
logging. The inline
logging specifies the root logger level. You can also set log levels for specific classes or loggers by adding them to the loggers property.
apiVersion: kafka.strimzi.io/v1beta2 kind: KafkaMirrorMaker spec: # ... logging: type: inline loggers: mirrormaker.root.logger: INFO log4j.logger.org.apache.kafka.clients.NetworkClient: TRACE log4j.logger.org.apache.kafka.common.network.Selector: DEBUG # ...
Setting a log level to DEBUG
may result in a large amount of log output and may have performance implications.
apiVersion: kafka.strimzi.io/v1beta2 kind: KafkaMirrorMaker spec: # ... logging: type: external valueFrom: configMapKeyRef: name: customConfigMap key: mirror-maker-log4j.properties # ...
Garbage collector (GC)
Garbage collector logging can also be enabled (or disabled) using the jvmOptions
property.
119.4. KafkaMirrorMakerSpec
schema properties
Property | Property type | Description |
---|---|---|
version | string | The Kafka MirrorMaker version. Defaults to the latest version. Consult the documentation to understand the process required to upgrade or downgrade the version. |
replicas | integer |
The number of pods in the |
image | string |
The container image used for Kafka MirrorMaker pods. If no image name is explicitly specified, it is determined based on the |
consumer | Configuration of source cluster. | |
producer | Configuration of target cluster. | |
resources | CPU and memory resources to reserve. | |
whitelist | string |
The |
include | string |
List of topics which are included for mirroring. This option allows any regular expression using Java-style regular expressions. Mirroring two topics named A and B is achieved by using the expression |
jvmOptions | JVM Options for pods. | |
logging | Logging configuration for MirrorMaker. | |
metricsConfig | Metrics configuration. | |
tracing | The configuration of tracing in Kafka MirrorMaker. | |
template |
Template to specify how Kafka MirrorMaker resources, | |
livenessProbe | Pod liveness checking. | |
readinessProbe | Pod readiness checking. |