diff --git a/elasticsearch/README.md b/elasticsearch/README.md index a17ea420d..d8b21feda 100644 --- a/elasticsearch/README.md +++ b/elasticsearch/README.md @@ -77,6 +77,7 @@ helm install --name elasticsearch elastic/elasticsearch --version 7.1.1 --set im | `esJavaOpts` | [Java options](https://www.elastic.co/guide/en/elasticsearch/reference/current/jvm-options.html) for Elasticsearch. This is where you should configure the [jvm heap size](https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html) | `-Xmx1g -Xms1g` | | `resources` | Allows you to set the [resources](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/) for the statefulset | `requests.cpu: 100m`
`requests.memory: 2Gi`
`limits.cpu: 1000m`
`limits.memory: 2Gi` | | `initResources` | Allows you to set the [resources](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/) for the initContainer in the statefulset | {} | +| `sidecarResources` | Allows you to set the [resources](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/) for the sidecar containers in the statefulset | {} | | `networkHost` | Value for the [network.host Elasticsearch setting](https://www.elastic.co/guide/en/elasticsearch/reference/current/network.host.html) | `0.0.0.0` | | `volumeClaimTemplate` | Configuration for the [volumeClaimTemplate for statefulsets](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#stable-storage). You will want to adjust the storage (default `30Gi`) and the `storageClassName` if you are using a different storage class | `accessModes: [ "ReadWriteOnce" ]`
`resources.requests.storage: 30Gi` | | `persistence.annotations` | Additional persistence annotations for the `volumeClaimTemplate` | `{}` | diff --git a/elasticsearch/templates/statefulset.yaml b/elasticsearch/templates/statefulset.yaml index be2d44f8e..683ddb83a 100644 --- a/elasticsearch/templates/statefulset.yaml +++ b/elasticsearch/templates/statefulset.yaml @@ -263,6 +263,8 @@ spec: sleep infinity & wait $! + resources: +{{ toYaml .Values.sidecarResources | indent 10 }} env: - name: NODE_NAME valueFrom: diff --git a/elasticsearch/tests/elasticsearch_test.py b/elasticsearch/tests/elasticsearch_test.py index 9422858a2..55fcb8acc 100755 --- a/elasticsearch/tests/elasticsearch_test.py +++ b/elasticsearch/tests/elasticsearch_test.py @@ -459,6 +459,30 @@ def test_adding_resources_to_initcontainer(): } } +def test_adding_resources_to_sidecar_container(): + config = ''' +sidecarResources: + limits: + cpu: "100m" + memory: "128Mi" + requests: + cpu: "100m" + memory: "128Mi" +''' + r = helm_template(config) + i = r['statefulset'][uname]['spec']['template']['spec']['containers'][1] + + assert i['resources'] == { + 'requests': { + 'cpu': '100m', + 'memory': '128Mi' + }, + 'limits': { + 'cpu': '100m', + 'memory': '128Mi' + } + } + def test_adding_a_node_affinity(): config = ''' nodeAffinity: diff --git a/elasticsearch/values.yaml b/elasticsearch/values.yaml index 14d28f71a..8db4418da 100755 --- a/elasticsearch/values.yaml +++ b/elasticsearch/values.yaml @@ -67,6 +67,14 @@ initResources: {} # cpu: "25m" # memory: "128Mi" +sidecarResources: {} + # limits: + # cpu: "25m" + # # memory: "128Mi" + # requests: + # cpu: "25m" + # memory: "128Mi" + networkHost: "0.0.0.0" volumeClaimTemplate: