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

Add envFrom and remove lookup #260

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

willmostly
Copy link
Contributor

@willmostly willmostly commented Nov 21, 2024

Add envFrom to allow providing environment variables from Secrets, and remove usage of the Helm lookup function for merging Secrets into the configuration.

This removes the custom checksum calculation as well. The checksum had included the optional configuration secrets, causing pod restarts whether configuration was updated through the chart or through a secret. Since this required retrieving Secrets from the target cluster through the Helm lookup function, it caused the chart to be incompatible with release pipelines in which a manifest is generated in an environment that does not have access to the target cluster.

# whether the chart `config` is updated or if one of the configuration
# secrets is updated. Helm template must be run with the
# --dry-run=server option to prevent a nil pointer.
checksum/config: {{ (coalesce (lookup "v1" "Secret" .Release.Namespace "trino-gateway-configuration").metadata (dict "resourceVersion" "0")).resourceVersion | sha256sum}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither the PR description nor the commit message explain why we'd want to remove the checksum - was this wrong to do in the first place, is it not working as expected, or there are some edge cases we cannot address?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add this into the PR description.
In short, the we were taking the checksum of k8s Secrets that were created externally for passing sensitive configuration values. By including these in the checksum, running a helm update after a secret was modified would replace a pod.

This seemed like a good idea, but getting the secrets requires that Helm itself connect to a running cluster and get the secrets using the lookup function. We have received feedback that this is often not possible in release pipelines

# - secretRef:
# name: password-secret
# ```
envFrom: []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like how this simplifies things. You added a test values.yaml file in the other PR: https://github.com/trinodb/charts/pull/261/files#diff-3314f8997bf0267424c20c4ed15ab01144cba76dd4bd383d7511c4cdcd1bc60f, but the test.sh script here already runs Gateway tests. Please add a values.yaml file for it here too, can be a basic one, just to verify that the chart renders and installs correctly with these sections filled up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants