Standalone Debezium

Debezium Operator

qianmoQqianmoQ· 更新于 2026-09-24· 阅读 189 分钟· 0 次阅读

登录后可跨设备保存划线和私人笔记登录

Debezium Operator

Overview

The Debezium Operator is a Kubernetes operator that provides automated deployment and management of Debezium Server instances on Kubernetes and OpenShift platforms. This operator implements the standard Kubernetes operator pattern to transform user-defined DebeziumServer custom resources into running change data capture (CDC) pipelines that stream database changes to various sink systems.

Deploy Debezium Operator using Helm

Helm is the preferred method for installing the operator. The operator is available in the Debezium Helm Chart Repository. You can install the operator to an existing namespace, or to a new namespace.

  1. Enter the following command to create a dedicated namespace:

    kubectl create namespace debezium
  2. Add the Debezium charts repository and install the operator by entering the following command:

    helm repo add debezium https://charts.debezium.io
    helm install my-debezium-operator debezium/debezium-operator --version 3.2.0-final -n debezium

You can find the available versions of the operator in the Debezium Helm Chart Repository.

Tracking the progress of the operator deployment

You can run commands to monitor the progress of the deployment and view the operator log.

Procedure

  • To monitor the progress of the deployment, run the following command:

    kubectl get pod -n debezium --watch
  • To monitor the operator log, enter the following command:

    kubectl logs deployment/debezium-operator -n debezium -f

After the operator is running, it watches for new custom resources and creates a Debezium Server instance that is based on those custom resources.

DebeziumServer custom resource

You specify the configuration for a Debezium Server instance by declaring properties in a DebeziumServer custom resource.

Example 1. Basic structure of the Debezium Server custom resource

apiVersion: debezium.io/v1alpha1
kind: DebeziumServer
metadata:
  name: my-debezium-server
spec:
  image: String
  version: String
  runtime:
    environment:
      vars:
        - name: String
          value: String
      from:  # EnvFromSource array
        - sourceName: String
          # add other EnvFromSource fields as needed
    storage:
      data:
        type: persistent | ephemeral
        claimName: String  # required if type is "persistent"
      external:  # Volume array
        - name: String
          # add other Volume fields as needed
    jmx:
      enabled: boolean
      port: int  # defaults to 1099
    metrics:
      jmxExporter:
        enabled: boolean
      openTelemetry:
        enabled: boolean
        collector:
          endpoint: String
    templates:
      container:
        resources: ResourceRequirements
        securityContext: SecurityContext
      pod:
        metadata:
          annotations:  # Map<String, String>
            key: value
          labels:  # Map<String, String>
            key: value
        imagePullSecrets:  # List
          - name: String
        affinity: Affinity
        securityContext: PodSecurityContext
  quarkus:
    config:
      # quarkus properties
      format:
        value:
          type: String
          config:
            # format properties
      key:
        type: String
        config:
          # format properties
      header:
        type: String
        config:
          # format properties
  transforms:
    - type: String
      predicate: String
      negate: Boolean
      config:
        # transformation properties
  predicates:
    name:
      type: String
      config:
        # predicate properties
  sink:
    type: String
    config:
      # sink properties
  source:
    class: String
    config:
      # source connector properties

DebeziumServer specification

DebeziumServer schema reference

PropertyTypeDefaultDescription
specDebeziumServerSpecNo default valueThe specification of Debezium Server
statusDebeziumServerStatusNo default valueThe status of the Debezium Server instance.

Table 1. DebeziumServer properties

DebeziumServerStatus schema reference

Used in: DebeziumServer

PropertyTypeDefaultDescription
conditionsList<Condition>No default valueList of status conditions
observedGenerationLong0Latest observed generation

Table 2. DebeziumServerStatus properties

Condition schema reference

Used in: DebeziumServerStatus

PropertyTypeDefaultDescription
statusStringNo default valueThe status of the condition, either True, False or Unknown.
messageStringNo default valueHuman-readable message indicating details about the condition’s last transition.
typeStringNo default valueUnique identifier of a condition.

Table 3. Condition properties

DebeziumServerSpec schema reference

Used in: DebeziumServer

PropertyTypeDefaultDescription
imageStringNo default valueImage used for Debezium Server container. This property takes precedence over version.
versionStringsame as operatorVersion of Debezium Server to be used.
sinkSinkNo default valueSink configuration.
sourceSourceNo default valueDebezium source connector configuration.
formatFormatNo default valueMessage output format configuration.
quarkusQuarkusNo default valueQuarkus configuration passed to the Debezium Server process.
runtimeRuntimeNo default valueSpecifies whether you can modify various aspects of the Debezium Server runtime.
transformsList<Transformation>No default valueSingle Message Transformations employed by this instance of Debezium Server.
predicatesMap<String, Predicate>No default valuePredicates employed by this instance of Debezium Server.

Table 4. DebeziumServerSpec properties

Sink schema reference

Used in: DebeziumServerSpec

PropertyTypeDefaultDescription
typeStringNo default valueSink type recognized by this Debezium Server instance.
configMapNo default valueSink configuration properties.

Table 5. Sink properties

Source schema reference

Used in: DebeziumServerSpec

PropertyTypeDefaultDescription
sourceClassStringNo default valueFully qualified name of source connector Java class.
offsetOffsetNo default valueOffset store configuration
schemaHistorySchemaHistoryNo default valueSchema history store configuration
configMapNo default valueSource connector configuration properties.

Table 6. Source properties

Format schema reference

Used in: DebeziumServerSpec

PropertyTypeDefaultDescription
keyFormatTypeNo default valueMessage key format configuration.
valueFormatTypeNo default valueMessage value format configuration.
headerFormatTypeNo default valueMessage header format configuration.

Table 7. Format properties

FormatType schema reference

Used in: Format

PropertyTypeDefaultDescription
typeStringjsonFormat type recognized by Debezium Server.
configMapNo default valueFormat configuration properties.

Table 8. FormatType properties

Quarkus schema reference

Used in: DebeziumServerSpec

PropertyTypeDefaultDescription
configMapNo default valueQuarkus configuration properties.

Table 9. Quarkus properties

Runtime schema reference

Used in: DebeziumServerSpec

PropertyTypeDefaultDescription
apiRuntimeApiNo default valueAPI configuration
storageRuntimeStorageNo default valueStorage configuration
environmentRuntimeEnvironmentNo default valueAdditional environment variables used by this Debezium Server instance.
jmxJmxConfigNo default valueJMX configuration.
templatesTemplatesNo default valueDebezium Server resource templates.
serviceAccountStringNo default valueAn existing service account used to run the Debezium Server pod
metricsMetricsNo default valueMetrics configuration

Table 10. Runtime properties

RuntimeApi schema reference

Used in: Runtime

PropertyTypeDefaultDescription
enabledbooleanNo default valueWhether the API should be enabled for this instance of Debezium Server
portint8080Port number used by the k8s service exposing the API

Table 11. RuntimeApi properties

RuntimeStorage schema reference

Used in: Runtime

PropertyTypeDefaultDescription
dataDataStorageNo default valueFile storage configuration used by this instance of Debezium Server.
externalList<Volume>No default valueAdditional volumes mounted to /debezium/external

Table 12. RuntimeStorage properties

RuntimeEnvironment schema reference

Used in: Runtime

PropertyTypeDefaultDescription
varsList<ContainerEnvVar>No default valueEnvironment variables applied to the container.
fromList<EnvFromSource>No default valueAdditional environment variables set from ConfigMaps or Secrets in containers.

Table 13. RuntimeEnvironment properties

JmxConfig schema reference

Used in: Runtime

PropertyTypeDefaultDescription
enabledbooleanfalseWhether JMX should be enabled for this Debezium Server instance.
portint1099JMX port.
authenticationJmxAuthenticationNo default valueJMX authentication config.

Table 14. JmxConfig properties

JmxAuthentication schema reference

Used in: JmxConfig

PropertyTypeDefaultDescription
enabledbooleanfalseWhether JMX authentication should be enabled for this Debezium Server instance.
secretStringNo default valueSecret providing credential files
accessFileStringjmxremote.accessJMX access file name and secret key
passwordFileStringjmxremote.passwordJMX password file name and secret key

Table 15. JmxAuthentication properties

Templates schema reference

Used in: Runtime

PropertyTypeDefaultDescription
containerContainerTemplateNo default valueContainer template
podPodTemplateNo default valuePod template.
volumeClaimPersistentVolumeClaimSpecNo default valuePVC template for data volume if no explicit claim is specified.

Table 16. Templates properties

Metrics schema reference

Used in: Runtime

PropertyTypeDefaultDescription
jmxExporterJmxExporterNo default valuePrometheus JMX exporter configuration
openTelemetryOpenTelemetryNo default valueOpenTelemetry configuration

Table 17. Metrics properties

JmxExporter schema reference

Used in: Metrics

PropertyTypeDefaultDescription
enabledbooleanNo default valueEnables JMX Prometheus exporter
configFromConfigMapKeySelectorNo default valueConfig map key reference which value will be used as configuration file

