# Setting heap size and jvm parameters on elastic docker image

**URL:** <https://discuss.elastic.co/t/setting-heap-size-and-jvm-parameters-on-elastic-docker-image/251953>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [October 13, 2020, 6:56pm UTC](https://discuss.elastic.co/t/setting-heap-size-and-jvm-parameters-on-elastic-docker-image/251953 "2020-10-13T18:56:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdevilla20](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jdevilla20/32/75281_2.png) [@jdevilla20](https://discuss.elastic.co/u/jdevilla20)\
**Post date:** [October 13, 2020, 6:56pm UTC](https://discuss.elastic.co/t/setting-heap-size-and-jvm-parameters-on-elastic-docker-image/251953/1 "2020-10-13T18:56:24Z")

</div>

Hi

I am using [elasticsearch.k8s.elastic.co/v1](http://elasticsearch.k8s.elastic.co/v1) to deploy Elasticsearch defined here

> **[Deploy an Elasticsearch cluster | Elastic Cloud on Kubernetes \[1.2\] | Elastic](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-elasticsearch.html)**

When I have deployed to Kubernetes, I notice that the heap size is set to 1GB. I would like to increase it to 4GB.

How can I set the java override options and "-Xms1g -Xmx1g " via this yaml?

Thanks

Joe

---

<div class="post-metadata">

**Author:** ![Iker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iker/32/91708_2.png) [@Iker](https://discuss.elastic.co/u/Iker)\
**Post date:** [October 13, 2020, 9:58pm UTC](https://discuss.elastic.co/t/setting-heap-size-and-jvm-parameters-on-elastic-docker-image/251953/2 "2020-10-13T21:58:58Z")

</div>

You are looking for this specific section: [https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-managing-compute-resources.html](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-managing-compute-resources.html)

---

<div class="post-metadata">

**Author:** ![jdevilla20](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jdevilla20/32/75281_2.png) [@jdevilla20](https://discuss.elastic.co/u/jdevilla20)\
**Post date:** [October 13, 2020, 10:20pm UTC](https://discuss.elastic.co/t/setting-heap-size-and-jvm-parameters-on-elastic-docker-image/251953/3 "2020-10-13T22:20:05Z")

</div>

How do I do it using this configuration? I notice that that spec uses a container.

```auto
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: ingestion
spec:
  version: 7.6.2
  http:
    tls:
      selfSignedCertificate:
        disabled: true
    service:
      spec:
        ports:
          - name: http
            port: 9200
            targetPort: 9200
  nodeSets:
    - name: data
      count: 5
      config:
        node.master: false
        node.data: true
        node.ingest: true
        node.store.allow_mmap: false
      podTemplate:
        metadata:
          labels:
            app: elasticsearch
            service: ingestion

      volumeClaimTemplates:
        - metadata:
            name: elasticsearch-data
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 1T
            storageClassName: ssd
    - name: master
      count: 3
      config:
        node.master: true
        node.data: false
        node.ingest: false
        node.store.allow_mmap: false
      podTemplate:
        metadata:
          labels:
            app: elasticsearch
            service: ingestion
          annotations:
            traffic.sidecar.istio.io/excludeOutboundPorts: "9300"
            traffic.sidecar.istio.io/excludeInboundPorts: "9300"
      volumeClaimTemplates:
        - metadata:
            name: elasticsearch-data
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 300Gi
            storageClassName: ssd

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 10, 2020, 10:20pm UTC](https://discuss.elastic.co/t/setting-heap-size-and-jvm-parameters-on-elastic-docker-image/251953/4 "2020-11-10T22:20:09Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
