Versions Compared

Key

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

...

  1. Create a config map from the configuration file:

    Code Block
    kubectl create configmap 'kafka-config' --from-file='kafka-configuration.xml'
  2. Update the values.yaml file of the hivemq-operator and specify that the Kafka configuration file is taken from the config map:

    Code Block
    hivemq:
    ...
      extensions:
        - name: hivemq-kafka-extension
          extensionUri: preinstalled
          enabled: true
          configMap: kafka-config
          ...
  3. The content of the kafka-config configMap will be mounted by the HiveMQ Operator to directory /conf-override/extensions/hivemq-kafka-extension/<kafka-configuration.xml>. To copy the configuration file to the desired location, add the following initialization script:

    Code Block
    hivemq:
    ...
      extensions:
        - name: hivemq-kafka-extension
          extensionUri: preinstalled
          enabled: true
          configMap: kafka-config
          initialization: |
            [[ -e /conf-override/extensions/hivemq-kafka-extension/kafka-configuration.xml ]] &&
            rm -f $(pwd)/conf/config.xml &&
            cp -s /conf-override/extensions/hivemq-kafka-extension/kafka-configuration.xml $(pwd)/conf/config.xml

  4. Reinstall the HiveMQ Helm chart:

    Code Block
    languagebash
    helm uninstall <releasename>;
    sleep 20;
    helm upgrade <releasename> --install hivemq/hivemq-operator \
       --values path/to/values.yaml
  5. Verify the content of the Kaka Kafka extension’s config.xml on the HiveMQ pod:

    Code Block
    languagebash
    kubectl exec pod/<my hivemq pod> -- cat /opt/hivemq/extensions/hivemq-kafka-extension/conf/config.xml

...