Pod disruption budget

edit

A Pod Disruption Budget allows limiting disruptions on an existing set of Pods while the Kubernetes cluster administrator manages cluster 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/{eck_crd_version}
kind: Elasticsearch
metadata:
  name: quickstart
spec:
  version: 8.17.0
  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/v1alpha1
kind: Elasticsearch
metadata:
  name: quickstart
spec:
  version: 7.2.0
  nodes:
  - nodeCount: 3
  podDisruptionBudget: {}