Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow token to come from Kubernetes Secret rather than plaintext in Helm values #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pwhack
Copy link

@pwhack pwhack commented Feb 8, 2025

Attempting to resolve #14.

Goals:

  • When config.token is specified, maintain existing chart behavior.
  • When config.token_secret_ref is specified, omit token from ConfigMap and modify Deployment to include an environment variable pulled from the Kubernetes Secret.
  • Attempt to modify values.schema.json to require one of config.token or config.token_secret_ref but that they are mutually exclusive.

Testing procedure:

  1. (PASSED) ConfigMap should not contain token_secret_ref but should contain token. Deployment should not contain token environment variable.

    helm template hd-agent \
      ./agent \
      --namespace datalake-fivetran \
      --set config.data_volume_pvc=fivetran-agent-pvc \
      --set config.token="token-value-here" \
    > testfile.yaml
  2. (PASSED) ConfigMap should not contain token_secret_ref and should not contain token. Deployment should contain token environment variable populated by Secret.

    helm template hd-agent \
      ./agent \
      --namespace datalake-fivetran \
      --set config.data_volume_pvc=fivetran-agent-pvc \
      --set config.token_secret_ref="secret-name-here" \
    > testfile.yaml

STILL TO DO:

  • Take a stab at updating values.schema.json. I've never used JSON Schema.

…en token_secret_ref is specified, omit token from configmap and modify deployment to include an env pulled from secret. json schema disabled for now.
@pwhack
Copy link
Author

pwhack commented Feb 11, 2025

I don't know how to modify the JSON Schema so that either config.token or config.token_secret_ref are required but mutually exclusive. Maybe someone else can resolve that.

@pwhack pwhack marked this pull request as ready for review February 11, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow token to come from Kubernetes Secret rather than plaintext in Helm values
2 participants