Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update headless service to expose more ports (#336)
Use case here is for an internal ingest service to be able to consume messages from a specific pod. Not sure what all should be configurable and if this should be an opt in flag. We are attaching an ingest service pod from a stateful set to each vernemq set so there is a 1:1 for our ingest service. This gives max ha and load balancing as messages don't need to get redirected internally and each mqtt pod has its own ingest service pod. In order to do this the ingest service needs to directly access each pod via `<pod-name>-<ordinal>.<service-name>.<namespace>.svc.cluster.local` dns entry. Our ingest service is also a statefulset with the same number of replicas that then gets a array of host dns entries along with an index field populated via `HOST_INDEX : fieldRef(v1:metadata.annotations['spec.pod.beta.kubernetes.io/statefulset-index'])` to allow each pod to connect. We can't create another headless service as the builtin headless service name is listed in the stateful set spec. Another solution may be to allow the user to provide a headless service name to override it. I think it would be better to just make this more configurable.
- Loading branch information