---
apiVersion: v1
kind: ConfigMap
metadata:
  name: mosquitto
  namespace: mosquitto
data:
  mosquitto.conf: |
    # https://mosquitto.org/man/mosquitto-conf-5.html
    # https://github.com/eclipse/mosquitto/blob/master/mosquitto.conf
    allow_anonymous false
    password_file /secret/password
    acl_file /mosquitto/config/acl
    persistence true
    persistence_location /mosquitto/data/

    # MQTT
    listener 1883 0.0.0.0
    protocol mqtt

    # MQTTS
    listener 8883 0.0.0.0
    protocol mqtt
    capath /etc/ssl/certs
    certfile /tls/tls.crt
    keyfile /tls/tls.key
  acl: |-
    user luke
    topic readwrite #
