From 1e9488543b80b681e4bf116a05147038a6dc1021 Mon Sep 17 00:00:00 2001 From: Deimosfr Date: Tue, 19 Sep 2017 20:51:29 +0200 Subject: [PATCH] Adding PDB to es master and data With this PDB, only one pod can be unavailable (but not if we request manually a pod delete) --- README.md | 10 ++++++++++ es-data-pdb.yaml | 10 ++++++++++ es-master-pdb.yaml | 10 ++++++++++ 3 files changed, 30 insertions(+) create mode 100644 es-data-pdb.yaml create mode 100644 es-master-pdb.yaml diff --git a/README.md b/README.md index 3b4fac2..e0399c2 100644 --- a/README.md +++ b/README.md @@ -222,6 +222,16 @@ spec: +## PodDisruptionBudget + +If you want to ensure that more than 1 node won't be unavailable at a time, you can add PodDisruptionBudget manifests: +``` +kubectl create -f es-master-pdb.yaml +kubectl create -f es-data-pdb.yaml +``` + +Note: It's not recommended to grow this number because 1 node could be in maintenance, another fall down and you can't lose another node if the number of replicas is equal to two. + ## Deploying with Helm [Helm](https://github.com/kubernetes/helm) charts for a basic (non-stateful) ElasticSearch deployment are maintained at https://github.com/clockworksoul/helm-elasticsearch. With Helm properly installed and configured, standing up a complete cluster is almost trivial: diff --git a/es-data-pdb.yaml b/es-data-pdb.yaml new file mode 100644 index 0000000..2ac8240 --- /dev/null +++ b/es-data-pdb.yaml @@ -0,0 +1,10 @@ +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: elasticsearch-data +spec: + maxUnavailable: 1 + selector: + matchLabels: + component: elasticsearch + role: data diff --git a/es-master-pdb.yaml b/es-master-pdb.yaml new file mode 100644 index 0000000..eff3d2a --- /dev/null +++ b/es-master-pdb.yaml @@ -0,0 +1,10 @@ +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: elasticsearch-master +spec: + maxUnavailable: 1 + selector: + matchLabels: + component: elasticsearch + role: master