Add `elasticsearch.podDisruptionBudget` to `values.yaml`
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.createistrue:- Default:
elasticsearch.podDisruptionBudget.valuesis{}andspec.podDisruptionBudgetis not defined in theElasticsearchmanifest (ElasticsearchdefaultPodDisruptionBudgetbehavior is used as before) - Custom:
elasticsearch.podDisruptionBudget.valuesis any value and that value is passed tospec.podDisruptionBudgetin theElasticsearchmanifest (PodDisruptionBudgetbehavior is fully customizable)
- Default:
- Custom:
elasticsearch.podDisruptionBudget.createisfalseandspec.podDisruptionBudgetis set to{}in theElasticsearchmanifest (PodDisruptionBudgetis 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