pires / kubernetes-elasticsearch-cluster

Elasticsearch cluster on top of Kubernetes made easy.
Apache License 2.0
1.51k stars 687 forks source link

High Availability on Pod Disruptions #174

Closed rdrgporto closed 6 years ago

rdrgporto commented 6 years ago

Hi!

First of all, thanks for creating this repository (it saves me a lot of time). Secondly, I am working/testing on your project and I have a doubt:

Environment:

kubectl get pods -o wide
NAME  READY  STATUS  RESTARTS  AGE  IP  NODE
es-data-0  1/1  Running  0  10m  10.47.0.21  nxt-nodo2
es-data-1  1/1  Running  0  19h  10.40.0.9  nxt-nodo3
es-data-2  1/1  Running  0  19h  10.44.0.6  nxt-nodo1
es-master-7d96748f5b-5pzvh  1/1  Running  0  5m  10.47.0.22  nxt-nodo2
es-master-7d96748f5b-9lkgf  1/1  Running  0  19h  10.44.0.3  nxt-nodo1
es-master-7d96748f5b-zdnr9  1/1  Running  0  19h  10.40.0.5  nxt-nodo3

I am working on Elasticsearch StatefulSet Data Pod (provisioned by GlusterFS). I would like to have High Availability, so that, I am testing with Pod Disruptions (I deployed pdb.yaml). If I shutdown a node, pod Master is evicted, however, pod data isn’t.

This behaviour is right? Need I configure anything else?

Thank is advance,

Regards 🖖

pires commented 6 years ago

Hello!

The behavior is right, yes. Pod eviction algorithm takes in mind a bunch of rules. One of them is something like this: if pod disruption is violated DO NOT evict pod. Therefore, you should increase your pod count (in this case, the es-data pod count) to accomodate pod disruption when evicting.