Versions Compared

Key

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

Question

What could be the reason that for HiveMQ Kubernetes Operator to repeatedly shutdownshut down/restart a node after exactly 2 hours?

Answer

The port named “mqttport must be on a port that existshave a listener in HiveMQ broker with the same port number. In case when the “mqtt” port is set to 1883 but not configured in the listenerConfiguration, it will prevent the liveness probe from functioning and the node will subsequently fail.

The HiveMQ Kubernetes Operator does automatically configure the liveness probe auto-configures to with the port named “mqtt”. If the “mqtt” port is 1883, it will check the 1883 tcp TCP socket. If the port 1883 is not configured in the listenerConfiguration, then this port will not be open on the pods and the liveness probe will fail.

To fix this, either make sure that the port named “mqtt” is configured in the listenerConfiguration or pick a port number that is already configured in the listenerConfiguration and rename it to "mqtt".

The following in the values.yaml will expose the port named "mqtt" with port number 1883:

Code Block
languageyaml
 hivemq: 
  ports:
  - name: "mqtt"
    port: 1883
    expose: true

The matching listenerConfiguration in the config.xml:

Code Block
languagexml
<hivemq>

    <listeners>
        <tcp-listener>
            <port>1883</port>
            <bind-address>0.0.0.0</bind-address>
        </tcp-listener>
    </listeners>
    
</hivemq>