From 6291ea4953ab87285f3991965307ae7edbcae0f2 Mon Sep 17 00:00:00 2001 From: Dhilip Date: Wed, 16 Aug 2017 16:26:56 +0530 Subject: [PATCH] promote initContainers to podspec (#1737) --- incubator/elasticsearch/Chart.yaml | 2 +- incubator/elasticsearch/README.md | 2 +- .../elasticsearch-client-deployment.yaml | 23 ++++++++----------- .../elasticsearch-data-statefulset.yaml | 22 ++++++++---------- .../elasticsearch-master-deployment.yaml | 23 ++++++++----------- 5 files changed, 29 insertions(+), 43 deletions(-) diff --git a/incubator/elasticsearch/Chart.yaml b/incubator/elasticsearch/Chart.yaml index 608c1f160a..17938ef43c 100755 --- a/incubator/elasticsearch/Chart.yaml +++ b/incubator/elasticsearch/Chart.yaml @@ -1,6 +1,6 @@ name: elasticsearch home: https://www.elastic.co/products/elasticsearch -version: 0.1.8 +version: 0.1.9 description: Flexible and powerful open source, distributed real-time search and analytics engine. icon: https://static-www.elastic.co/assets/blteb1c97719574938d/logo-elastic-elasticsearch-lt.svg sources: diff --git a/incubator/elasticsearch/README.md b/incubator/elasticsearch/README.md index 62c18c45df..0c242cf16d 100644 --- a/incubator/elasticsearch/README.md +++ b/incubator/elasticsearch/README.md @@ -7,7 +7,7 @@ elasticsearch and their ## Prerequisites Details -* Kubernetes 1.5 +* Kubernetes 1.6+ * PV dynamic provisioning support on the underlying infrastructure ## StatefulSets Details diff --git a/incubator/elasticsearch/templates/elasticsearch-client-deployment.yaml b/incubator/elasticsearch/templates/elasticsearch-client-deployment.yaml index 71b260baa9..64328a2e2a 100644 --- a/incubator/elasticsearch/templates/elasticsearch-client-deployment.yaml +++ b/incubator/elasticsearch/templates/elasticsearch-client-deployment.yaml @@ -16,20 +16,6 @@ spec: app: {{ template "name" . }} component: "{{ .Values.client.name }}" release: {{ .Release.Name }} - annotations: - # see https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html - # and https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html#mlockall - pod.alpha.kubernetes.io/init-containers: '[ - { - "name": "sysctl", - "image": "busybox", - "imagePullPolicy": "Always", - "command": ["sysctl", "-w", "vm.max_map_count=262144"], - "securityContext": { - "privileged": true - } - } - ]' spec: serviceAccountName: {{ template "fullname" . }} {{- if eq .Values.client.antiAffinity "hard" }} @@ -55,6 +41,15 @@ spec: release: "{{ .Release.Name }}" component: "{{ .Values.client.name }}" {{- end }} + initContainers: + # see https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html + # and https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html#mlockall + - name: "sysctl" + image: "busybox" + imagePullPolicy: "Always" + command: ["sysctl", "-w", "vm.max_map_count=262144"] + securityContext: + privileged: true containers: - name: elasticsearch env: diff --git a/incubator/elasticsearch/templates/elasticsearch-data-statefulset.yaml b/incubator/elasticsearch/templates/elasticsearch-data-statefulset.yaml index f71c2fb0f1..e72d47a012 100644 --- a/incubator/elasticsearch/templates/elasticsearch-data-statefulset.yaml +++ b/incubator/elasticsearch/templates/elasticsearch-data-statefulset.yaml @@ -19,19 +19,6 @@ spec: release: {{ .Release.Name }} annotations: pod.alpha.kubernetes.io/initialized: "true" - # see https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html - # and https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html#mlockall - pod.alpha.kubernetes.io/init-containers: '[ - { - "name": "sysctl", - "image": "busybox", - "imagePullPolicy": "Always", - "command": ["sysctl", "-w", "vm.max_map_count=262144"], - "securityContext": { - "privileged": true - } - } - ]' spec: serviceAccountName: {{ template "fullname" . }} {{- if eq .Values.data.antiAffinity "hard" }} @@ -57,6 +44,15 @@ spec: release: "{{ .Release.Name }}" component: "{{ .Values.data.name }}" {{- end }} + initContainers: + # see https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html + # and https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html#mlockall + - name: "sysctl" + image: "busybox" + imagePullPolicy: "Always" + command: ["sysctl", "-w", "vm.max_map_count=262144"] + securityContext: + privileged: true containers: - name: elasticsearch env: diff --git a/incubator/elasticsearch/templates/elasticsearch-master-deployment.yaml b/incubator/elasticsearch/templates/elasticsearch-master-deployment.yaml index 17ac8228b6..c5a199bede 100644 --- a/incubator/elasticsearch/templates/elasticsearch-master-deployment.yaml +++ b/incubator/elasticsearch/templates/elasticsearch-master-deployment.yaml @@ -16,20 +16,6 @@ spec: app: {{ template "name" . }} component: "{{ .Values.master.name }}" release: {{ .Release.Name }} - annotations: - # see https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html - # and https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html#mlockall - pod.alpha.kubernetes.io/init-containers: '[ - { - "name": "sysctl", - "image": "busybox", - "imagePullPolicy": "Always", - "command": ["sysctl", "-w", "vm.max_map_count=262144"], - "securityContext": { - "privileged": true - } - } - ]' spec: serviceAccountName: {{ template "fullname" . }} {{- if eq .Values.master.antiAffinity "hard" }} @@ -55,6 +41,15 @@ spec: release: "{{ .Release.Name }}" component: "{{ .Values.master.name }}" {{- end }} + initContainers: + # see https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html + # and https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html#mlockall + - name: "sysctl" + image: "busybox" + imagePullPolicy: "Always" + command: ["sysctl", "-w", "vm.max_map_count=262144"] + securityContext: + privileged: true containers: - name: elasticsearch env: