# Installing Elasticsearch plugins when ES is running as Kubernetes pod

**URL:** <https://discuss.elastic.co/t/installing-elasticsearch-plugins-when-es-is-running-as-kubernetes-pod/260799>\
**Category:** Elasticsearch\
**Created:** [January 12, 2021, 8:47am UTC](https://discuss.elastic.co/t/installing-elasticsearch-plugins-when-es-is-running-as-kubernetes-pod/260799 "2021-01-12T08:47:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sun24](https://avatars.discourse-cdn.com/v4/letter/s/ed8c4c/32.png) [@sun24](https://discuss.elastic.co/u/sun24)\
**Post date:** [January 12, 2021, 8:47am UTC](https://discuss.elastic.co/t/installing-elasticsearch-plugins-when-es-is-running-as-kubernetes-pod/260799/1 "2021-01-12T08:47:33Z")

</div>

I understand that one method is to use the

> containers:  
> command: _Required command_

But this data is not retained once the pod restarts and the command is run again and again resulting in a crashloopbackoff. How to resolve this?

here's my deployment file for reference

> apiVersion: apps/v1  
> kind: Deployment  
> metadata:  
> name: elastic-deployment  
> labels:  
> app: elastic  
> spec:  
> replicas: 1  
> selector:  
> matchLabels:  
> app: elastic  
> template:  
> metadata:  
> labels:  
> app: elastic  
> spec:  
> containers:  
> - name: elastic  
> image: [docker.elastic.co/elasticsearch/elasticsearch:7.2.0](http://docker.elastic.co/elasticsearch/elasticsearch:7.2.0)  
> ports:  
> - containerPort: 9200  
> - containerPort: 9300  
> env:  
> - name: discovery.type  
> value: "single-node"  
> command:  
> - "/bin/bash"  
> - "-c"  
> - |  
> /usr/share/elasticsearch/bin/elasticsearch-plugin install mapper-size  
> volumeMounts:  
> - name: storage  
> mountPath: /usr/share/elasticsearch/data  
> volumes:  
> - name: storage  
> persistentVolumeClaim:  
> claimName: task-pv-claim

---

<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:** [February 9, 2021, 8:47am UTC](https://discuss.elastic.co/t/installing-elasticsearch-plugins-when-es-is-running-as-kubernetes-pod/260799/2 "2021-02-09T08:47:34Z")

</div>

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