...
Multiple listeners allow to connect with different protocols and bind listeners to the specific network interface. You can find more details about how multiple listeners configured in HiveMq
HiveMQ provides flexible configurations to use multiple listeners for different protocols based on your need. For example, Clients with standard TCP connections can connect HIVEMQ on one port and secure TCP connections on another port. You can check here for more detailed configurations.
Similarly, it is also possible to use multiple listeners in the Kubernetes operator.
Here we are taking the example of configuring TLS and Non-TLS clients clients with standard TCP and Secured TCP to connect broker brokers via Kubernetes.
Instructions
...
Add two ports (TLS and non-TLS) via the values.yamlYAML
file
Typically 1883 for plain TCP and 8883 for 8883 TLS secured TCP
...
You can do this in two ways,
Expose the ports directly via the use of the K8s operator patch. (You can export these configurations from the full
...
values.yaml
in our helm-chart repository.)
Code Block | ||
---|---|---|
| ||
ports: - name: "mqtt" port: 1883 expose: true patch: - '[{"op":"add","path":"/spec/selector/hivemq.com~1node-offline","value":"false"},{"op":"add","path":"/metadata/annotations","value":{"service.spec.externalTrafficPolicy":"Local"}}]' # If you want Kubernetes to expose the MQTT port to external traffic - '[{"op":"add","path":"/spec/type","value":"LoadBalancer"}]' - name: "mqtt-tls" port: 8883 expose: true patch: - '[{"op":"add","path":"/spec/selector/hivemq.com~1node-offline","value":"false"},{"op":"add","path":"/metadata/annotations","value":{"service.spec.externalTrafficPolicy":"Local"}}]' # If you want Kubernetes to expose the MQTT port to external traffic - '[{"op":"add","path":"/spec/type","value":"LoadBalancer"}]' |
...
Your cluster name is the one you have used during HiveMQ deployment while installing the helm chart.
...