Table 18. JmxExporter properties

OpenTelemetry schema reference

Used in: Metrics

When OpenTelemetry is enabled, the operator automatically configures the Debezium Server container with the following environment variables:

  • OTEL_ENABLED — Activates the OpenTelemetry Java Agent bundled with Debezium Server.
  • OTEL_SDK_DISABLED — Set to false to ensure the OpenTelemetry SDK is active.
  • OTEL_EXPORTER_OTLP_ENDPOINT — The OTLP collector endpoint (defaults to http://localhost:4318).
  • OTEL_METRICS_EXPORTER — The metrics exporter type (defaults to otlp).
  • OTEL_SERVICE_NAME — Set to the name of the DebeziumServer resource.
  • OTEL_RESOURCE_ATTRIBUTES — Includes service.name and debezium.connector.type attributes.
  • OTEL_JMX_CONFIG — Points to the built-in JMX-to-OpenTelemetry metrics mapping configuration.

You can override any of these environment variables by specifying them in spec.runtime.environment.vars. User-provided environment variables take precedence over operator-managed defaults.

PropertyTypeDefaultDescription
enabledbooleanfalseEnables OpenTelemetry
collectorOtelCollectorNo default valueOpenTelemetry collector configuration

Table 19. OpenTelemetry properties

OtelCollector schema reference

Used in: OpenTelemetry

PropertyTypeDefaultDescription
endpointStringhttp://localhost:4318OTLP collector endpoint

Table 20. OpenTelemetry collector properties

Transformation schema reference

Used in: DebeziumServerSpec

PropertyTypeDefaultDescription
typeStringNo default valueFully qualified name of Java class implementing the transformation.
configMapNo default valueTransformation specific configuration properties.
predicateStringNo default valueThe name of the predicate to be applied to this transformation.
negatebooleanfalseDetermines if the result of the applied predicate will be negated.

Table 21. Transformation properties

Predicate schema reference

Used in: DebeziumServerSpec

PropertyTypeDefaultDescription
typeStringNo default valueFully qualified name of Java class implementing the predicate.
configMapNo default valuePredicate configuration properties.

Table 22. Predicate properties

ConfigMapOffsetStore schema reference

Used in: Offset

PropertyTypeDefaultDescription
nameStringNo default valueName of the offset config map
configMapNo default valueAdditional store configuration properties.

Table 23. ConfigMapOffsetStore properties

ContainerEnvVar schema reference

Used in: RuntimeEnvironment

PropertyTypeDefaultDescription
nameStringNo default valueThe environment variable name.
valueStringNo default valueThe environment variable value.

Table 24. ContainerEnvVar properties

ContainerTemplate schema reference

Used in: Templates

PropertyTypeDefaultDescription
resourcesResourceRequirementsNo default valueCPU and memory resource requirements.
securityContextSecurityContextNo default valueContainer security context.
probesProbesNo default valueContainer probes configuration.
imagePullPolicyAlways,IfNotPresent,NeverNo default valueImage pull policy for the container.

Table 25. ContainerTemplate properties

CustomStore schema reference

Used in: Offset, SchemaHistory

PropertyTypeDefaultDescription
typeStringNo default valueFully qualified name of Java class implementing the store.
configMapNo default valueStore configuration properties.

Table 26. CustomStore properties

DataStorage schema reference

Used in: RuntimeStorage

PropertyTypeDefaultDescription
typeephemeral,persistentephemeralStorage type.
claimNameStringNo default valueName of persistent volume claim for persistent storage.

Table 27. DataStorage properties

FileOffsetStore schema reference

Used in: Offset

PropertyTypeDefaultDescription
fileNameStringNo default valueName of the offset file (relative to data root)
configMapNo default valueAdditional store configuration properties.

Table 28. FileOffsetStore properties

FileSchemaHistoryStore schema reference

Used in: SchemaHistory

PropertyTypeDefaultDescription
fileNameStringNo default valueName of the offset file (relative to data root)
configMapNo default valueAdditional store configuration properties.

Table 29. FileSchemaHistoryStore properties

InMemoryOffsetStore schema reference

Used in: Offset

PropertyTypeDefaultDescription
configMapNo default valueAdditional store configuration properties.

Table 30. InMemoryOffsetStore properties

InMemorySchemaHistoryStore schema reference

Used in: SchemaHistory

PropertyTypeDefaultDescription
configMapNo default valueAdditional store configuration properties.

Table 31. InMemorySchemaHistoryStore properties

JdbcOffsetStore schema reference

Used in: Offset

PropertyTypeDefaultDescription
tableJdbcOffsetTableConfigNo default valueThe configuration of the offset table
urlStringNo default valueJDBC connection URL
userStringNo default valueUsername used to connect to the storage database
passwordStringNo default valuePassword used to connect to the storage database
retryDelaylongNo default valueRetry delay on connection failure (in milliseconds)
maxRetriesintNo default valueMaximum number of retries on connection failure
configMapNo default valueAdditional store configuration properties.

Table 32. JdbcOffsetStore properties

JdbcOffsetTableConfig schema reference

Used in: JdbcOffsetStore

PropertyTypeDefaultDescription
nameStringNo default valueThe name of the offset table
ddlStringNo default valueDDL statement to create the offset table
selectStringNo default valueStatement used to select from the offset table
insertStringNo default valueStatement used to insert into the offset table
deleteStringNo default valueStatement used to update the offset table

Table 33. JdbcOffsetTableConfig properties

JdbcSchemaHistoryStore schema reference

Used in: SchemaHistory

PropertyTypeDefaultDescription
tableJdbcSchemaHistoryTableConfigNo default valueThe configuration of the offset table
urlStringNo default valueJDBC connection URL
userStringNo default valueUsername used to connect to the storage database
passwordStringNo default valuePassword used to connect to the storage database
retryDelaylongNo default valueRetry delay on connection failure (in milliseconds)
maxRetriesintNo default valueMaximum number of retries on connection failure
configMapNo default valueAdditional store configuration properties.

Table 34. JdbcSchemaHistoryStore properties

JdbcSchemaHistoryTableConfig schema reference

Used in: JdbcSchemaHistoryStore

PropertyTypeDefaultDescription
nameStringNo default valueThe name of the offset table
ddlStringNo default valueDDL statement to create the schema history table
selectStringNo default valueStatement used to select from the schema history table
insertStringNo default valueStatement used to insert into the schema history table
dataExistsSelectStringNo default valueStatement used to check existence of some data in the schema history table

Table 35. JdbcSchemaHistoryTableConfig properties

KafkaOffsetStore schema reference

Used in: Offset

PropertyTypeDefaultDescription
propsMapNo default valueAdditional Kafka client properties.
bootstrapServersStringNo default valueA list of host/port pairs that the connector uses for establishing an initial connection to the Kafka cluster
topicStringNo default valueThe name of the Kafka topic where offsets are to be stored
partitionsintNo default valueThe number of partitions used when creating the offset storage topic
replicationFactorintNo default valueReplication factor used when creating the offset storage topic
configMapNo default valueAdditional store configuration properties.

Table 36. KafkaOffsetStore properties

KafkaSchemaHistoryStore schema reference

Used in: SchemaHistory

PropertyTypeDefaultDescription
bootstrapServersStringNo default valueA list of host/port pairs that the connector uses for establishing an initial connection to the Kafka cluster
topicStringNo default valueThe name of the Kafka topic where offsets are to be stored
partitionsintNo default valueThe number of partitions used when creating the offset storage topic
replicationFactorintNo default valueReplication factor used when creating the offset storage topic
configMapNo default valueAdditional store configuration properties.

Table 37. KafkaSchemaHistoryStore properties

MetadataTemplate schema reference

Used in: PodTemplate

PropertyTypeDefaultDescription
labelsMap<String, String>No default valueLabels added to the Kubernetes resource
annotationsMap<String, String>No default valueAnnotations added to the Kubernetes resource

Table 38. MetadataTemplate properties

Offset schema reference

Used in: Source

PropertyTypeDefaultDescription
fileFileOffsetStoreNo default valueFile backed offset store configuration
memoryInMemoryOffsetStoreNo default valueMemory backed offset store configuration
redisRedisOffsetStoreNo default valueRedis backed offset store configuration
kafkaKafkaOffsetStoreNo default valueKafka backing store configuration
jdbcJdbcOffsetStoreNo default valueJDBC backing store configuration
configMapConfigMapOffsetStoreNo default valueConfig map backed offset store configuration
storeCustomStoreNo default valueArbitrary offset store configuration
flushMslong60000Interval at which to try commiting offsets

Table 39. Offset properties

PodTemplate schema reference

Used in: Templates

PropertyTypeDefaultDescription
metadataMetadataTemplateNo default valueMetadata applied to the resource.
imagePullSecretsList<LocalObjectReference>No default valueList of local references to secrets used for pulling any of the images used by this Pod.
affinityAffinityNo default valuePod affinity rules
securityContextPodSecurityContextNo default valuePod-level security attributes and container settings

Table 40. PodTemplate properties

Probe schema reference

Used in: Probes

PropertyTypeDefaultDescription
initialDelaySecondsint5Number of seconds after the container has started before probes are initiated.
periodSecondsint10How often (in seconds) to perform the probe.
timeoutSecondsint10Number of seconds after which the probe times out.
failureThresholdint3Number of failures in a row before the overall check has failed.

Table 41. Probe properties

Probes schema reference

Used in: ContainerTemplate

PropertyTypeDefaultDescription
readinessProbeNo default valueReadiness probe configuration applied to the container.
livenessProbeNo default valueLiveness probe configuration applied to the container.

Table 42. Probes properties

RedisOffsetStore schema reference

Used in: Offset

PropertyTypeDefaultDescription
addressStringNo default valueRedis host:port used to connect
userStringNo default valueRedis username
passwordStringNo default valueRedis password
sslEnabledbooleanfalseRedis username
keyStringNo default valueRedis hash key
waitRedisStoreWaitConfigNo default valueConfigures verification of replica writes
configMapNo default valueAdditional store configuration properties.

Table 43. RedisOffsetStore properties

RedisSchemaHistoryStore schema reference

Used in: SchemaHistory

PropertyTypeDefaultDescription
addressStringNo default valueRedis host:port used to connect
userStringNo default valueRedis username
passwordStringNo default valueRedis password
sslEnabledbooleanfalseRedis username
keyStringNo default valueRedis hash key
waitRedisStoreWaitConfigNo default valueConfigures verification of replica writes
configMapNo default valueAdditional store configuration properties.

Table 44. RedisSchemaHistoryStore properties

RedisStoreWaitConfig schema reference

Used in: RedisOffsetStore, RedisSchemaHistoryStore

PropertyTypeDefaultDescription
enabledbooleanfalseIn case of Redis with replica, this allows to verify that the data has been written to replica
timeoutMslong1000Timeout in ms when waiting for replica
retrybooleanfalseEnables retry on wait for replica
retryDelayMslong1000Delay of retry on wait

Table 45. RedisStoreWaitConfig properties

SchemaHistory schema reference

Used in: Source

PropertyTypeDefaultDescription
fileFileSchemaHistoryStoreNo default valueFile backed schema history store configuration
memoryInMemorySchemaHistoryStoreNo default valueMemory backed schema history store configuration
redisRedisSchemaHistoryStoreNo default valueRedis backed schema history store configuration
kafkaKafkaSchemaHistoryStoreNo default valueKafka backed schema history store configuration
jdbcJdbcSchemaHistoryStoreNo default valueJDBC backed schema history store configuration
storeCustomStoreNo default valueArbitrary schema history store configuration
configMapNo default valueAdditional common schema history store configuration properties.

Table 46. SchemaHistory properties

Complete Debezium Server configuration example

The following example shows a complete Debezium Server custom resource that incorporates properties from the preceding tables.

Example 2. Complete Debezium server custom resource

apiVersion: debezium.io/v1alpha1
kind: DebeziumServer
metadata:
  name: my-debezium-server
spec:
  version: "3.2.0"
  source:
    class: io.debezium.connector.mysql.MySqlConnector
    config:
      database.hostname: mysql-server
      database.port: 3306
      database.user: debezium
      database.password: secret
      database.server.id: 184054
      topic.prefix: mysql
      database.include.list: inventory
    offset:
      type: kafka
      config:
        bootstrap.servers: kafka:9092
        topic: debezium-offsets
    schemaHistory:
      type: kafka
      config:
        bootstrap.servers: kafka:9092
        topic: debezium-schema-history
  sink:
    type: kafka
    config:
      bootstrap.servers: kafka:9092
  format:
    key:
      type: json
    value:
      type: json
      config:
        schemas.enable: false
  runtime:
    jmx:
      enabled: true
      port: 1099
    storage:
      data:
        type: persistent
        claimName: debezium-data-pvc
    metrics:
      jmxExporter:
        enabled: true
      openTelemetry:
        enabled: true
        collector:
          endpoint: http://otel-collector:4318
  transforms:
    - type: io.debezium.transforms.UnwrapFromEnvelope
      config:
        drop.tombstones: false
      predicate: inventory-filter
      negate: false
  predicates:
    inventory-filter:
      type: org.apache.kafka.connect.transforms.predicates.TopicNameMatches
      config:
        pattern: "mysql.inventory.*"
  quarkus:
    config:
      quarkus.log.level: INFO
      quarkus.http.port: 8080

评论

登录后参与评论

正在加载评论…