k8s icon indicating copy to clipboard operation
k8s copied to clipboard

nats-box template - add env variables for credentials and certs

Open HenryTheMoose opened this issue 3 years ago • 1 comments

Hi, this is my very first issue, so i hope i'm doing this right. When using the nats-box, it would be great if the environment variables for credentials (NATS_CREDS) and the tls cert (NATS_CERT, NATS_KEY, and NATS_CA) would automatically be set. The template for the nats-box already sets an env variable for the credentials (USER_CREDS), but unfortunately it does not match the nats variable.

I would simply add/edit here:

env:
    - name: NATS_URL
      value: {{ template "nats.fullname" . }}
    {{- if .Values.natsbox.credentials }}
    - name: USER_CREDS
      value: /etc/nats-config/creds/{{ .Values.natsbox.credentials.secret.key }}
    - name: USER2_CREDS
      value: /etc/nats-config/creds/{{ .Values.natsbox.credentials.secret.key }}
    {{- end }}

As i think this would be an easy and quick fix i would offer to work on this.

HenryTheMoose avatar May 13 '22 11:05 HenryTheMoose

Thanks @HenryTheMoose sounds good if you want to send a PR 👍

wallyqs avatar May 13 '22 16:05 wallyqs

Supported in nats-1.0.0-beta.0 - although it does it by configuring the context instead of env vars

caleblloyd avatar May 03 '23 18:05 caleblloyd