Skip to main content
This guide explains how to configure per-pod networking for PulsarBroker using networking.podService and advertisedListeners.

Overview

Two features work together to enable per-pod access:
FeaturePurpose
networking.podServiceCreates a dedicated Kubernetes Service for each broker pod
advertisedListenersConfigures brokers to advertise custom addresses to clients
Use cases:
  • Istio Federation / Multi-cluster communication
  • Direct pod access scenarios

Configuration

Example

Add the following to your Helm values.yaml:
broker:
  pulsarBroker:
    # Enable per-pod services
    networking:
      podService:
        enabled: true
        type: ClusterIP
        annotations:
          example.com/pod-service: "true"

    # Use per-pod service DNS as advertised listener
    # Note: Use non-default port (6660) to avoid conflict with brokerServicePort (6650)
    advertisedListeners:
      - name: pod
        hostTemplate: "$(POD_NAME).pulsar.svc.cluster.local"
        protocols:
          pulsar:
            containerPort: 6660
            advertisedPort: 6660
Then apply with:
helm upgrade -f /path/to/values.yaml <release_name> streamnative/sn-platform -n <namespace>

Configuration Reference

networking.podService

FieldTypeDefaultDescription
enabledboolfalseEnable per-pod Service creation
typestringClusterIPService type: ClusterIP, LoadBalancer, or NodePort
annotationsmap{}Annotations to add to each pod Service

advertisedListeners

FieldTypeDescription
namestringUnique identifier for this listener
hostTemplatestringHostname template, supports $(POD_NAME) and $(POD_ID)
protocols.pulsar.containerPortintPort the broker container listens on
protocols.pulsar.advertisedPortintPort advertised to clients
Use a non-default port (e.g., 6660) to avoid conflict with the default brokerServicePort (6650).

Verify Configuration

Check Created Services

kubectl get svc -n <namespace> | grep broker
Expected output:
pulsar-broker            ClusterIP   10.0.0.1   <none>   6650/TCP,8080/TCP
pulsar-broker-0          ClusterIP   10.0.0.2   <none>   6650/TCP,6660/TCP,8080/TCP
pulsar-broker-1          ClusterIP   10.0.0.3   <none>   6650/TCP,6660/TCP,8080/TCP

Verify Service Selector

kubectl get svc pulsar-broker-0 -n <namespace> -o jsonpath='{.spec.selector}'
Expected: {"statefulset.kubernetes.io/pod-name":"pulsar-broker-0"}

Test Connectivity

kubectl run test-client --image=curlimages/curl:latest --rm -it --restart=Never -n <namespace> -- \
  curl -s http://pulsar-broker-0:8080/admin/v2/brokers/healthcheck