# Curator - want to set http\_auth password and username through env from kubernetes secret

**URL:** <https://discuss.elastic.co/t/curator-want-to-set-http-auth-password-and-username-through-env-from-kubernetes-secret/149907>\
**Category:** Elasticsearch\
**Created:** [September 25, 2018, 10:28pm UTC](https://discuss.elastic.co/t/curator-want-to-set-http-auth-password-and-username-through-env-from-kubernetes-secret/149907 "2018-09-25T22:28:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DStorck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dstorck/32/33811_2.png) [@DStorck](https://discuss.elastic.co/u/DStorck)\
**Post date:** [September 25, 2018, 10:28pm UTC](https://discuss.elastic.co/t/curator-want-to-set-http-auth-password-and-username-through-env-from-kubernetes-secret/149907/1 "2018-09-25T22:28:33Z")

</div>

I am installing curator with a helm chart that has the `client` configs in a values.yaml file. I also have a value in there for `security.password` and `security.username` that I want to be able to set when I run `helm install --set security.password="foo"`. The hope is to pass these values to a kubernetes secret, then have them created as envs that the values file can reference. Trouble is, I am currently trying to set them in the values file with something like `http_auth: ${ES_USER}:${ES_PW}`, but according to [https://www.elastic.co/guide/en/elasticsearch/client/curator/current/envvars.html](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/envvars.html), in the section entitled 'unsupported use cases', extra text is not permitted. Any idea how I can pass the `http_auth` field two envs ?

---

<div class="post-metadata">

**Author:** ![DStorck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dstorck/32/33811_2.png) [@DStorck](https://discuss.elastic.co/u/DStorck)\
**Post date:** [September 25, 2018, 11:35pm UTC](https://discuss.elastic.co/t/curator-want-to-set-http-auth-password-and-username-through-env-from-kubernetes-secret/149907/2 "2018-09-25T23:35:29Z")

</div>

was able to fix by pairing username and password in one secret

```
apiVersion: v1
kind: Secret
metadata: 
  name: {{ template "fullname" . }}-auth
  labels:
    app: {{ template "name" . }}
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
stringData:
    userpass: "{{ .Values.security.username }}:{{ .Values.security.password }}"

```

and then using that secret to create an env in the cronjob

> ```
> env:
> - name: ES_USERPASS
> valueFrom:
> secretKeyRef:
> key: userpass
> name: {{ template "fullname" . }}-auth
> 
> ```

which allowed me to use the env in the values.yaml  
`http_auth: ${ES_USERPASS}`

currently working here [GitHub - samsung-cnct/chart-curator](https://github.com/samsung-cnct/chart-curator)

---

<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:** [October 23, 2018, 11:35pm UTC](https://discuss.elastic.co/t/curator-want-to-set-http-auth-password-and-username-through-env-from-kubernetes-secret/149907/3 "2018-10-23T23:35:35Z")

</div>

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