Skip to content

Commit

Permalink
Adding PDB to es master and data
Browse files Browse the repository at this point in the history
With this PDB, only one pod can be unavailable (but not if we request
manually a pod delete)
  • Loading branch information
deimosfr authored and pires committed Oct 25, 2017
1 parent 0db24d0 commit 1e94885
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,16 @@ spec:
<a id="helm">
## 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:
Expand Down
10 changes: 10 additions & 0 deletions es-data-pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: elasticsearch-data
spec:
maxUnavailable: 1
selector:
matchLabels:
component: elasticsearch
role: data
10 changes: 10 additions & 0 deletions es-master-pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: elasticsearch-master
spec:
maxUnavailable: 1
selector:
matchLabels:
component: elasticsearch
role: master

0 comments on commit 1e94885

Please sign in to comment.