Skip to content
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 Atlassian DC Helm Charts #636

Merged
merged 5 commits into from
Aug 7, 2023
Merged

Add PodDisruptionBudget to Atlassian DC Helm Charts #636

merged 5 commits into from
Aug 7, 2023

Conversation

bianchi2
Copy link
Collaborator

@bianchi2 bianchi2 commented Aug 5, 2023

PodDisruptionBudget is a critical resource when it comes to high availability and (un)planned disruptions like worker node upgrades, evictions etc.

This PR adds a pdb template and a pbd stanza in values.yaml. Note that when both minAvailable and maxUnavailable are set, maxUnavailable takes precedence. By default PDB is disabled.

Just in case, custom pdb labels and annotations can be defined in values. Covered with unit tests.

Checklist

  • I have added unit tests
  • I have applied the change to all applicable products
  • The E2E test has passed (use e2e label)

@nanux
Copy link
Member

nanux commented Aug 7, 2023

Can you describe a scenario in which pod disruption budget is used with our products?

# -- PodDisruptionBudget: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
# You can specify only one of maxUnavailable and minAvailable in a single PodDisruptionBudget
#
pdb:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer using full podDisruptionBudget name. Maybe pbd is a common term in Kubernetes community, but it is still a cognitive overload every time we encounter this shorthand. It doesn't cost much to use the full name and it is clearer for customers as well.

@@ -139,6 +139,7 @@ Kubernetes: `>=1.21.x-0`
| monitoring.serviceMonitor.prometheusLabelSelector | object | `{}` | ServiceMonitorSelector of the prometheus instance. |
| monitoring.serviceMonitor.scrapeIntervalSeconds | int | `30` | Scrape interval for the JMX service. |
| nodeSelector | object | `{}` | Standard K8s node-selectors that will be applied to all Bamboo pods |
| pdb | object | `{"annotations":{},"enabled":false,"labels":{},"maxUnavailable":null,"minAvailable":null}` | PodDisruptionBudget: https://kubernetes.io/docs/tasks/run-application/configure-pdb/ You can specify only one of maxUnavailable and minAvailable in a single PodDisruptionBudget |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can also include Note that when both minAvailable and maxUnavailable are set, maxUnavailable takes precedence.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, makes sense

@bianchi2
Copy link
Collaborator Author

bianchi2 commented Aug 7, 2023

@nanux thanks for your comments! In more than 50% of helm charts that I have recently installed, pdb is pdb :) Though, there are ones where it's PodDisruptionBudget. I have changed the name.

As to how pdb can be used with Atlassian DC products, it's not different from any deployment or statefulset. PDB is a guard rail to prevent a node from draining if pdb says there must be, say, at least 2 pods at all times. DPB is ofted used in combo with anti affinity rules to make sure your app always has some quorum. In case of DC products, you may want to make sure that there are at least 3 running and ready Jira pods at all times.

I can't explain it better than Kube docs do 😃

@bianchi2 bianchi2 requested a review from nanux August 7, 2023 02:37
@bianchi2 bianchi2 merged commit 599979e into main Aug 7, 2023
@bianchi2 bianchi2 deleted the pdb branch August 7, 2023 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants