Health API with legacy HiveMQ Kubernetes Operator

Guide for users looking to integrate and configure the Health API within the legacy HiveMQ Kubernetes Operator with cluster-stateful-set controller template.

 Instructions

  1. Get a local copy of the hivemq-operator Helm chart. This will create a directory “./hivemq-operator" in your working directory:

    helm pull hivemq/hivemq-operator --untar
  2. Go to the ./hivemq-operator/operator-tmpls and make a copy of the cluster-stateful-set.yaml in the same directory:

    cd ./hivemq-operator/operator-tmpls cp cluster-stateful-set.yaml my-cluster-stateful-set.yaml
  3. Update the configuration of the liveness and readiness probe from this:

    readinessProbe: exec: command: - /opt/hivemq/bin/readiness_probe.sh initialDelaySeconds: 3 periodSeconds: 5 livenessProbe: tcpSocket: port: {{ util:getPort(spec, "mqtt").port }} initialDelaySeconds: 15 periodSeconds: 30 failureThreshold: 240

    to this:

  4. Copy the values.yaml file to make updates in it:

  5. Update the hivemq.cofingOverride in the my-values.yaml. Add the block that enables the Health API and the bind address 0.0.0.0:

     

  6. Deploy from the local directory and supply the updated controller template file and updated values.yaml file:

In case the installation process cannot complete, cannot spawn a hivemq pod, check the journalctl on the affected node for errors. To do that, find out which node the pod fails on, ssh to the Kubernetes node, run journalctl -f | grep hivemq and see which error(s) are there.

 Related articles