# 2 containers created but there is only one such spec in Elasticsearch.yaml

**URL:** <https://discuss.elastic.co/t/2-containers-created-but-there-is-only-one-such-spec-in-elasticsearch-yaml/273171>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [May 17, 2021, 12:03pm UTC](https://discuss.elastic.co/t/2-containers-created-but-there-is-only-one-such-spec-in-elasticsearch-yaml/273171 "2021-05-17T12:03:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkaramol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pkaramol/32/22610_2.png) [@pkaramol](https://discuss.elastic.co/u/pkaramol)\
**Post date:** [May 17, 2021, 12:03pm UTC](https://discuss.elastic.co/t/2-containers-created-but-there-is-only-one-such-spec-in-elasticsearch-yaml/273171/1 "2021-05-17T12:03:40Z")

</div>

I am using the following manifest to create my `Elasticsearch` resource.

I would expect that since for each set of nodes (`master` / `data`) I only have one `container` specification, only one of them would be created in each pod

```auto
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: elasticsearch-sample
  namespace: eck-poc
spec:
  version: 7.11.0
  nodeSets:
  - name: master
    config:
      node.roles: ["master"]
      node.store.allow_mmap: false
    podTemplate:
      metadata:
        labels:
          env: eck-poc-master
      spec:
        containers:
        - name: elasticsearch-master
          image: docker.elastic.co/elasticsearch/elasticsearch:7.11.0
          # specify resource limits and requests
          resources:
            requests:
              memory: 2Gi
              cpu: 0.5
            limits:
              memory: 6Gi
              cpu: 1
          env:
          - name: ES_JAVA_OPTS
            value: "-Xms1g -Xmx1g"
    count: 3
    volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 20Gi
        storageClassName: standard
  - name: data
    config:
      node.roles: ["data"]
      node.store.allow_mmap: false
    podTemplate:
      metadata:
        labels:
          env: eck-poc-data
      spec:
        containers:
        - name: elasticsearch-data
          image: docker.elastic.co/elasticsearch/elasticsearch:7.11.0
          # specify resource limits and requests
          resources:
            requests:
              memory: 3Gi
              cpu: 1
            limits:
              memory: 6Gi
              cpu: 2
          env:
          - name: ES_JAVA_OPTS
            value: "-Xms2g -Xmx2g"
    count: 3
    volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 40Gi
        storageClassName: balanced-rwo

```

I see two containers in e.g. a `data` pod, one named `name: elasticsearch-data` and one named plain `elasticsearch`.

Is this the expected behavior?

---

<div class="post-metadata">

**Author:** ![pkaramol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pkaramol/32/22610_2.png) [@pkaramol](https://discuss.elastic.co/u/pkaramol)\
**Post date:** [May 17, 2021, 12:13pm UTC](https://discuss.elastic.co/t/2-containers-created-but-there-is-only-one-such-spec-in-elasticsearch-yaml/273171/2 "2021-05-17T12:13:02Z")

</div>

Nevermind, apparently we should not mess with the container's `name`...

---

<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:** [June 14, 2021, 12:13pm UTC](https://discuss.elastic.co/t/2-containers-created-but-there-is-only-one-such-spec-in-elasticsearch-yaml/273171/3 "2021-06-14T12:13:41Z")

</div>

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