Pod disruption budget

edit

A Pod Disruption Budget allows limiting disruptions on an existing set of Pods while the Kubernetes cluster administrator manages Kubernetes nodes. Elasticsearch makes sure some indices don’t become unavailable.

A default PDB is enforced by default: it allows one Elasticsearch Pod to be taken down as long as the cluster has a green health.

This default can be tweaked in the Elasticsearch specification:

apiVersion: elasticsearch.k8s.elastic.co/v1beta1
kind: Elasticsearch
metadata:
  name: quickstart
spec:
  version: 8.16.1
  nodeSets:
  - name: default
    count: 3
  podDisruptionBudget:
    spec:
      minAvailable: 2
      selector:
        matchLabels:
          elasticsearch.k8s.elastic.co/cluster-name: quickstart

Note that maxUnavailable cannot be used with an arbitrary label selector, hence the usage of minAvailable in this example.

The default PDB can also be explicitly disabled:

apiVersion: elasticsearch.k8s.elastic.co/v1beta1
kind: Elasticsearch
metadata:
  name: quickstart
spec:
  version: 8.16.1
  nodeSets:
  - name: default
    count: 3
  podDisruptionBudget: {}