Skip to content

Commit

Permalink
Merge pull request #2589 from amazeeio/elastic-fix
Browse files Browse the repository at this point in the history
set vm.max_map_count in elasticsearch template
  • Loading branch information
Schnitzel authored Mar 31, 2021
2 parents 1b1cbf9 + 115168d commit 10ae63e
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ spec:
enableServiceLinks: false
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
# This init container sets the appropriate limits for mmap counts on the hosting node.
# https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html
- name: set-max-map-count
image: ubuntu:20.04
imagePullPolicy: {{ .Values.imagePullPolicy }}
securityContext:
privileged: true
command:
- /bin/bash
- -c
- 'if [[ "$(sysctl vm.max_map_count --values)" -lt 262144 ]]; then sysctl -w vm.max_map_count=262144; fi'
containers:
- image: {{ .Values.image | quote }}
name: {{ .Chart.Name }}
Expand Down

0 comments on commit 10ae63e

Please sign in to comment.