-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PodDisruptionBudget to chart #2078
Conversation
9bc0e54
to
a51b4f4
Compare
Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @csp33 !
/approve
@csp33 What's the minimum k8s version needed to support this feature? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, I have left some comments.
# Whether to deploy a PodDisruptionBudget. Make sure you deploy at least 2 replicas before enabling this. | ||
pdb: | ||
enabled: false | ||
minAvailable: 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Could you rename pdb to podDisruptionBudget, and use
podDisruptionBudget.enable
in order to be consistent with other options likewebhook.enable
,metrics.enable
andpodMonitor.enable
. - You can use
# --
to add comments, and it will be rendered in chart README. - Could you place this option after podMonitor section since it is a less common configuration.
# Whether to deploy a PodDisruptionBudget. Make sure you deploy at least 2 replicas before enabling this. | |
pdb: | |
enabled: false | |
minAvailable: 1 | |
podDisruptionBudget: | |
# -- Specifies whether to enable pod disruption budget. | |
# Ref: [Specifying a Disruption Budget for your Application](https://kubernetes.io/docs/tasks/run-application/configure-pdb/). | |
enable: false | |
# -- The number of pods that must be available. | |
# Require `replicaCount` to be greater than 1. | |
minAvailable: 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
{{- if $.Values.pdb.enabled }} | ||
apiVersion: policy/v1 | ||
kind: PodDisruptionBudget | ||
metadata: | ||
name: {{ include "spark-operator.fullname" . }}-pdb | ||
labels: | ||
{{- include "spark-operator.labels" . | nindent 4 }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
{{- include "spark-operator.selectorLabels" . | nindent 6 }} | ||
minAvailable: {{ $.Values.pdb.minAvailable }} | ||
{{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cloud you rename this file to poddisruptionbudget.yaml
and the test file to poddisruptionbudget_test.yaml
respectively.
Besides, you can add a condition to test whether replica count is greater than 1, since this is needed by the feature.
{{- if $.Values.pdb.enabled }} | |
apiVersion: policy/v1 | |
kind: PodDisruptionBudget | |
metadata: | |
name: {{ include "spark-operator.fullname" . }}-pdb | |
labels: | |
{{- include "spark-operator.labels" . | nindent 4 }} | |
spec: | |
selector: | |
matchLabels: | |
{{- include "spark-operator.selectorLabels" . | nindent 6 }} | |
minAvailable: {{ $.Values.pdb.minAvailable }} | |
{{- end }} | |
{{- if .Values.podDisruptionBudget.enable }} | |
{{- if (gt .ReplicaCount 1) }} | |
apiVersion: policy/v1 | |
kind: PodDisruptionBudget | |
metadata: | |
name: {{ include "spark-operator.fullname" . }}-pdb | |
labels: | |
{{- include "spark-operator.labels" . | nindent 4 }} | |
spec: | |
selector: | |
matchLabels: | |
{{- include "spark-operator.selectorLabels" . | nindent 6 }} | |
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} | |
{{- else }} | |
{{- fail "replicaCount must be greater than 1 to enable pod disruption budget" }} | |
{{- end }} | |
{{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
275f9d0
to
d87839d
Compare
Signed-off-by: Carlos Sánchez Páez <[email protected]>
1.21 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ChenYi015, peter-mcclonski, vara-bonthu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
* Add PodDisruptionBudget to chart Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> * PR comments Signed-off-by: Carlos Sánchez Páez <[email protected]> --------- Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Yaniv Kunda <[email protected]>
* Add PodDisruptionBudget to chart Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> * PR comments Signed-off-by: Carlos Sánchez Páez <[email protected]> --------- Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]>
* Add PodDisruptionBudget to chart Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> * PR comments Signed-off-by: Carlos Sánchez Páez <[email protected]> --------- Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]>
* Update README and documentation (#2047) * Update docs Signed-off-by: Yi Chen <[email protected]> * Remove docs and update README Signed-off-by: Yi Chen <[email protected]> * Add link to monthly community meeting Signed-off-by: Yi Chen <[email protected]> --------- Signed-off-by: Yi Chen <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> * Add PodDisruptionBudget to chart (#2078) * Add PodDisruptionBudget to chart Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> * PR comments Signed-off-by: Carlos Sánchez Páez <[email protected]> --------- Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> * Set topologySpreadConstraints Signed-off-by: jbhalodia-slack <[email protected]> * Update README and increase patch version Signed-off-by: jbhalodia-slack <[email protected]> * Revert replicaCount change Signed-off-by: jbhalodia-slack <[email protected]> * Update README after master merger Signed-off-by: jbhalodia-slack <[email protected]> * Update README Signed-off-by: jbhalodia-slack <[email protected]> --------- Signed-off-by: Yi Chen <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Co-authored-by: Yi Chen <[email protected]> Co-authored-by: Carlos Sánchez Páez <[email protected]>
* Update README and documentation (kubeflow#2047) * Update docs Signed-off-by: Yi Chen <[email protected]> * Remove docs and update README Signed-off-by: Yi Chen <[email protected]> * Add link to monthly community meeting Signed-off-by: Yi Chen <[email protected]> --------- Signed-off-by: Yi Chen <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> * Add PodDisruptionBudget to chart (kubeflow#2078) * Add PodDisruptionBudget to chart Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> * PR comments Signed-off-by: Carlos Sánchez Páez <[email protected]> --------- Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> * Set topologySpreadConstraints Signed-off-by: jbhalodia-slack <[email protected]> * Update README and increase patch version Signed-off-by: jbhalodia-slack <[email protected]> * Revert replicaCount change Signed-off-by: jbhalodia-slack <[email protected]> * Update README after master merger Signed-off-by: jbhalodia-slack <[email protected]> * Update README Signed-off-by: jbhalodia-slack <[email protected]> --------- Signed-off-by: Yi Chen <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Co-authored-by: Yi Chen <[email protected]> Co-authored-by: Carlos Sánchez Páez <[email protected]> (cherry picked from commit 4108f54)
* Update helm docs (#2081) Signed-off-by: Carlos Sánchez Páez <[email protected]> (cherry picked from commit eca3fc8) * Update the process to build api-docs, generate CRD manifests and code (#2046) * Update .gitignore Signed-off-by: Yi Chen <[email protected]> * Update .dockerignore Signed-off-by: Yi Chen <[email protected]> * Update Makefile Signed-off-by: Yi Chen <[email protected]> * Update the process to generate api docs Signed-off-by: Yi Chen <[email protected]> * Update the workflow to generate api docs Signed-off-by: Yi Chen <[email protected]> * Use controller-gen to generate CRD and deep copy related methods Signed-off-by: Yi Chen <[email protected]> * Update helm chart CRDs Signed-off-by: Yi Chen <[email protected]> * Update workflow for building spark operator Signed-off-by: Yi Chen <[email protected]> * Update README.md Signed-off-by: Yi Chen <[email protected]> --------- Signed-off-by: Yi Chen <[email protected]> (cherry picked from commit 779ea3d) * Add topologySpreadConstraints (#2091) * Update README and documentation (#2047) * Update docs Signed-off-by: Yi Chen <[email protected]> * Remove docs and update README Signed-off-by: Yi Chen <[email protected]> * Add link to monthly community meeting Signed-off-by: Yi Chen <[email protected]> --------- Signed-off-by: Yi Chen <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> * Add PodDisruptionBudget to chart (#2078) * Add PodDisruptionBudget to chart Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> * PR comments Signed-off-by: Carlos Sánchez Páez <[email protected]> --------- Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> * Set topologySpreadConstraints Signed-off-by: jbhalodia-slack <[email protected]> * Update README and increase patch version Signed-off-by: jbhalodia-slack <[email protected]> * Revert replicaCount change Signed-off-by: jbhalodia-slack <[email protected]> * Update README after master merger Signed-off-by: jbhalodia-slack <[email protected]> * Update README Signed-off-by: jbhalodia-slack <[email protected]> --------- Signed-off-by: Yi Chen <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Co-authored-by: Yi Chen <[email protected]> Co-authored-by: Carlos Sánchez Páez <[email protected]> (cherry picked from commit 4108f54) * Use controller-runtime to reconsturct spark operator (#2072) * Use controller-runtime to reconstruct spark operator Signed-off-by: Yi Chen <[email protected]> * Update helm charts Signed-off-by: Yi Chen <[email protected]> * Update examples Signed-off-by: Yi Chen <[email protected]> --------- Signed-off-by: Yi Chen <[email protected]> (cherry picked from commit 0dc641b) --------- Co-authored-by: Carlos Sánchez Páez <[email protected]> Co-authored-by: jbhalodia-slack <[email protected]>
* Update README and documentation (kubeflow#2047) * Update docs Signed-off-by: Yi Chen <[email protected]> * Remove docs and update README Signed-off-by: Yi Chen <[email protected]> * Add link to monthly community meeting Signed-off-by: Yi Chen <[email protected]> --------- Signed-off-by: Yi Chen <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> * Add PodDisruptionBudget to chart (kubeflow#2078) * Add PodDisruptionBudget to chart Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> * PR comments Signed-off-by: Carlos Sánchez Páez <[email protected]> --------- Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> * Set topologySpreadConstraints Signed-off-by: jbhalodia-slack <[email protected]> * Update README and increase patch version Signed-off-by: jbhalodia-slack <[email protected]> * Revert replicaCount change Signed-off-by: jbhalodia-slack <[email protected]> * Update README after master merger Signed-off-by: jbhalodia-slack <[email protected]> * Update README Signed-off-by: jbhalodia-slack <[email protected]> --------- Signed-off-by: Yi Chen <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Co-authored-by: Yi Chen <[email protected]> Co-authored-by: Carlos Sánchez Páez <[email protected]>
* Add PodDisruptionBudget to chart Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> * PR comments Signed-off-by: Carlos Sánchez Páez <[email protected]> --------- Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]>
* Update README and documentation (kubeflow#2047) * Update docs Signed-off-by: Yi Chen <[email protected]> * Remove docs and update README Signed-off-by: Yi Chen <[email protected]> * Add link to monthly community meeting Signed-off-by: Yi Chen <[email protected]> --------- Signed-off-by: Yi Chen <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> * Add PodDisruptionBudget to chart (kubeflow#2078) * Add PodDisruptionBudget to chart Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> * PR comments Signed-off-by: Carlos Sánchez Páez <[email protected]> --------- Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> * Set topologySpreadConstraints Signed-off-by: jbhalodia-slack <[email protected]> * Update README and increase patch version Signed-off-by: jbhalodia-slack <[email protected]> * Revert replicaCount change Signed-off-by: jbhalodia-slack <[email protected]> * Update README after master merger Signed-off-by: jbhalodia-slack <[email protected]> * Update README Signed-off-by: jbhalodia-slack <[email protected]> --------- Signed-off-by: Yi Chen <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Co-authored-by: Yi Chen <[email protected]> Co-authored-by: Carlos Sánchez Páez <[email protected]>
* Add PodDisruptionBudget to chart Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> * PR comments Signed-off-by: Carlos Sánchez Páez <[email protected]> --------- Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]>
…ubeflow#2108) * Update helm docs (kubeflow#2081) Signed-off-by: Carlos Sánchez Páez <[email protected]> (cherry picked from commit eca3fc8) * Update the process to build api-docs, generate CRD manifests and code (kubeflow#2046) * Update .gitignore Signed-off-by: Yi Chen <[email protected]> * Update .dockerignore Signed-off-by: Yi Chen <[email protected]> * Update Makefile Signed-off-by: Yi Chen <[email protected]> * Update the process to generate api docs Signed-off-by: Yi Chen <[email protected]> * Update the workflow to generate api docs Signed-off-by: Yi Chen <[email protected]> * Use controller-gen to generate CRD and deep copy related methods Signed-off-by: Yi Chen <[email protected]> * Update helm chart CRDs Signed-off-by: Yi Chen <[email protected]> * Update workflow for building spark operator Signed-off-by: Yi Chen <[email protected]> * Update README.md Signed-off-by: Yi Chen <[email protected]> --------- Signed-off-by: Yi Chen <[email protected]> (cherry picked from commit 779ea3d) * Add topologySpreadConstraints (kubeflow#2091) * Update README and documentation (kubeflow#2047) * Update docs Signed-off-by: Yi Chen <[email protected]> * Remove docs and update README Signed-off-by: Yi Chen <[email protected]> * Add link to monthly community meeting Signed-off-by: Yi Chen <[email protected]> --------- Signed-off-by: Yi Chen <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> * Add PodDisruptionBudget to chart (kubeflow#2078) * Add PodDisruptionBudget to chart Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> * PR comments Signed-off-by: Carlos Sánchez Páez <[email protected]> --------- Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> * Set topologySpreadConstraints Signed-off-by: jbhalodia-slack <[email protected]> * Update README and increase patch version Signed-off-by: jbhalodia-slack <[email protected]> * Revert replicaCount change Signed-off-by: jbhalodia-slack <[email protected]> * Update README after master merger Signed-off-by: jbhalodia-slack <[email protected]> * Update README Signed-off-by: jbhalodia-slack <[email protected]> --------- Signed-off-by: Yi Chen <[email protected]> Signed-off-by: jbhalodia-slack <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Signed-off-by: Carlos Sánchez Páez <[email protected]> Co-authored-by: Yi Chen <[email protected]> Co-authored-by: Carlos Sánchez Páez <[email protected]> (cherry picked from commit 4108f54) * Use controller-runtime to reconsturct spark operator (kubeflow#2072) * Use controller-runtime to reconstruct spark operator Signed-off-by: Yi Chen <[email protected]> * Update helm charts Signed-off-by: Yi Chen <[email protected]> * Update examples Signed-off-by: Yi Chen <[email protected]> --------- Signed-off-by: Yi Chen <[email protected]> (cherry picked from commit 0dc641b) --------- Co-authored-by: Carlos Sánchez Páez <[email protected]> Co-authored-by: jbhalodia-slack <[email protected]>
Purpose of this PR
When running the operator in production, it would be nice to have a PDB to ensure HA and prevent service disruption.
Proposed changes:
Change Category
Indicate the type of change by marking the applicable boxes:
Rationale
Here's a blog post that summarizes the main advantages of PDBs
Checklist
Before submitting your PR, please review the following:
Additional Notes
x