# How to create users for file based auth and deploy using Helm Chart

**URL:** <https://discuss.elastic.co/t/how-to-create-users-for-file-based-auth-and-deploy-using-helm-chart/313374>\
**Category:** Elasticsearch\
**Created:** [August 31, 2022, 3:38pm UTC](https://discuss.elastic.co/t/how-to-create-users-for-file-based-auth-and-deploy-using-helm-chart/313374 "2022-08-31T15:38:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rohit\_Shrivastava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rohit_shrivastava/32/9850_2.png) [@Rohit\_Shrivastava](https://discuss.elastic.co/u/Rohit_Shrivastava)\
**Post date:** [August 31, 2022, 3:38pm UTC](https://discuss.elastic.co/t/how-to-create-users-for-file-based-auth-and-deploy-using-helm-chart/313374/1 "2022-08-31T15:38:24Z")

</div>

Hi I wanted to know how should I automate the users file creation (file based authentication) with helm chart.

- Docs suggests to use elasticsearch-users cli, should I run an init container and run the script?
- Should I generate a users file locally then create a k8s secret and then mount it using secretMounts?
- Can I use esConfig: to add users?
- any better way which is more manageable?

Thanks  
Rohit

---

<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:** [September 28, 2022, 3:38pm UTC](https://discuss.elastic.co/t/how-to-create-users-for-file-based-auth-and-deploy-using-helm-chart/313374/2 "2022-09-28T15:38:35Z")

</div>

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