# Curator - cron-job.yaml, unable to give dynamic password in the config

**URL:** <https://discuss.elastic.co/t/curator-cron-job-yaml-unable-to-give-dynamic-password-in-the-config/238246>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Tags:** curator\
**Created:** [June 23, 2020, 11:30am UTC](https://discuss.elastic.co/t/curator-cron-job-yaml-unable-to-give-dynamic-password-in-the-config/238246 "2020-06-23T11:30:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aman26ps](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aman26ps/32/82604_2.png) [@aman26ps](https://discuss.elastic.co/u/aman26ps)\
**Post date:** [June 23, 2020, 11:30am UTC](https://discuss.elastic.co/t/curator-cron-job-yaml-unable-to-give-dynamic-password-in-the-config/238246/1 "2020-06-23T11:30:07Z")

</div>

Hi Team,

I am trying to run a cron job with my ES operator/Application deployment, I am able to configure curator with the ES cluster and checked the connectivity everything is working fine, now as the elastic password is dynamic and changes everytime we deploy the cluster, i want the password to be parameterized, harcoding password works!! but thats not an ideal scenario.

below is the config:

```auto
 client:
      hosts:
        - elasticsearch-config-es-http
      port: 9200
      url_prefix:
      use_ssl: True
      certificate: /etc/certificate/ca.crt
      client_cert:
      client_key:
      ssl_no_validate: False
      http_auth: "elastic:${SECRET_ES_PASSWORD}" --> Hardcoding this variable works.

```

the cron-job.yaml:

mounting secret as an env variable

```auto
 env:
            - name: SECRET_ES_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: elastic
                  name: elasticsearch-config-es-elastic-user

```

mounting the secret

```auto
volume mount:
 - mountPath: /etc/certificate/secret
              name: login
volume:
 - name: login
            secret:
              secretName: elasticsearch-config-es-elastic-user

```

Thanks in advance

---

<div class="post-metadata">

**Author:** ![aman26ps](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aman26ps/32/82604_2.png) [@aman26ps](https://discuss.elastic.co/u/aman26ps)\
**Post date:** [June 23, 2020, 11:51am UTC](https://discuss.elastic.co/t/curator-cron-job-yaml-unable-to-give-dynamic-password-in-the-config/238246/2 "2020-06-23T11:51:28Z")

</div>

Nevermind got help from the comment by Karl closing this issue, basically have to store the creds as env variable, both username and password, please see the following issue

> <https://github.com/elastic/curator/issues/1440>
>
> A config:
> client:
> # ...
> http\_auth: ${CURATOR}
> Expected Behavior
> I believe ${CURATOR} should be evaluated from the env var in the config.
> Actual Behavior
> 2019-08-01 20:08:27,485...

---

<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 4, 2022, 8:03am UTC](https://discuss.elastic.co/t/curator-cron-job-yaml-unable-to-give-dynamic-password-in-the-config/238246/3 "2022-11-04T08:03:33Z")

</div>


