apache / apache/pulsar-helm-chart

Anti-affinity rules are not namespace aware - in a multi-tenant environment could get multiple brokers/bookies on same node

Open
#248 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Shell
Stars
240
Forks
260
Avg merge
4h 12m
Merged PRs (30d)
1

Description

**Is your feature request related to a problem? Please describe.**
In a multi-K8S-namespace environment with anti-affinity rules turned on we cam still end up with multiple brokers or bookies on the same node.

**Describe the solution you'd like**
Stateful set definitions of anti-affinity rules should allow namespaces to be specified
See for example
https://github.com/apache/pulsar-helm-chart/blob/master/charts/pulsar/templates/broker-statefulset.yaml#L67-L102
https://github.com/apache/pulsar-helm-chart/blob/master/charts/pulsar/templates/bookkeeper-statefulset.yaml#L63-L102

NOTE:
See NamespaceSelector https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#namespace-selector
PodAffinityNamespaceSelector was alpha'd in 1.21 and Beta in 1.22 (but we are on 1.20)
https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/

**Describe alternatives you've considered**
Looked for some other label we could add to the pod but nothing jumped out at me.
This would be preferred if possible as it could be used in earlier versions of K8S.

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with charts/pulsar/templates/broker-statefulset.yaml and charts/pulsar/templates/bookkeeper-statefulset.yaml, focusing on the anti-affinity definitions linked in the issue. Read the Kubernetes NamespaceSelector documentation and the noted feature-gate versions first. Done means the StatefulSet anti-affinity rules can account for namespaces without relying on unsupported Kubernetes 1.20 behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
helm, kubernetes
Domain
devops, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.