Helm Chart: MQTT ingress proxies HTTP to MQTT port
What happened?
Setting ingress.mqtt forwards to MQTT port
What did you expect to happen?
ingress.mqtt should create an ingress that points to service.ws. After all, ingress is designed for HTTP/WS, not TCP
How can we reproduce it (as minimally and precisely as possible)?
# values.yaml
ingress:
mqtt:
enabled: true
Anything else we need to know?
This is the culprit: https://github.com/emqx/emqx/blob/f969a4ef5ea79d4e79a1cbbd131b709091b80cf7/deploy/charts/emqx/templates/ingress.yaml#L89
EMQX version
Chart 5.5.0
OS version
No response
Log files
No response
You are correct in noting that Kubernetes Ingress is primarily designed for HTTP and HTTPS traffic, utilizing protocols like HTTP, HTTPS, and WebSockets (WS). Since Ingress operates at the application layer (Layer 7), it is well-suited for handling HTTP-based protocols which allow for routing based on URL paths.
For MQTT, which typically operates over TCP (not HTTP), using a standard Ingress controller wouldn't be suitable as it does not handle TCP services. However, some specialized Ingress controllers, like NGINX or HAProxy, can be configured to handle non-HTTP traffic including TCP and UDP, thus enabling the routing capabilities for MQTT traffic as well.
Still, thats non standard behavior. There is a reason why work is being done on the Gateway api.
Nonetheless your comment rises the following question: why the chart doesn't provide an ingress.ws value, which would be standard behavior? It could be preset with the path pointing to /mqtt, that way you could set both dashboard and ws to the same host without messing routing.
why the chart doesn't provide an ingress.ws value, which would be standard behavior? It could be preset with the path pointing to /mqtt, that way you could set both dashboard and ws to the same host without messing routing.
@Altair-Bueno It's a great idea. could you please creaete a PR for this?
@Rory-Z Something like https://github.com/emqx/emqx/pull/13411? It works on my end, but Im unaware of any Helm tests or other requisites you may have related to the chart