# Trouble installing plugins on ECK with initContainers method

**URL:** <https://discuss.elastic.co/t/trouble-installing-plugins-on-eck-with-initcontainers-method/198291>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [September 5, 2019, 4:30pm UTC](https://discuss.elastic.co/t/trouble-installing-plugins-on-eck-with-initcontainers-method/198291 "2019-09-05T16:30:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![getorca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/getorca/32/42269_2.png) [@getorca](https://discuss.elastic.co/u/getorca)\
**Post date:** [September 5, 2019, 4:30pm UTC](https://discuss.elastic.co/t/trouble-installing-plugins-on-eck-with-initcontainers-method/198291/1 "2019-09-05T16:30:58Z")

</div>

I'm attempting to install plugins using the initContainers method, my code is as follows:

```auto
  version: 7.2.0
  nodes:
  - podTemplate:
      spec:
        initContainers:
        - name: install-plugins
          command: ['sh', '-c', '| bin/elasticsearch-plugin install --batch repository-s3']
  - nodeCount: 3
    config:
      node.master: true
      node.data: true
      node.ingest: true
    volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data # note: elasticsearch-data must be the name of the Elasticsearch volume
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 100Gi
        storageClassName: do-block-storage
  updateStrategy:
    changeBudget:
      maxSurge: 0
      maxUnavailable: 1

```

However the plugins aren't install and the pods don't update. I can see the version has updated with `kubectl describe -f elasticsearch.yaml`

How do I get the plugin to install?

---

<div class="post-metadata">

**Author:** ![pebrc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pebrc/32/101790_2.png) [@pebrc](https://discuss.elastic.co/u/pebrc)\
**Post date:** [September 5, 2019, 4:55pm UTC](https://discuss.elastic.co/t/trouble-installing-plugins-on-eck-with-initcontainers-method/198291/2 "2019-09-05T16:55:24Z")

</div>

[https://www.elastic.co/guide/en/cloud-on-k8s/0.9/k8s-bundles-plugins.html](https://www.elastic.co/guide/en/cloud-on-k8s/0.9/k8s-bundles-plugins.html) is maybe a bit brief about the structure, but the `podTemplate` element has to be part of the node spec. In your sample you are defining inadvertently a second empty group of nodes.

So probably what you want is something like this

```auto
  version: 7.2.0
  nodes:
  - nodeCount: 3
    config:
      node.master: true
      node.data: true
      node.ingest: true
    podTemplate:
      spec:
        initContainers:
        - name: install-plugins
          command: ['sh', '-c', 'bin/elasticsearch-plugin install --batch repository-s3']
    volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data # note: elasticsearch-data must be the name of the Elasticsearch volume
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 100Gi
        storageClassName: do-block-storage
  updateStrategy:
    changeBudget:
      maxSurge: 0
      maxUnavailable: 1

```

---

<div class="post-metadata">

**Author:** ![getorca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/getorca/32/42269_2.png) [@getorca](https://discuss.elastic.co/u/getorca)\
**Post date:** [September 5, 2019, 5:04pm UTC](https://discuss.elastic.co/t/trouble-installing-plugins-on-eck-with-initcontainers-method/198291/3 "2019-09-05T17:04:51Z")

</div>

that didn't do anything different, the pods aren't updating.

the client and server versions are as follows:

````auto
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T11:13:54Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T11:05:50Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}```
````

---

<div class="post-metadata">

**Author:** ![getorca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/getorca/32/42269_2.png) [@getorca](https://discuss.elastic.co/u/getorca)\
**Post date:** [September 5, 2019, 7:05pm UTC](https://discuss.elastic.co/t/trouble-installing-plugins-on-eck-with-initcontainers-method/198291/5 "2019-09-05T19:05:11Z")

</div>

I've tried to run the yaml on a brand new cluter, at least I'm getting an error from a typo, but if I try and change any entries under initContainer, and apply the changes, it has no effect, except on the first first run.

---

<div class="post-metadata">

**Author:** ![getorca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/getorca/32/42269_2.png) [@getorca](https://discuss.elastic.co/u/getorca)\
**Post date:** [September 6, 2019, 8:06pm UTC](https://discuss.elastic.co/t/trouble-installing-plugins-on-eck-with-initcontainers-method/198291/6 "2019-09-06T20:06:01Z")

</div>

Fixed the typo, seemed to have to build the cluster again, but was receiving the same error as described here, [https://github.com/elastic/cloud-on-k8s/issues/1590](https://github.com/elastic/cloud-on-k8s/issues/1590)

---

<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 4, 2022, 7:24am UTC](https://discuss.elastic.co/t/trouble-installing-plugins-on-eck-with-initcontainers-method/198291/7 "2022-11-04T07:24:16Z")

</div>


