-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inject env vars for secret at the beginning of the existing env vars …
…for the containers (#333) ## Overview Union secrets injected env vars should appear at the beggining of the env list. This requirement came from the issue faced during NIMs poc where the sidecar container which required secret to be passed in with specific env var name The NGC sidecar container requires a secret to passed in ENV var `NGC_API_KEY` Since union injected secrets use _UNION_ prefix, we couldn't define the secret to be NGC_API_KEY directly as it would be injected as _UNION_NGC_API_KEY Adding of _UNION_ prefix is to be able to distinguish the secret env vars injected by the webhook, Unchanging that functionality , the proposal is to use https://kubernetes.io/docs/tasks/inject-data-application/define-interdependent-environment-variables/ which allow you to define NGC_API_KEY as following `NGC_API_KEY= $(_UNION_NGC_API_KEY)` Also the change removes duplicates if the user is trying to define the same Env var which union is injecting ## Test Plan Before the change ``` k describe pods -n development agd92xq6rbhsvn25g7qb Environment: FLYTE_INTERNAL_EXECUTION_WORKFLOW: flytesnacks:development:using_secrets.main FLYTE_INTERNAL_EXECUTION_ID: agd92xq6rbhsvn25g7qb FLYTE_INTERNAL_EXECUTION_PROJECT: flytesnacks FLYTE_INTERNAL_EXECUTION_DOMAIN: development FLYTE_ATTEMPT_NUMBER: 0 FLYTE_INTERNAL_TASK_PROJECT: flytesnacks FLYTE_INTERNAL_TASK_DOMAIN: development FLYTE_INTERNAL_TASK_NAME: using_secrets.fn FLYTE_INTERNAL_TASK_VERSION: zEKw37ArzIKUrfgKOlUHUg FLYTE_INTERNAL_PROJECT: flytesnacks FLYTE_INTERNAL_DOMAIN: development FLYTE_INTERNAL_NAME: using_secrets.fn FLYTE_INTERNAL_VERSION: zEKw37ArzIKUrfgKOlUHUg FLYTE_SECRETS_ENV_PREFIX: _UNION_ _UNION_MY-CUSTOM-SECRET: Thisisasecret\r ``` After the change on dogfood-gcp ``` k describe pods -n development av8hbdjlmf5lzc8gbp5k Environment: _UNION_MY-CUSTOM-SECRET: Thisisasecret\r FLYTE_SECRETS_ENV_PREFIX: _UNION_ FLYTE_INTERNAL_EXECUTION_WORKFLOW: flytesnacks:development:using_secrets.main FLYTE_INTERNAL_EXECUTION_ID: av8hbdjlmf5lzc8gbp5k FLYTE_INTERNAL_EXECUTION_PROJECT: flytesnacks FLYTE_INTERNAL_EXECUTION_DOMAIN: development FLYTE_ATTEMPT_NUMBER: 0 FLYTE_INTERNAL_TASK_PROJECT: flytesnacks FLYTE_INTERNAL_TASK_DOMAIN: development FLYTE_INTERNAL_TASK_NAME: using_secrets.fn FLYTE_INTERNAL_TASK_VERSION: zEKw37ArzIKUrfgKOlUHUg FLYTE_INTERNAL_PROJECT: flytesnacks FLYTE_INTERNAL_DOMAIN: development FLYTE_INTERNAL_NAME: using_secrets.fn FLYTE_INTERNAL_VERSION: zEKw37ArzIKUrfgKOlUHUg ``` Notice the position of _UNION_MY-CUSTOM-SECRET. Any union secrets would show up at the beginning of the list of ENV vars ## Rollout Plan (if applicable) Rollout to staging and then demo tenant for NIMS feature ## Upstream Changes Should this change be upstreamed to OSS (flyteorg/flyte)? If not, please uncheck this box, which is used for auditing. Note, it is the responsibility of each developer to actually upstream their changes. See [this guide](https://unionai.atlassian.net/wiki/spaces/ENG/pages/447610883/Flyte+-+Union+Cloud+Development+Runbook/#When-are-versions-updated%3F). - [] To be upstreamed to OSS ## Issue *TODO: Link Linear issue(s) using [magic words](https://linear.app/docs/github#magic-words). `fixes` will move to merged status, while `ref` will only link the PR.* ## Checklist * [ ] Added tests * [ ] Ran a deploy dry run and shared the terraform plan * [ ] Added logging and metrics * [ ] Updated [dashboards](https://unionai.grafana.net/dashboards) and [alerts](https://unionai.grafana.net/alerting/list) * [ ] Updated documentation
- Loading branch information
1 parent
bbc37c7
commit 76e5a02
Showing
8 changed files
with
51 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters