# How to work with es enrollment token and kibana verification code when working in kubernetes

**URL:** <https://discuss.elastic.co/t/how-to-work-with-es-enrollment-token-and-kibana-verification-code-when-working-in-kubernetes/316394>\
**Category:** Kibana\
**Created:** [October 12, 2022, 3:24am UTC](https://discuss.elastic.co/t/how-to-work-with-es-enrollment-token-and-kibana-verification-code-when-working-in-kubernetes/316394 "2022-10-12T03:24:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kracozebr](https://avatars.discourse-cdn.com/v4/letter/k/da6949/32.png) [@Kracozebr](https://discuss.elastic.co/u/Kracozebr)\
**Post date:** [October 12, 2022, 3:24am UTC](https://discuss.elastic.co/t/how-to-work-with-es-enrollment-token-and-kibana-verification-code-when-working-in-kubernetes/316394/1 "2022-10-12T03:24:29Z")

</div>

I need to have opportunity to collect logs from my embedded device and has chosen elasticsearch and kibana for that. I can connect to my embedded device through Ethernet from my PC. I installed elasticsearch and kibana in kubernetes.  
The thing is that every time I restart kubernetes (I have minkube) I need to get into my pod and recreate the elasticsearch enrollment token like that:

```auto
bin/elasticsearch-create-enrollment-token --scope kibana

```

Recreate the user and password:

```auto
bin/elasticsearch-users useradd user -p passward -r superuser

```

And get into kibana pod and create the verification code:

```auto
bin/kibana-verification-code

```

It should be the smart way to start elasticsearch and kibana... How to manage in write way?

---

<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 8, 2022, 7:46pm UTC](https://discuss.elastic.co/t/how-to-work-with-es-enrollment-token-and-kibana-verification-code-when-working-in-kubernetes/316394/2 "2022-11-08T19:46:21Z")

</div>



---

<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:** [December 6, 2022, 7:46pm UTC](https://discuss.elastic.co/t/how-to-work-with-es-enrollment-token-and-kibana-verification-code-when-working-in-kubernetes/316394/3 "2022-12-06T19:46:49Z")

</div>

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