Story Details

  • High Available Mosquitto MQTT on Kubernetes

    Posted: 2025-05-14 20:42:36

    This blog post details setting up a highly available Mosquitto MQTT broker on Kubernetes. It leverages a StatefulSet to manage persistent storage and pod identity, ensuring data persistence across restarts. The setup uses a headless service for internal communication and an external LoadBalancer service to expose the broker to clients. Persistence is achieved with a PersistentVolumeClaim, while a ConfigMap manages configuration files. The post also covers generating a self-signed certificate for secure communication and emphasizes the importance of a proper Kubernetes DNS configuration for service discovery. Finally, it offers a simplified deployment using a single YAML file and provides instructions for testing the setup with mosquitto_sub and mosquitto_pub clients.

    Summary of Comments ( 15 )
    https://news.ycombinator.com/item?id=43988975

    HN users generally found the tutorial lacking important details for a true HA setup. Several commenters pointed out that using a single persistent volume claim wouldn't provide redundancy and suggested using a distributed storage solution instead. Others questioned the choice of a StatefulSet without discussing scaling or the need for a headless service. The external database dependency was also criticized as a potential single point of failure. A few users offered alternative approaches, including using a managed MQTT service or simpler clustering methods outside of Kubernetes. Overall, the sentiment was that while the tutorial offered a starting point, it oversimplified HA and omitted crucial considerations for production environments.