From a4d622cbb33af84a299781565aca0d81420f7bdc Mon Sep 17 00:00:00 2001 From: Tero Paloheimo Date: Fri, 29 Jul 2022 21:50:29 +0300 Subject: [PATCH] [mosquitto] Add option for selectively adding listener (#1711) Using TLS in Mosquitto does not work if the listener option is present in the main mosquitto.conf. This is why an option is added to prevent it from being added to support TLS usage without hacking the chart locally. Signed-off-by: Tero Paloheimo --- charts/stable/mosquitto/Chart.yaml | 6 +++--- charts/stable/mosquitto/README.md | 7 ++++--- charts/stable/mosquitto/templates/configmap.yaml | 2 ++ charts/stable/mosquitto/values.yaml | 4 ++++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/charts/stable/mosquitto/Chart.yaml b/charts/stable/mosquitto/Chart.yaml index af2c457e..73fdecb7 100644 --- a/charts/stable/mosquitto/Chart.yaml +++ b/charts/stable/mosquitto/Chart.yaml @@ -3,7 +3,7 @@ apiVersion: v2 appVersion: 2.0.14 description: Eclipse Mosquitto - An open source MQTT broker name: mosquitto -version: 4.5.1 +version: 4.6.0 kubeVersion: ">=1.16.0-0" keywords: - mosquitto @@ -22,5 +22,5 @@ dependencies: version: 4.4.2 annotations: artifacthub.io/changes: |- - - kind: changed - description: Use appVersion as image tag by default + - kind: added + description: Option to disable adding of the listener option to the config diff --git a/charts/stable/mosquitto/README.md b/charts/stable/mosquitto/README.md index 672e8145..6512350e 100644 --- a/charts/stable/mosquitto/README.md +++ b/charts/stable/mosquitto/README.md @@ -80,21 +80,22 @@ N/A | image.repository | string | `"eclipse-mosquitto"` | image repository | | image.tag | string | chart.appVersion | image tag | | perListenerSettings | bool | `false` | By enabling this, authentication and access control settings will be controlled on a per-listener basis | +| addListener | bool | `true` | When enabled the `listener` option is added to the mosquitto config. | | persistence.configinc | object | See values.yaml | Configure a persistent volume to place *.conf mosquitto-config-files in. When enabled, this gets set as `include_dir` in the mosquitto config. | | persistence.data | object | See values.yaml | Configure a persistent volume to place mosquitto data in. When enabled, this enables `persistence` and `persistence_location` in the mosquitto config. | | service | object | See values.yaml | Configures service settings for the chart. Normally this does not need to be modified. | ## Changelog -### Version 4.5.1 +### Version 4.6.0 #### Added -N/A +* Option to disable adding of the `listener` option to the config #### Changed -* Use appVersion as image tag by default +N/A #### Fixed diff --git a/charts/stable/mosquitto/templates/configmap.yaml b/charts/stable/mosquitto/templates/configmap.yaml index a2bba09e..e78f4e60 100644 --- a/charts/stable/mosquitto/templates/configmap.yaml +++ b/charts/stable/mosquitto/templates/configmap.yaml @@ -9,7 +9,9 @@ metadata: data: mosquitto.conf: | per_listener_settings {{ .Values.perListenerSettings }} + {{- if .Values.addListener }} listener {{ .Values.service.main.ports.mqtt.port }} + {{- end}} {{- if .Values.auth.enabled }} allow_anonymous false {{- else }} diff --git a/charts/stable/mosquitto/values.yaml b/charts/stable/mosquitto/values.yaml index d3c6e12d..55f5559f 100644 --- a/charts/stable/mosquitto/values.yaml +++ b/charts/stable/mosquitto/values.yaml @@ -32,6 +32,10 @@ auth: # -- By enabling this, authentication and access control settings will be controlled on a per-listener basis perListenerSettings: false +# -- When enabled, this adds the `listener` option to the mosquitto config. +# Change this to false when using TLS. +addListener: true + persistence: # -- Configure a persistent volume to place mosquitto data in. # When enabled, this enables `persistence` and `persistence_location` in the mosquitto config.