connect to broker in standalone mode via Kubernetes #18772
-
I'm running an app with 3 Kubernetes pods. First pod: Pulsar standalone These 3 pods each have their own IP address, but they are all on the same network. How do I connect the Producer and Consumer to the Pulsar standalone pod without explicitly giving them the IP of the standalone pod? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
In kubernetes you should use a Service resource for manage networking and put it in "front" of the pulsar pod. For example you can create a service like this
Assuming that your pod matches the label app=pulsar, then the producer and consumer will have to point to pulsar://pulsar-service:6650 (pulsar protocol) and http://pulsar-service:8080 (pulsar admin) Another suggestion is to use a deployment instead of a raw pod. Btw, for Pulsar in Kubernetes it's suggested to use a proper deployment process by using the helm chart or an operator. |
Beta Was this translation helpful? Give feedback.
-
Thank you |
Beta Was this translation helpful? Give feedback.
In kubernetes you should use a Service resource for manage networking and put it in "front" of the pulsar pod.
Then the producer and consumer will have to point to the service name.
For example you can create a service like this
Assuming that your pod matches the label app=pulsar, then the producer and consumer will have to point to pulsar://pulsar-service:6650 (pulsar protocol) and http://pulsar-service:8080 (pulsar admin)
Another suggestion is to use a deployment instead of a raw pod.
Btw, for P…