Require the need to install kafka to different namespaces #168
Require the need to install kafka to different namespaces #168
Conversation
…e kafka advertised listeners must support dynamic firstListenerPort, currently this is hardcoded to 31090.
@confluentinc It looks like @galvo just signed our Contributor License Agreement. 👍 Always at your service, clabot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the PR!
- Maybe a helper function is better?
- I think we should remove original
advertisedListenersOverride
related code and take this approach.
Thanks, will look to reimplement this as suggested above |
Could you explain more on why is this needed for installing kafka on different namespaces? |
When you enable NodePort the NopePort IP range by default starts @ 31090 (firstListenerPort default value) and increments based on the number of brokers configured, so if you have 3 brokers NodePorts will be exposed on 31090, 31091, 31092. When you install Kafka in a different namespace you then need to change the firstListenerPort to some other free port range so you need to overwrite the firstListenerPort value to something other than 31090 (which is in use). However you then also need to overwrite the following My proposed change is to always set the advertised.listeners to use the value defined by the firstListenerPort so you only need to define this once in the helm overrides. For the record this is a slightly un-kubernetes way of exposing external access, in my mind we shouldn't have to enable nodeport at the broker level but at the headless service level and that way it would be just a single port instead of a port for every broker, and also you would be able to leave it to kubernetes to allocate you a free port rather than have to explicitly define the incremental range of NodePorts. advertised.listeners only ever picks the 1st node port value anyway so it is slightly odd to even expose nodeports on the others. Thoughts on this? |
My initial thought is to totally remove all nodeports part because, as you said, it won't work well when there're multiple kafka clusters to be provisioned in same k8s cluster(no matter in a different namespace or not). I don't see how headless with a port could solve it better, still have to have a nodeport for each of the broker, and you're expecting the headless service to return VM's hostname/IP+port instead of PodIP+Port in order to make sure the traffic is routable but headless service does not work in that way.
|
4 viable options but none are simple, whats your current thoughts on how to progress this? Ideally it would be great if defining the node port range was not required, and if this was instead left to Kubernetes to allocate free port(s). |
Any plans this could get merged |
please resolve the conflicts. I'm thinking about leveraging an ingress controller that supports Kafka traffic. It's ideal for exposing Kafka to external but might not make sense in terms of throughput, performance. |
Require the need to install kafka to different namespaces and thus the kafka advertised listeners must support dynamic firstListenerPort, currently this is hardcoded to 31090.