UNCLASSIFIED - NO CUI

Skip to content

Add `elasticsearch.podDisruptionBudget` to `values.yaml`

Kevin Snyder requested to merge feature/podDisruptionBudget into main

General MR

Summary

Allows us to control the behavior of the PodDisruptionBudget created by the Elasticsearch manifest.

Elasticsearch default behavior is to create a PodDisruptionBudget that "allows one Elasticsearch Pod to be taken down". However, when upgrading Kubernetes clusters, we have found this to be too aggressive and it has resulted in failed upgrades as Kubernetes is unable to evict the pods from the nodes.

Adding this value allows us to control the behavior of the PodDisruptionBudget in the following ways:

  • Default: elasticsearch.podDisruptionBudget.create is true:
    • Default: elasticsearch.podDisruptionBudget.values is {} and spec.podDisruptionBudget is not defined in the Elasticsearch manifest (Elasticsearch default PodDisruptionBudget behavior is used as before)
    • Custom: elasticsearch.podDisruptionBudget.values is any value and that value is passed to spec.podDisruptionBudget in the Elasticsearch manifest (PodDisruptionBudget behavior is fully customizable)
  • Custom: elasticsearch.podDisruptionBudget.create is false and spec.podDisruptionBudget is set to {} in the Elasticsearch manifest (PodDisruptionBudget is not created)

Because setting spec.podDisruptionBudget: {} in the Elasticsearch manifest is how you disable the PodDisruptionBudget, we had to use a separate boolean create and conditional logic to control whether or not the values would be passed to the Elasticsearch manifest, as {} evaluates to false and would result in this value not making it into the manifest. This is a common way to work around such limitations in Helm charts.

Relevant logs/screenshots

Documentation: https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-pod-disruption-budget.html

Linked Issue

Closes #202 (closed)

Upgrade Notices

N/A

Edited by Christopher O'Connell

Merge request reports