7.8. Alternative standalone deployment options for Streams for Apache Kafka operators


You can perform a standalone deployment of the Topic Operator and User Operator. Consider a standalone deployment of these operators if you are using a Kafka cluster that is not managed by the Cluster Operator.

You deploy the operators to OpenShift. Kafka can be running outside of OpenShift. For example, you might be using a Kafka as a managed service. You adjust the deployment configuration for the standalone operator to match the address of your Kafka cluster.

7.8.1. Deploying the standalone Topic Operator

This procedure shows how to deploy the Topic Operator as a standalone component for topic management. You can use a standalone Topic Operator with a Kafka cluster that is not managed by the Cluster Operator.

Standalone deployment files are provided with Streams for Apache Kafka. Use the 05-Deployment-strimzi-topic-operator.yaml deployment file to deploy the Topic Operator. Add or set the environment variables needed to make a connection to a Kafka cluster.

The Topic Operator watches for KafkaTopic resources in a single namespace. You specify the namespace to watch, and the connection to the Kafka cluster, in the Topic Operator configuration. A single Topic Operator can watch a single namespace. One namespace should be watched by only one Topic Operator. If you want to use more than one Topic Operator, configure each of them to watch different namespaces. In this way, you can use Topic Operators with multiple Kafka clusters.

Prerequisites

  • You are running a Kafka cluster for the Topic Operator to connect to.

    As long as the standalone Topic Operator is correctly configured for connection, the Kafka cluster can be running on a bare-metal environment, a virtual machine, or as a managed cloud application service.

