Skip to content

Commit

Permalink
feat: support pdb control (#1204)
Browse files Browse the repository at this point in the history
<!--
### Contribution Checklist

- Name the pull request in the form "[charts/<chart-name>] Title of the
pull request".
Skip *[charts/<chart-name>]* if the PR doesn't change a specific chart.
E.g. `[docs] Fix typo in README`.

- Fill out the template below to describe the changes contributed by the
pull request. That will give reviewers the context they need to do the
review.

- Each pull request should address only one issue, not mix up code from
multiple issues.

  - Each commit in the pull request has a meaningful commit message

- Once all items of the checklist are addressed, remove the above text
and this checklist, leaving only the filled out template below.

**(The sections below can be removed for hotfixes of typos)**
-->

*(If this PR fixes a github issue, please add `Fixes #<xyz>`.)*

Fixes #<xyz>

*(or if this PR is one task of a github issue, please add `Master Issue:
#<xyz>` to link to the master issue.)*

Master Issue: #<xyz>

### Motivation

*Explain here the context, and why you're making that change. What is
the problem you're trying to solve.*

### Modifications

*Describe the modifications you've done.*

### Verifying this change

- [ ] Make sure that the change passes the CI checks.

*(Please pick either of the following options)*

This change is a trivial rework / code cleanup without any test
coverage.

*(or)*

This change is already covered by existing tests, such as *(please
describe tests)*.

*(or)*

This change added tests and can be verified as follows:

*(example:)*
- *Added integration tests for end-to-end deployment with large payloads
(10MB)*
  - *Extended integration test for recovery after broker failure*

### Documentation

Check the box below.

Need to update docs?

- [ ] `doc-required`

  (If you need help on updating docs, create a doc issue)

- [x] `no-need-doc`

  (Please explain why)

- [ ] `doc`

  (If this PR contains doc changes)

---------

Signed-off-by: ericsyh <ericshenyuhao@outlook.com>
(cherry picked from commit d907202)
  • Loading branch information
ericsyh committed Feb 28, 2025
1 parent fec1ad4 commit ee83f43
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ spec:
{{ toYaml . | indent 6 }}
{{- end }}
apiObjects:
{{- if not .Values.bookkeeper.pdb.autoCreate }}
pdb:
managed: {{ .Values.bookkeeper.pdb.autoCreate }}
{{- end }}
clientService: {}
headlessService:
metadata:
Expand Down
6 changes: 5 additions & 1 deletion charts/sn-platform-slim/templates/broker/broker-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,12 @@ spec:
PULSAR_PREFIX_managedLedgerOffloadServiceEndpoint: "{{ .Values.broker.offload.azureblob.managedLedgerOffloadServiceEndpoint }}"
{{- end}}
{{- end }}
{{- if or .Values.tls.broker.enabled .Values.broker.extraVolumeMounts .Values.broker.extraVolumeClaimTemplates }}
{{- if or .Values.tls.broker.enabled .Values.broker.extraVolumeMounts .Values.broker.extraVolumeClaimTemplates (not .Values.broker.pdb.autoCreate) }}
apiObjects:
{{- if not .Values.broker.pdb.autoCreate }}
pdb:
managed: {{ .Values.broker.pdb.autoCreate }}
{{- end }}
statefulSet:
{{- if or .Values.tls.broker.enabled .Values.broker.extraVolumeMounts }}
volumeMounts:
Expand Down
4 changes: 4 additions & 0 deletions charts/sn-platform-slim/templates/proxy/proxy-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ spec:
certSecretName: "{{ template "pulsar.proxy.tls.secret.name" . }}"
{{- end }}
apiObjects:
{{- if not .Values.proxy.pdb.autoCreate }}
pdb:
managed: {{ .Values.proxy.pdb.autoCreate }}
{{- end }}
{{- if .Values.tls.proxy.enabled }}
statefulSet:
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ spec:
{{ toYaml . | indent 6 }}
{{- end }}
apiObjects:
{{- if not .Values.zookeeper.pdb.autoCreate }}
pdb:
managed: {{ .Values.zookeeper.pdb.autoCreate }}
{{- end }}
clientService: {}
headlessService:
metadata:
Expand Down
20 changes: 20 additions & 0 deletions charts/sn-platform-slim/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,11 @@ zookeeper:
# labelSelector:
# matchLabels:
# "component": "zookeeper"
# Controls automatic generation of PodDisruptionBudget resources.
# When enabled (true), the sn-operator will auto-create PDBs with default constraints.
# Disable (false) if you need to manually manage PDBs for fine-grained control.
pdb:
autoCreate: true
labels: {}
annotations: {}
advanced: {}
Expand Down Expand Up @@ -848,6 +853,11 @@ bookkeeper:
# When there are multiple labels configured, all their values will be joined by "/".
# The operator will propagate the label value from nodes to pods and ensure the pod container starts with the label values as environment variables automatically.
rackAwareTopologyLabels: []
# Controls automatic generation of PodDisruptionBudget resources.
# When enabled (true), the sn-operator will auto-create PDBs with default constraints.
# Disable (false) if you need to manually manage PDBs for fine-grained control.
pdb:
autoCreate: true
labels: {}
annotations: {}
securityContext:
Expand Down Expand Up @@ -1091,6 +1101,11 @@ broker:
# preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee
type: preferredDuringSchedulingIgnoredDuringExecution
topologySpreadConstraints: []
# Controls automatic generation of PodDisruptionBudget resources.
# When enabled (true), the sn-operator will auto-create PDBs with default constraints.
# Disable (false) if you need to manually manage PDBs for fine-grained control.
pdb:
autoCreate: true
labels: {}
annotations: {}
tolerations: []
Expand Down Expand Up @@ -1497,6 +1512,11 @@ proxy:
# preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee
type: preferredDuringSchedulingIgnoredDuringExecution
topologySpreadConstraints: []
# Controls automatic generation of PodDisruptionBudget resources.
# When enabled (true), the sn-operator will auto-create PDBs with default constraints.
# Disable (false) if you need to manually manage PDBs for fine-grained control.
pdb:
autoCreate: true
labels: {}
annotations: {}
securityContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ spec:
{{ toYaml . | indent 6 }}
{{- end }}
apiObjects:
{{- if not .Values.bookkeeper.pdb.autoCreate }}
pdb:
managed: {{ .Values.bookkeeper.pdb.autoCreate }}
{{- end }}
clientService: {}
headlessService:
metadata:
Expand Down
6 changes: 5 additions & 1 deletion charts/sn-platform/templates/broker/broker-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,12 @@ spec:
PULSAR_PREFIX_managedLedgerOffloadServiceEndpoint: "{{ .Values.broker.offload.azureblob.managedLedgerOffloadServiceEndpoint }}"
{{- end}}
{{- end }}
{{- if or .Values.tls.broker.enabled .Values.broker.extraVolumeMounts .Values.broker.extraVolumeClaimTemplates }}
{{- if or .Values.tls.broker.enabled .Values.broker.extraVolumeMounts .Values.broker.extraVolumeClaimTemplates (not .Values.broker.pdb.autoCreate) }}
apiObjects:
{{- if not .Values.broker.pdb.autoCreate }}
pdb:
managed: {{ .Values.broker.pdb.autoCreate }}
{{- end }}
statefulSet:
{{- if or .Values.tls.broker.enabled .Values.broker.extraVolumeMounts }}
volumeMounts:
Expand Down
4 changes: 4 additions & 0 deletions charts/sn-platform/templates/proxy/proxy-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ spec:
certSecretName: "{{ template "pulsar.proxy.tls.secret.name" . }}"
{{- end }}
apiObjects:
{{- if not .Values.proxy.pdb.autoCreate }}
pdb:
managed: {{ .Values.proxy.pdb.autoCreate }}
{{- end }}
{{- if .Values.tls.proxy.enabled }}
statefulSet:
volumeMounts:
Expand Down
4 changes: 4 additions & 0 deletions charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ spec:
{{ toYaml . | indent 6 }}
{{- end }}
apiObjects:
{{- if not .Values.zookeeper.pdb.autoCreate }}
pdb:
managed: {{ .Values.zookeeper.pdb.autoCreate }}
{{- end }}
clientService: {}
headlessService:
metadata:
Expand Down
20 changes: 20 additions & 0 deletions charts/sn-platform/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,11 @@ zookeeper:
# labelSelector:
# matchLabels:
# "component": "zookeeper"
# Controls automatic generation of PodDisruptionBudget resources.
# When enabled (true), the sn-operator will auto-create PDBs with default constraints.
# Disable (false) if you need to manually manage PDBs for fine-grained control.
pdb:
autoCreate: true
labels: {}
annotations: {}
advanced: {}
Expand Down Expand Up @@ -924,6 +929,11 @@ bookkeeper:
# When there are multiple labels configured, all their values will be joined by "/".
# The operator will propagate the label value from nodes to pods and ensure the pod container starts with the label values as environment variables automatically.
rackAwareTopologyLabels: []
# Controls automatic generation of PodDisruptionBudget resources.
# When enabled (true), the sn-operator will auto-create PDBs with default constraints.
# Disable (false) if you need to manually manage PDBs for fine-grained control.
pdb:
autoCreate: true
labels: {}
annotations: {}
securityContext:
Expand Down Expand Up @@ -1168,6 +1178,11 @@ broker:
# preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee
type: preferredDuringSchedulingIgnoredDuringExecution
topologySpreadConstraints: []
# Controls automatic generation of PodDisruptionBudget resources.
# When enabled (true), the sn-operator will auto-create PDBs with default constraints.
# Disable (false) if you need to manually manage PDBs for fine-grained control.
pdb:
autoCreate: true
labels: {}
annotations: {}
tolerations: []
Expand Down Expand Up @@ -1574,6 +1589,11 @@ proxy:
# preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee
type: preferredDuringSchedulingIgnoredDuringExecution
topologySpreadConstraints: []
# Controls automatic generation of PodDisruptionBudget resources.
# When enabled (true), the sn-operator will auto-create PDBs with default constraints.
# Disable (false) if you need to manually manage PDBs for fine-grained control.
pdb:
autoCreate: true
labels: {}
annotations: {}
securityContext:
Expand Down

0 comments on commit ee83f43

Please sign in to comment.