Commit 8885cf8
authored
Support broker per-pod service and advertisedListeners (#1263)
## Summary
Add `networking.podService` and `advertisedListeners` configuration to
PulsarBroker CR for Istio Federation/Multi-cluster scenarios.
- Add `networking.podService` config (enabled, type, annotations,
labels, ports)
- Add `advertisedListeners` config for custom broker advertisement
- Update both sn-platform and sn-platform-slim charts
## Test Values
Use the following values file to test the feature:
```yaml
# Test Broker Pod Service functionality
# Simulates Istio Federation scenario
broker:
pulsarBroker:
networking:
podService:
enabled: true
type: ClusterIP
annotations:
sidecar.istio.io/inject: "true"
test.streamnative.io/feature: "broker-pod-service"
labels:
app.kubernetes.io/managed-by: "pulsar-operator"
test.streamnative.io/scenario: "istio-federation"
# Use non-default port (6660) to avoid conflict with brokerServicePort (6650)
advertisedListeners:
- name: pod
hostTemplate: "$(POD_NAME).test-namespace.svc.cluster.local"
protocols:
pulsar:
advertisedPort: 6660
containerPort: 6660
```
## Verification
1. Deploy with the test values:
```bash
helm install test-pulsar ./sn-platform-slim -n test-namespace -f
test-values.yaml
```
2. Verify PulsarBroker CR contains correct config:
```bash
kubectl get pulsarbroker -n test-namespace -o yaml | grep -A 20
"networking:"
```
3. Verify per-pod Services are created:
```bash
kubectl get svc -n test-namespace | grep broker
```
4. Expected per-pod Services:
- `{cluster}-broker-0` with correct annotations/labels
- `{cluster}-broker-1` with correct annotations/labels
- Services should include port 6660
## Test plan
- [x] `helm template` renders correct YAML
- [x] Per-pod Services created with correct selector
(`statefulset.kubernetes.io/pod-name`)
- [x] Custom annotations and labels applied to Services
- [x] Broker starts on configured listener port (6660)
- [x] Both sn-platform and sn-platform-slim charts work correctly1 parent 03835b8 commit 8885cf8
4 files changed
Lines changed: 136 additions & 0 deletions
File tree
- charts
- sn-platform-slim
- templates/broker
- sn-platform
- templates/broker
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
193 | 219 | | |
194 | 220 | | |
195 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1143 | 1143 | | |
1144 | 1144 | | |
1145 | 1145 | | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
1146 | 1188 | | |
1147 | 1189 | | |
1148 | 1190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
194 | 220 | | |
195 | 221 | | |
196 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1218 | 1218 | | |
1219 | 1219 | | |
1220 | 1220 | | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
1221 | 1263 | | |
1222 | 1264 | | |
1223 | 1265 | | |
| |||
0 commit comments