Procedure

  1. Edit the env properties in the install/topic-operator/05-Deployment-strimzi-topic-operator.yaml standalone deployment file.

    Example standalone Topic Operator deployment configuration

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: strimzi-topic-operator
      labels:
        app: strimzi
    spec:
      # ...
      template:
        # ...
        spec:
          # ...
          containers:
            - name: strimzi-topic-operator
              # ...
              env:
                - name: STRIMZI_NAMESPACE 
    1
    
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.namespace
                - name: STRIMZI_KAFKA_BOOTSTRAP_SERVERS 
    2
    
                  value: my-kafka-bootstrap-address:9092
                - name: STRIMZI_RESOURCE_LABELS 
    3
    
                  value: "strimzi.io/cluster=my-cluster"
                - name: STRIMZI_FULL_RECONCILIATION_INTERVAL_MS 
    4
    
                  value: "120000"
                - name: STRIMZI_LOG_LEVEL 
    5
    
                  value: INFO
                - name: STRIMZI_TLS_ENABLED 
    6
    
                  value: "false"
                - name: STRIMZI_JAVA_OPTS 
    7
    
                  value: "-Xmx=512M -Xms=256M"
                - name: STRIMZI_JAVA_SYSTEM_PROPERTIES 
    8
    
                  value: "-Djavax.net.debug=verbose -DpropertyName=value"
                - name: STRIMZI_PUBLIC_CA 
    9
    
                  value: "false"
                - name: STRIMZI_TLS_AUTH_ENABLED 
    10
    
                  value: "false"
                - name: STRIMZI_SASL_ENABLED 
    11
    
                  value: "false"
                - name: STRIMZI_SASL_USERNAME 
    12
    
                  value: "admin"
                - name: STRIMZI_SASL_PASSWORD 
    13
    
                  value: "password"
                - name: STRIMZI_SASL_MECHANISM 
    14
    
                  value: "scram-sha-512"
                - name: STRIMZI_SECURITY_PROTOCOL 
    15
    
                  value: "SSL"
                - name: STRIMZI_USE_FINALIZERS
                  value: "false" 
    16

    1
    The OpenShift namespace for the Topic Operator to watch for KafkaTopic resources. Specify the namespace of the Kafka cluster.
    2
    The host and port pair of the bootstrap broker address to discover and connect to all brokers in the Kafka cluster. Use a comma-separated list to specify two or three broker addresses in case a server is down.
    3
    The label to identify the KafkaTopic resources managed by the Topic Operator. This does not have to be the name of the Kafka cluster. It can be the label assigned to the KafkaTopic resource. If you deploy more than one Topic Operator, the labels must be unique for each. That is, the operators cannot manage the same resources.
    4
    The interval between periodic reconciliations, in milliseconds. The default is 120000 (2 minutes).
    5
    The level for printing logging messages. You can set the level to ERROR, WARNING, INFO, DEBUG, or TRACE.
    6
    Enables TLS support for encrypted communication with the Kafka brokers.
    7
    (Optional) The Java options used by the JVM running the Topic Operator.
    8
    (Optional) The debugging (-D) options set for the Topic Operator.
    9
    (Optional) Skips the generation of trust store certificates if TLS is enabled through STRIMZI_TLS_ENABLED. If this environment variable is enabled, the brokers must use a public trusted certificate authority for their TLS certificates. The default is false.
    10
    (Optional) Generates key store certificates for mTLS authentication. Setting this to false disables client authentication with mTLS to the Kafka brokers. The default is true.
    11
    (Optional) Enables SASL support for client authentication when connecting to Kafka brokers. The default is false.
    12
    (Optional) The SASL username for client authentication. Mandatory only if SASL is enabled through STRIMZI_SASL_ENABLED.
    13
    (Optional) The SASL password for client authentication. Mandatory only if SASL is enabled through STRIMZI_SASL_ENABLED.
    14
    (Optional) The SASL mechanism for client authentication. Mandatory only if SASL is enabled through STRIMZI_SASL_ENABLED. You can set the value to plain, scram-sha-256, or scram-sha-512.
    15
    (Optional) The security protocol used for communication with Kafka brokers. The default value is "PLAINTEXT". You can set the value to PLAINTEXT, SSL, SASL_PLAINTEXT, or SASL_SSL.
    16
    Set STRIMZI_USE_FINALIZERS to false if you do not want to use finalizers to control topic deletion.
  2. If you want to connect to Kafka brokers that are using certificates from a public certificate authority, set STRIMZI_PUBLIC_CA to true. Set this property to true, for example, if you are using Amazon AWS MSK service.
  3. If you enabled mTLS with the STRIMZI_TLS_ENABLED environment variable, specify the keystore and truststore used to authenticate connection to the Kafka cluster.

    Example mTLS configuration

    # ....
    env:
      - name: STRIMZI_TRUSTSTORE_LOCATION 
    1
    
        value: "/path/to/truststore.p12"
      - name: STRIMZI_TRUSTSTORE_PASSWORD 
    2
    
        value: "TRUSTSTORE-PASSWORD"
      - name: STRIMZI_KEYSTORE_LOCATION 
    3
    
        value: "/path/to/keystore.p12"
      - name: STRIMZI_KEYSTORE_PASSWORD 
    4
    
        value: "KEYSTORE-PASSWORD"
    # ...

    1
    The truststore contains the public keys of the Certificate Authorities used to sign the Kafka and ZooKeeper server certificates.
    2
    The password for accessing the truststore.
    3
    The keystore contains the private key for mTLS authentication.
    4
    The password for accessing the keystore.
  4. If you need to configure custom SASL authentication, you can define the necessary authentication properties using the STRIMZI_SASL_CUSTOM_CONFIG_JSON environment variable for the standalone operator. For example, this configuration may be used for accessing a Kafka cluster in a cloud provider with a custom login module like the Amazon MSK Library for AWS Identity and Access Management (aws-msk_iam-auth).

    The property STRIMZI_ALTERABLE_TOPIC_CONFIG defaults to ALL, allowing all .spec.config properties to be set in the KafkaTopic resource. If this setting is not suitable for a managed Kafka service, do as follows:

    • If only a subset of properties is configurable, list them as comma-separated values.
    • If no properties are to be configured, use NONE, which is equivalent to an empty property list.
    注記

    Only Kafka configuration properties starting with sasl. can be set with the STRIMZI_SASL_CUSTOM_CONFIG_JSON environment variable.

    Example custom SASL configuration

    # ....
    env:
      - name: STRIMZI_SASL_ENABLED
        value: "true"
      - name: STRIMZI_SECURITY_PROTOCOL
        value: SASL_SSL
      - name: STRIMZI_SKIP_CLUSTER_CONFIG_REVIEW 
    1
    
        value: "true"
      - name: STRIMZI_ALTERABLE_TOPIC_CONFIG 
    2
    
        value: compression.type, max.message.bytes, message.timestamp.difference.max.ms, message.timestamp.type, retention.bytes, retention.ms
      - name: STRIMZI_SASL_CUSTOM_CONFIG_JSON 
    3
    
        value: |
          {
            "sasl.mechanism": "AWS_MSK_IAM",
            "sasl.jaas.config": "software.amazon.msk.auth.iam.IAMLoginModule required;",
            "sasl.client.callback.handler.class": "software.amazon.msk.auth.iam.IAMClientCallbackHandler"
          }
      - name: STRIMZI_PUBLIC_CA
        value: "true"
      - name: STRIMZI_TRUSTSTORE_LOCATION
        value: /etc/pki/java/cacerts
      - name: STRIMZI_TRUSTSTORE_PASSWORD
        value: changeit
      - name: STRIMZI_KAFKA_BOOTSTRAP_SERVERS
        value: my-kafka-cluster-.kafka-serverless.us-east-1.amazonaws.com:9098
    # ...

    1
    Disables cluster configuration lookup for managed Kafka services that don’t allow topic configuration changes.
    2
    Defines the topic configuration properties that can be updated based on the limitations set by managed Kafka services.
    3
    Specifies the SASL properties to be set in JSON format. Only properties starting with sasl. are allowed.

    Example Dockerfile with external jars

    FROM strimzi/operator:latest
    
    USER root
    
    RUN mkdir -p ${STRIMZI_HOME}/external-libs
    RUN chmod +rx ${STRIMZI_HOME}/external-libs
    
    COPY ./aws-msk-iam-auth-and-dependencies/* ${STRIMZI_HOME}/external-libs/
    ENV JAVA_CLASSPATH=${STRIMZI_HOME}/external-libs/*
    
    USER 1001

  5. Apply the changes to the Deployment configuration to deploy the Topic Operator.
  6. Check the status of the deployment:

    oc get deployments

    Output shows the deployment name and readiness

    NAME                    READY  UP-TO-DATE  AVAILABLE
    strimzi-topic-operator  1/1    1           1

    READY shows the number of replicas that are ready/expected. The deployment is successful when the AVAILABLE output shows 1.

7.8.2. Deploying the standalone User Operator

This procedure shows how to deploy the User Operator as a standalone component for user management. You can use a standalone User Operator with a Kafka cluster that is not managed by the Cluster Operator.

A standalone deployment can operate with any Kafka cluster.

Standalone deployment files are provided with Streams for Apache Kafka. Use the 05-Deployment-strimzi-user-operator.yaml deployment file to deploy the User Operator. Add or set the environment variables needed to make a connection to a Kafka cluster.

The User Operator watches for KafkaUser resources in a single namespace. You specify the namespace to watch, and the connection to the Kafka cluster, in the User Operator configuration. A single User Operator can watch a single namespace. One namespace should be watched by only one User Operator. If you want to use more than one User Operator, configure each of them to watch different namespaces. In this way, you can use the User Operator with multiple Kafka clusters.

Prerequisites

  • You are running a Kafka cluster for the User Operator to connect to.

    As long as the standalone User Operator is correctly configured for connection, the Kafka cluster can be running on a bare-metal environment, a virtual machine, or as a managed cloud application service.

Procedure

  1. Edit the following env properties in the install/user-operator/05-Deployment-strimzi-user-operator.yaml standalone deployment file.

    Example standalone User Operator deployment configuration

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: strimzi-user-operator
      labels:
        app: strimzi
    spec:
      # ...
      template:
        # ...
        spec:
          # ...
          containers:
            - name: strimzi-user-operator
              # ...
              env:
                - name: STRIMZI_NAMESPACE 
    1
    
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.namespace
                - name: STRIMZI_KAFKA_BOOTSTRAP_SERVERS 
    2
    
                  value: my-kafka-bootstrap-address:9092
                - name: STRIMZI_CA_CERT_NAME 
    3
    
                  value: my-cluster-clients-ca-cert
                - name: STRIMZI_CA_KEY_NAME 
    4
    
                  value: my-cluster-clients-ca
                - name: STRIMZI_LABELS 
    5
    
                  value: "strimzi.io/cluster=my-cluster"
                - name: STRIMZI_FULL_RECONCILIATION_INTERVAL_MS 
    6
    
                  value: "120000"
                - name: STRIMZI_WORK_QUEUE_SIZE 
    7
    
                  value: 10000
                - name: STRIMZI_CONTROLLER_THREAD_POOL_SIZE 
    8
    
                  value: 10
                - name: STRIMZI_USER_OPERATIONS_THREAD_POOL_SIZE 
    9
    
                  value: 4
                - name: STRIMZI_LOG_LEVEL 
    10
    
                  value: INFO
                - name: STRIMZI_GC_LOG_ENABLED 
    11
    
                  value: "true"
                - name: STRIMZI_CA_VALIDITY 
    12
    
                  value: "365"
                - name: STRIMZI_CA_RENEWAL 
    13
    
                  value: "30"
                - name: STRIMZI_JAVA_OPTS 
    14
    
                  value: "-Xmx=512M -Xms=256M"
                - name: STRIMZI_JAVA_SYSTEM_PROPERTIES 
    15
    
                  value: "-Djavax.net.debug=verbose -DpropertyName=value"
                - name: STRIMZI_SECRET_PREFIX 
    16
    
                  value: "kafka-"
                - name: STRIMZI_ACLS_ADMIN_API_SUPPORTED 
    17
    
                  value: "true"
                - name: STRIMZI_MAINTENANCE_TIME_WINDOWS 
    18
    
                  value: '* * 8-10 * * ?;* * 14-15 * * ?'
                - name: STRIMZI_KAFKA_ADMIN_CLIENT_CONFIGURATION 
    19
    
                  value: |
                    default.api.timeout.ms=120000
                    request.timeout.ms=60000

    1
    The OpenShift namespace for the User Operator to watch for KafkaUser resources. Only one namespace can be specified.
    2
    The host and port pair of the bootstrap broker address to discover and connect to all brokers in the Kafka cluster. Use a comma-separated list to specify two or three broker addresses in case a server is down.
    3
    The OpenShift Secret that contains the public key (ca.crt) value of the CA (certificate authority) that signs new user certificates for mTLS authentication.
    4
    The OpenShift Secret that contains the private key (ca.key) value of the CA that signs new user certificates for mTLS authentication.
    5
    The label to identify the KafkaUser resources managed by the User Operator. This does not have to be the name of the Kafka cluster. It can be the label assigned to the KafkaUser resource. If you deploy more than one User Operator, the labels must be unique for each. That is, the operators cannot manage the same resources.
    6
    The interval between periodic reconciliations, in milliseconds. The default is 120000 (2 minutes).
    7
    The size of the controller event queue. The size of the queue should be at least as big as the maximal amount of users you expect the User Operator to operate. The default is 1024.
    8
    The size of the worker pool for reconciling the users. Bigger pool might require more resources, but it will also handle more KafkaUser resources The default is 50.
    9
    The size of the worker pool for Kafka Admin API and OpenShift operations. Bigger pool might require more resources, but it will also handle more KafkaUser resources The default is 4.
    10
    The level for printing logging messages. You can set the level to ERROR, WARNING, INFO, DEBUG, or TRACE.
    11
    Enables garbage collection (GC) logging. The default is true.
    12
    The validity period for the CA. The default is 365 days.
    13
    The renewal period for the CA. The renewal period is measured backwards from the expiry date of the current certificate. The default is 30 days to initiate certificate renewal before the old certificates expire.
    14
    (Optional) The Java options used by the JVM running the User Operator
    15
    (Optional) The debugging (-D) options set for the User Operator
    16
    (Optional) Prefix for the names of OpenShift secrets created by the User Operator.
    17
    (Optional) Indicates whether the Kafka cluster supports management of authorization ACL rules using the Kafka Admin API. When set to false, the User Operator will reject all resources with simple authorization ACL rules. This helps to avoid unnecessary exceptions in the Kafka cluster logs. The default is true.
    18
    (Optional) Semi-colon separated list of Cron Expressions defining the maintenance time windows during which the expiring user certificates will be renewed.
    19
    (Optional) Configuration options for configuring the Kafka Admin client used by the User Operator in the properties format.
  2. If you are using mTLS to connect to the Kafka cluster, specify the secrets used to authenticate connection. Otherwise, go to the next step.

    Example mTLS configuration

    # ....
    env:
      - name: STRIMZI_CLUSTER_CA_CERT_SECRET_NAME 
    1
    
        value: my-cluster-cluster-ca-cert
      - name: STRIMZI_EO_KEY_SECRET_NAME 
    2
    
        value: my-cluster-entity-operator-certs
    # ..."

    1
    The OpenShift Secret that contains the public key (ca.crt) value of the CA that signs Kafka broker certificates.
    2
    The OpenShift Secret that contains the certificate public key (entity-operator.crt) and private key (entity-operator.key) that is used for mTLS authentication against the Kafka cluster.
  3. Deploy the User Operator.

    oc create -f install/user-operator
  4. Check the status of the deployment:

    oc get deployments

    Output shows the deployment name and readiness

    NAME                   READY  UP-TO-DATE  AVAILABLE
    strimzi-user-operator  1/1    1           1

    READY shows the number of replicas that are ready/expected. The deployment is successful when the AVAILABLE output shows 1.

Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る