Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
[elasticsearch] Disable masterTerminationFix by default
Browse files Browse the repository at this point in the history
Closes: #191
This fix which was added for #63 is no longer needed in Elasticsearch >
7.2.0 as this has been fixed upstream.
  • Loading branch information
Crazybus committed Jul 1, 2019
1 parent 2817601 commit b786a50
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions elasticsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ helm install --name elasticsearch elastic/elasticsearch --version 7.2.0 --set im
| `tolerations` | Configurable [tolerations](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) | `[]` |
| `ingress` | Configurable [ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/) to expose the Elasticsearch service. See [`values.yaml`](./values.yaml) for an example | `enabled: false` |
| `schedulerName` | Name of the [alternate scheduler](https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/#specify-schedulers-for-pods) | `nil` |
| `masterTerminationFix` | A workaround needed for Elasticsearch < 7.2.0 to prevent master status being lost during restarts [#63](https://github.com/elastic/helm-charts/issues/63) | `false` |

## Try it out

Expand Down
2 changes: 2 additions & 0 deletions elasticsearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ spec:
{{- if .Values.extraVolumeMounts }}
{{ tpl .Values.extraVolumeMounts . | indent 10 }}
{{- end }}
{{- if .Values.masterTerminationFix }}
{{- if eq .Values.roles.master "true" }}
# This sidecar will prevent slow master re-election
# https://github.com/elastic/helm-charts/issues/63
Expand Down Expand Up @@ -272,3 +273,4 @@ spec:
{{ toYaml .Values.extraEnvs | indent 10 }}
{{- end }}
{{- end }}
{{- end }}
16 changes: 16 additions & 0 deletions elasticsearch/tests/elasticsearch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,3 +614,19 @@ def test_adding_a_nodePort():
r = helm_template(config)

assert r['service'][uname]['spec']['ports'][0]['nodePort'] == 30001

def test_master_termination_fixed_enabled():
config = ''

r = helm_template(config)

assert len(r['statefulset'][uname]['spec']['template']['spec']['containers']) == 1

config = '''
masterTerminationFix: true
'''

r = helm_template(config)

c = r['statefulset'][uname]['spec']['template']['spec']['containers'][1]
assert c['name'] == 'elasticsearch-master-graceful-termination-handler'
3 changes: 3 additions & 0 deletions elasticsearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,6 @@ ingress:

nameOverride: ""
fullnameOverride: ""

# https://github.com/elastic/helm-charts/issues/63
masterTerminationFix: false

0 comments on commit b786a50

Please sign in to comment.