Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a new configMap kafka-config from the config.xml:

    Code Block
    languagebash
    kubectl create configmap kafka-config --from-file config.xml
  2. Edit values.yaml file of hivemq-operator and update section hivemq.extensions, having name: hivemq-kafka-extension
    Update this:

    Code Block
    languageyaml
      extensions:
        - name: hivemq-kafka-extension
          extensionUri: preinstalled
          enabled: false

    To this:

    Code Block
    languageyaml
    extensions:
        - name: hivemq-kafka-extension
          extensionUri: preinstalled
          enabled: true
          configMap: kafka-config
                initialization: |
                  # Fix the location of the config.xml file
                  [[ ! -f conf/config.xml ]] &&
                  [[ -f /conf-override/extensions/hivemq-kafka-extension/config.xml ]] &&
                cp  ln -s /conf-override/extensions/hivemq-kafka-extension/config.xml conf/config.xml
  3. Re-deploy hivemq-operator with updated values.yaml

    Code Block
    languagebash
    helm upgrade hivemq --install hivemq/hivemq-operator --values my-hivemq-values.yaml --namespace hivemq

  4. If everything is correct,

    1. The HiveMQ log contains info about using the correct license:

      Code Block
      languagebash
      kubectl logs deployment/hivemq | grep 'Using valid'
      Code Block
      languagetext
      INFO  - Using valid Enterprise Edition CPU license (hivemq-license.lic) issued to HiveMQ - Internal for max 9999 CPU cores, valid until 2024-03-31.
      INFO  - Using valid license (kafka-license.elic) for enterprise extension with name "HiveMQ Enterprise Extension for Kafka", valid until 2024-03-31.

    2. The HiveMQ log contains info about successful Kafka connection:

      Code Block
      languagebash
      kubectl logs deployments/hivemq -f | grep -i kafka
      Code Block
      languagetext
      INFO  - Starting extension with id "hivemq-kafka-extension" at /opt/hivemq/extensions/hivemq-kafka-extension
      INFO  - No mqtt-to-kafka transformers were found. No mqtt-to-kafka transformers are started.
      INFO  - Started mqtt-to-kafka mapping "mapping01" with MQTT topics [#] and Kafka topic "test" for Kafka Cluster "cluster01"
      INFO  - No kafka-to-mqtt transformers were found. No kafka kafka-to-mqtt transformers are started.
      INFO  - Started kafka-to-mqtt mapping "mapping02" with kafka topic: [test] and kafka pattern: [test-(.)*] for Kafka Cluster "cluster01" (poll duration: 100 ms).
      INFO  - Extension "HiveMQ Enterprise Extension for Kafka" version 4.24.0 started successfully.
      INFO  - Subscribing kafka-to-mqtt topic-mapping with id mapping02 to kafka pattern (test-(.)*|\Qtest\E)
    3. Kafka dashboard is visible in the HiveMQ Control Center:

      image-20240125-145348.png

...