# Adding elasticsearch-keystore with docker/kubernetes

**URL:** <https://discuss.elastic.co/t/adding-elasticsearch-keystore-with-docker-kubernetes/237884>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [June 19, 2020, 10:37pm UTC](https://discuss.elastic.co/t/adding-elasticsearch-keystore-with-docker-kubernetes/237884 "2020-06-19T22:37:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elk\_follower](https://avatars.discourse-cdn.com/v4/letter/e/b4bc9f/32.png) [@elk\_follower](https://discuss.elastic.co/u/elk_follower)\
**Post date:** [June 19, 2020, 10:37pm UTC](https://discuss.elastic.co/t/adding-elasticsearch-keystore-with-docker-kubernetes/237884/1 "2020-06-19T22:37:53Z")

</div>

Hi,

I'm following below documents to make a test ELK cluster integrate with key cloak and I'm at the step to add client secret in the [elasticsearch keystore](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/secure-settings.html).

[https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-docker.html](https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-docker.html)  
[https://www.elastic.co/guide/en/elasticsearch/reference/7.x/oidc-guide-authentication.html#oidc-enable-token](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/oidc-guide-authentication.html#oidc-enable-token)

But to add this secret i need to have my cluster up and running which is failing due to below exception

```auto
"Caused by: org.elasticsearch.common.settings.SettingsException: The configuration setting [xpack.security.authc.realms.oidc.oidc1.rp.client_secret] is required",
"at org.elasticsearch.xpack.security.authc.oidc.OpenIdConnectRealm.buildRelyingPartyConfiguration(OpenIdConnectRealm.java:251) ~[?:?]",
"at org.elasticsearch.xpack.security.authc.oidc.OpenIdConnectRealm.<init>(OpenIdConnectRealm.java:104) ~[?:?]",
"at org.elasticsearch.xpack.security.authc.InternalRealms.lambda$getFactories$7(InternalRealms.java:119) ~[?:?]",
"at org.elasticsearch.xpack.security.authc.Realms.initRealms(Realms.java:216) ~[?:?]",
"at org.elasticsearch.xpack.security.authc.Realms.<init>(Realms.java:71) ~[?:?]",
"at org.elasticsearch.xpack.security.Security.createComponents(Security.java:442) ~[?:?]",
"at org.elasticsearch.xpack.security.Security.createComponents(Security.java:388) ~[?:?]",
"at org.elasticsearch.node.Node.lambda$new$9(Node.java:457) ~[elasticsearch-7.3.2.jar:7.3.2]",
"at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271) ~[?:?]",
"at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) ~[?:?]",
"at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?]",
"at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?]",
"at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[?:?]",
"at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]",
"at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[?:?]",
"at org.elasticsearch.node.Node.<init>(Node.java:460) ~[elasticsearch-7.3.2.jar:7.3.2]",
"at org.elasticsearch.node.Node.<init>(Node.java:258) ~[elasticsearch-7.3.2.jar:7.3.2]",
"at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:221) ~[elasticsearch-7.3.2.jar:7.3.2]",
"at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:221) ~[elasticsearch-7.3.2.jar:7.3.2]",
"at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) ~[elasticsearch-7.3.2.jar:7.3.2]",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.3.2.jar:7.3.2]",
"... 6 more"] }

```

I tried following to set the keystore:

1. Adding command in the docker compose file  
command: \>  
bash -c '  
echo "client secret" | elasticsearch-keystore add xpack.security.authc.realms.oidc.keycloak.rp.client\_secret -xsf  
'  
Container is not coming up and no logs as well.

2. Setting the ketstore using Dockerfile to create my own image but even that is not working.

Would really appreciate if you can provide the recommended approach to set keystore in docker/kuberntes env.

---

<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:** [July 17, 2020, 10:37pm UTC](https://discuss.elastic.co/t/adding-elasticsearch-keystore-with-docker-kubernetes/237884/2 "2020-07-17T22:37:54Z")

</div>

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