Deploy elasticsearch role based security using helm charts

I can see you have opened this topic in wrong section , you are using elastic search official helm chart so topic should me elasticsearch not elastic cloud on kubernetes.

alternatively what you can do it is:

add xpack.security.authc.realms.file.file1.order: 0 under elasticsearch.yaml

and have a init container edit your {ES-PATH-CONF}/users_roles and {ES-PATH-CONF}/users with the required roles and username