When trying to establish a connection to MQTT in UMHLens/OpenLens, you may encounter a problem where the pods are not working properly and are being killed due to a timeout error. This guide will provide you with a solution to help you fix this issue and establish a connection to MQTT in UMHLens/OpenLens.
Problem
The problem of no connection to MQTT due to pod timeout can occur when there is a lot of data in vernemq's local database. This can cause the readiness probe of Kubernetes to fail, resulting in the pods being killed and preventing a connection to MQTT.
Readiness probe failed: Get ”<IP>/health”: contect deadline exceeded (Client. Timeout exceeded while awaiting headers)
Solution
- Go to the StatefulSets of the vernemq Pod: Access the StatefulSets of the vernemq pod and look for the initialDelaySeconds setting for livenessProbe and readinessProbe.
- Increase the initialDelaySeconds: Change the initialDelaySeconds for both livenessProbe and readinessProbe. The easiest way to do this is to add a "0" to the end of both settings.
- Save the Changes: Save the changes to the StatefulSets and wait for the vernemq pod to restart.
- Test the Connection: After the vernemq pod has restarted, test the connection to MQTT and verify that it is now working properly.