Guide for users looking to integrate and configure the Health API within the legacy HiveMQ Kubernetes Operator with cluster-stateful-set controller template.
\uD83D\uDCD8 Instructions
...
Get a local copy of the hivemq-operator Helm chart. This will create a directory “./hivemq-operator" in your working directory:
Code Block language bash helm pull hivemq/hivemq-operator --untar
Go to the ./hivemq-operator/operator-tmpls and make a copy of the cluster-stateful-set.yaml in the same directory:
Code Block language bash cd ./hivemq-operator/operator-tmpls cp cluster-stateful-set.yaml my-cluster-stateful-set.yaml
Update the configuration of the liveness and readiness probe from this:
Code Block language yaml 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:
Code Block language yaml readinessProbe: httpGet: path: /api/v1/health/readiness port: 8889 scheme: HTTP initialDelaySeconds: 20 periodSeconds: 5 livenessProbe: httpGet: path: /api/v1/health/liveness port: 8889 scheme: HTTP initialDelaySeconds: 20 periodSeconds: 30 failureThreshold: 240
Copy the values.yaml file to make updates in it:
Code Block language bash cd ./hivemq-operator cp values.yaml ../my-values.yaml cd ..
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
:Code Block language yaml hivemq: configOverride: | <hivemq> ... ... <health-api> <enabled>true</enabled> <listeners> <http> <port>8889</port> <name>health-api-listener</name> <bind-address>0.0.0.0</bind-address> </http> </listeners> </health-api> </hivemq>
Deploy from the local directory and supply the updated controller template file and updated values.yaml file:
Code Block language bash cd .. helm upgrade hivemq --install ./hivemq-operator --namespace=hivemq \ --values my-values.yaml \ --set hivemq.controllerTemplate=my-cluster-stateful-set.yaml \ --set global.rbac.pspEnabled=false
...