# How to update s3 keys in running elastic cluster in k8s

**URL:** <https://discuss.elastic.co/t/how-to-update-s3-keys-in-running-elastic-cluster-in-k8s/355843>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Tags:** docker\
**Created:** [March 20, 2024, 6:16pm UTC](https://discuss.elastic.co/t/how-to-update-s3-keys-in-running-elastic-cluster-in-k8s/355843 "2024-03-20T18:16:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![charan95](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/charan95/32/132841_2.png) [@charan95](https://discuss.elastic.co/u/charan95)\
**Post date:** [March 20, 2024, 6:16pm UTC](https://discuss.elastic.co/t/how-to-update-s3-keys-in-running-elastic-cluster-in-k8s/355843/1 "2024-03-20T18:16:57Z")

</div>

I am trying to update the aws s3 keys for running elastic cluster where i am pulling the ealstic docker image from AWS ECR and i have built the image with new aws s3 access key and secret key and done a rollout restart on stateful sets.  
but for some reason i am having the old s3 keys . I have done describe pod and found it image pulled is latest one by checkig the Image ID .

Any idea how to change the keys

```auto
FROM docker.elastic.co/elasticsearch/elasticsearch:7.17.1
USER root
ARG OSS_ACCESS_KEY_ID
ARG OSS_SECRET_ACCESS_KEY
RUN elasticsearch-plugin install --batch repository-s3
RUN elasticsearch-keystore create
RUN echo $OSS_ACCESS_KEY_ID | /usr/share/elasticsearch/bin/elasticsearch-keystore add --stdin s3.client.default.access_key
RUN echo $OSS_SECRET_ACCESS_KEY | /usr/share/elasticsearch/bin/elasticsearch-keystore add --stdin s3.client.default.secret_key
RUN elasticsearch-certutil cert -out config/elastic-certificates.p12 -pass ""
RUN chown -R elasticsearch:root config/

```

above is the docker file and i have buit the image by passing arguments

---

<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:** [April 17, 2024, 6:17pm UTC](https://discuss.elastic.co/t/how-to-update-s3-keys-in-running-elastic-cluster-in-k8s/355843/2 "2024-04-17T18:17:32Z")

</div>

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