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: Use cases:
  • Istio Federation / Multi-cluster communication
  • Direct pod access scenarios

Configuration

Example

Configuration Reference

networking.podService

advertisedListeners

Use a non-default port (e.g., 6660) to avoid conflict with the default brokerServicePort (6650).
A Pulsar client first looks up which broker owns a topic, then connects directly to that broker at the address the lookup returned. Every broker must therefore be reachable at its own address.Always include $(POD_NAME) or $(POD_ID) in hostTemplate. A template without one of these variables makes every broker advertise the same address. Clients then reach a random broker on each attempt and loop on:
See Verify Advertised Addresses to confirm your template is correct.

Verify Configuration

Check Created Services

Expected output:

Verify Service Selector

Expected: {"statefulset.kubernetes.io/pod-name":"pulsar-broker-0"}

Verify Advertised Addresses

Each broker must advertise its own address. Compare two brokers:
The entry for your listener must name a different host in each output, for example pulsar-broker-0.pulsar.svc.cluster.local and pulsar-broker-1.pulsar.svc.cluster.local. If both brokers show the same host, hostTemplate is missing $(POD_NAME) or $(POD_ID), and clients will not be able to reach individual brokers.

Test Connectivity