Versions Compared

Key

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

...

  1. Prepare the logback.xml and test it locally first.

  2. Create a ConfigMap from the customized logback.xml:

    Code Block
    languagebash
    kubectl create configmap logback-configuration --from-file logback.xml --namespace hivemq
  3. Add Override the default HiveMQ Logback folder by adding the element to the additionalVolumes env array in the hivemq-platform’s values.yaml. The default Logback folder is /opt/hivemq/conf and the following example will override the default value with /opt/hivemq/logback-my-configuration:

    Code Block
    languageyaml
    additionalVolumesnodes:
      - typeenv:
    configMap    - name: logback-configuration
    HIVEMQ_LOGBACK_CONFIG_FOLDER
       mountName: logback-configuration     containerName: hivemq
        path: value: /opt/hivemq/conf/
        subPath: "logback.xml"
  4. Question: Will it re-write all content of the /opt/hivemq/conf directory in the containers?

  5. Answer: No, it will not if you use the subPath:
    logback-my-configuration
  6. Add the element to the additionalVolumes array in the hivemq-platform’s values.yaml:

    Code Block
    language
    text
    yaml
    #
    additionalVolumes:
      - type: configMap
     
    If
     
    a
     
    volume
     
    is mounted with subPath, then the contents of the directory are not overwritten. #
    name: logback-configuration
        mountName: logback-configuration
        containerName: hivemq
        
    However, note that changes to a configmap, for example, mounted via subPath will not be propagated to the container. # Therefore, pods have to be restarted.
    path: /opt/hivemq/logback-my-configuration
  7. Execute the helm upgrade command to pick up the changes:

    Code Block
    languagebash
    helm upgrade my-broker --install hivemq/hivemq-platform --values hivemq-platform-values.yaml

...