vernemq / docker-vernemq

VerneMQ Docker image - Starts the VerneMQ MQTT broker and listens on 1883 and 8080 (for websockets).
https://vernemq.com
Apache License 2.0
177 stars 230 forks source link

Support custom ports on the headless service #379

Closed ashtonian closed 6 months ago

ashtonian commented 8 months ago

Because the chart is using a stateful set, the corresponding headless service is responsible for port controls on the container and the only way to expose additional ports is through the controlling headless service.

StatefulSets currently require a Headless Service to be responsible for the network identity of the Pods. You are responsible for creating this Service.

Submitting a PR to enable custom ports. Final use case is to enable an alternative listener to use proxy protocol with a cluster behind an LB that is using proxy protocol so information gets passed to the cluster. However the cloud side ingest services (that are married 1:1 -> ingest:verne container) hit the cluster directly behind the LB need to hit the regular port so therefore the headless service needs to be able to expose alt ports in order to support alternative listeners.

ashtonian commented 8 months ago

One challenge with this is, I think the vernemq.sh may need an additional line, something like ->

 echo "listener.tcp.alt = ${IP_ADDRESS}:1884" >> ${VERNEMQ_CONF_FILE}

I'm going to attempt to submit a PR up the chain to enable a default convention of 1884 being on w/proxy protocol so that the default config enables 2 TCP ports.

ioolkos commented 8 months ago

@ashtonian Thanks! I'll review your PR. It does make sense, if I understand correctly.


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq 👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.