From 27b095e12df6c70682e3190f45590744d88ae0fe Mon Sep 17 00:00:00 2001 From: Michael Goldstein Date: Fri, 8 Jan 2021 07:26:32 -0600 Subject: [PATCH] [Mosquitto] Update Mosquitto to support configurable ports (#475) Co-authored-by: Michael Goldstein --- charts/mosquitto/Chart.yaml | 2 +- charts/mosquitto/templates/NOTES.txt | 8 ++++---- charts/mosquitto/templates/service.yaml | 4 ++-- charts/mosquitto/values.yaml | 2 ++ 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/charts/mosquitto/Chart.yaml b/charts/mosquitto/Chart.yaml index a754520f..f90a989f 100644 --- a/charts/mosquitto/Chart.yaml +++ b/charts/mosquitto/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.6.12" description: Eclipse Mosquitto - An open source MQTT broker name: mosquitto -version: 0.5.0 +version: 0.6.0 keywords: - message queue - MQTT diff --git a/charts/mosquitto/templates/NOTES.txt b/charts/mosquitto/templates/NOTES.txt index 9de1eef2..e445b745 100644 --- a/charts/mosquitto/templates/NOTES.txt +++ b/charts/mosquitto/templates/NOTES.txt @@ -1,6 +1,6 @@ ** Please be patient while the chart is being deployed ** -Mosquitto can be accessed within the cluster on port 1883 at {{ template "mosquitto.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local +Mosquitto can be accessed within the cluster on port {{ .Values.service.port }} at {{ template "mosquitto.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local To access for outside the cluster, perform the following steps: @@ -26,13 +26,13 @@ NOTE: It may take a few minutes for the LoadBalancer IP to be available. To Access the Moquitto port: - echo "URL : mqtt://$SERVICE_IP:1883/" + echo "URL : mqtt://$SERVICE_IP:{{ .Values.service.port }}/" {{- else if contains "ClusterIP" .Values.service.type }} To Access the Mosquitto MQTT port: - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "mosquitto.fullname" . }} 1883:1883 - echo "URL : mqtt://127.0.0.1:1883/" + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "mosquitto.fullname" . }} {{ .Values.service.port }}:{{ .Values.service.port }} + echo "URL : mqtt://127.0.0.1:{{ .Values.service.port }}/" {{- end }} diff --git a/charts/mosquitto/templates/service.yaml b/charts/mosquitto/templates/service.yaml index 0fe42290..f8449e41 100644 --- a/charts/mosquitto/templates/service.yaml +++ b/charts/mosquitto/templates/service.yaml @@ -17,11 +17,11 @@ spec: loadBalancerIP: {{ .Values.service.loadBalancerIP }} {{- end }} ports: - - port: 1883 + - port: {{ .Values.service.port }} targetPort: default protocol: TCP name: default - - port: 9001 + - port: {{ .Values.service.websocketPort }} targetPort: websocket protocol: TCP name: websocket diff --git a/charts/mosquitto/values.yaml b/charts/mosquitto/values.yaml index 8d535d28..094f4149 100644 --- a/charts/mosquitto/values.yaml +++ b/charts/mosquitto/values.yaml @@ -34,6 +34,8 @@ securityContext: {} service: annotations: {} type: ClusterIP + port: 1883 + websocketPort: 9001 # externalTrafficPolicy: # loadBalancerIP: