Curator - want to set http_auth password and username through env from kubernetes secret

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, in the section entitled 'unsupported use cases', extra text is not permitted. Any idea how I can pass the http_auth field two envs ?

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

1 Like

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