From 37bfb62560ac91cc3d49b2412a669baddea5ed09 Mon Sep 17 00:00:00 2001 From: Johnathan Rodgers Date: Mon, 7 Jan 2019 13:15:14 -0500 Subject: [PATCH] [stable/elasticsearch] Request resource limits for initContainer (#10444) * [stable/elasticsearch] Request resource limits for initContainer Signed-off-by: Johnathan Rodgers * Update README for initResource variables Signed-off-by: Johnathan Rodgers --- stable/elasticsearch/Chart.yaml | 2 +- stable/elasticsearch/README.md | 3 +++ .../templates/client-deployment.yaml | 2 ++ .../templates/data-statefulset.yaml | 4 ++++ .../templates/master-statefulset.yaml | 4 ++++ stable/elasticsearch/values.yaml | 21 +++++++++++++++++++ 6 files changed, 35 insertions(+), 1 deletion(-) diff --git a/stable/elasticsearch/Chart.yaml b/stable/elasticsearch/Chart.yaml index eb85d7aaf9..d7c0c5b326 100755 --- a/stable/elasticsearch/Chart.yaml +++ b/stable/elasticsearch/Chart.yaml @@ -1,6 +1,6 @@ name: elasticsearch home: https://www.elastic.co/products/elasticsearch -version: 1.15.4 +version: 1.15.5 appVersion: 6.5.4 description: Flexible and powerful open source, distributed real-time search and analytics engine. diff --git a/stable/elasticsearch/README.md b/stable/elasticsearch/README.md index a2b85be4d2..74d5b87377 100644 --- a/stable/elasticsearch/README.md +++ b/stable/elasticsearch/README.md @@ -88,10 +88,12 @@ The following table lists the configurable parameters of the elasticsearch chart | `client.loadBalancerSourceRanges` | Client loadBalancerSourceRanges | `{}` | | `client.antiAffinity` | Client anti-affinity policy | `soft` | | `client.nodeAffinity` | Client node affinity policy | `{}` | +| `client.initResources` | Client initContainer resources requests & limits | `{}` | | `client.ingress.enabled` | Enable Client Ingress | `false` | | `client.ingress.annotations` | Client Ingress annotations | `{}` | | `client.ingress.hosts` | Client Ingress Hostnames | `[]` | | `client.ingress.tls` | Client Ingress TLS configuration | `[]` | +| `master.initResources` | Master initContainer resources requests & limits | `{}` | | `master.exposeHttp` | Expose http port 9200 on master Pods for monitoring, etc | `false` | | `master.name` | Master component name | `master` | | `master.replicas` | Master node replicas (deployment) | `2` | @@ -110,6 +112,7 @@ The following table lists the configurable parameters of the elasticsearch chart | `master.antiAffinity` | Master anti-affinity policy | `soft` | | `master.nodeAffinity` | Master node affinity policy | `{}` | | `master.updateStrategy` | Master node update strategy policy | `{type: "onDelete"}` | +| `data.initResources` | Data initContainer resources requests & limits | `{}` | | `data.exposeHttp` | Expose http port 9200 on data Pods for monitoring, etc | `false` | | `data.replicas` | Data node replicas (statefulset) | `2` | | `data.resources` | Data node resources requests & limits | `{} - cpu limit must be an integer` | diff --git a/stable/elasticsearch/templates/client-deployment.yaml b/stable/elasticsearch/templates/client-deployment.yaml index 75cd6ce992..e955da5837 100644 --- a/stable/elasticsearch/templates/client-deployment.yaml +++ b/stable/elasticsearch/templates/client-deployment.yaml @@ -69,6 +69,8 @@ spec: - name: "sysctl" image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" imagePullPolicy: {{ .Values.initImage.pullPolicy | quote }} + resources: +{{ toYaml .Values.client.initResources | indent 12 }} command: ["sysctl", "-w", "vm.max_map_count=262144"] securityContext: privileged: true diff --git a/stable/elasticsearch/templates/data-statefulset.yaml b/stable/elasticsearch/templates/data-statefulset.yaml index 9e738efade..2752ace569 100644 --- a/stable/elasticsearch/templates/data-statefulset.yaml +++ b/stable/elasticsearch/templates/data-statefulset.yaml @@ -71,12 +71,16 @@ spec: - name: "sysctl" image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" imagePullPolicy: {{ .Values.initImage.pullPolicy | quote }} + resources: +{{ toYaml .Values.data.initResources | indent 12 }} command: ["sysctl", "-w", "vm.max_map_count=262144"] securityContext: privileged: true - name: "chown" image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy | quote }} + resources: +{{ toYaml .Values.data.initResources | indent 12 }} command: - /bin/bash - -c diff --git a/stable/elasticsearch/templates/master-statefulset.yaml b/stable/elasticsearch/templates/master-statefulset.yaml index c0119976e8..5bf95b00cf 100644 --- a/stable/elasticsearch/templates/master-statefulset.yaml +++ b/stable/elasticsearch/templates/master-statefulset.yaml @@ -71,12 +71,16 @@ spec: - name: "sysctl" image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" imagePullPolicy: {{ .Values.initImage.pullPolicy | quote }} + resources: +{{ toYaml .Values.master.initResources | indent 12 }} command: ["sysctl", "-w", "vm.max_map_count=262144"] securityContext: privileged: true - name: "chown" image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy | quote }} + resources: +{{ toYaml .Values.master.initResources | indent 12 }} command: - /bin/bash - -c diff --git a/stable/elasticsearch/values.yaml b/stable/elasticsearch/values.yaml index b90378869d..ba755da4c6 100644 --- a/stable/elasticsearch/values.yaml +++ b/stable/elasticsearch/values.yaml @@ -75,6 +75,13 @@ client: nodeAffinity: {} nodeSelector: {} tolerations: [] + initResources: {} + # limits: + # cpu: "25m" + # # memory: "128Mi" + # requests: + # cpu: "25m" + # memory: "128Mi" resources: limits: cpu: "1" @@ -118,6 +125,13 @@ master: nodeAffinity: {} nodeSelector: {} tolerations: [] + initResources: {} + # limits: + # cpu: "25m" + # # memory: "128Mi" + # requests: + # cpu: "25m" + # memory: "128Mi" resources: limits: cpu: "1" @@ -152,6 +166,13 @@ data: nodeAffinity: {} nodeSelector: {} tolerations: [] + initResources: {} + # limits: + # cpu: "25m" + # # memory: "128Mi" + # requests: + # cpu: "25m" + # memory: "128Mi" resources: limits: cpu: "1"