Skip to content

connect to broker in standalone mode via Kubernetes #18772

Answered by nicoloboschi
ShuAiii asked this question in Q&A
Discussion options

You must be logged in to vote

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

apiVersion: v1
kind: Service
metadata:
  name: pulsar-service
spec:
  clusterIP: None
  selector:
    app: pulsar
  ports:
    - name: client
      port: 6650
    - name: admin
      port: 8080

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…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ShuAiii
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants