feat(service): secret/configmap env, envFrom, and External Secrets#39
Merged
Conversation
ElpioService can now source env from Secrets/ConfigMaps (env[].valueFrom), bulk-inject them (envFrom), and sync a Secret from an external store via the External Secrets Operator (externalSecrets -> ExternalSecret CR). The env rendering helpers are shared in engines/base.py so both the Knative and KEDA engines behave identically; render() stays pure. Updates both CRD copies, adds operator RBAC for external-secrets.io/externalsecrets, an example manifest, and unit tests for value/valueFrom/envFrom validation and the rendered objects.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the last audit-backlog item (#42).
What
ElpioService env can now come from secrets, not just literals:
env[].valueFrom—secretKeyRef/configMapKeyRef(exactly one), withoptional.envFrom— bulk-inject a Secret or ConfigMap, with optionalprefix.externalSecrets— render anexternal-secrets.io/v1beta1ExternalSecret that syncs an external store into a k8s Secret the env entries then consume.Where
models/service.py: newEnvVarSource/KeySelector/EnvFromSource/ExternalSecretmodels;EnvVar.valuenow optional with a value-xor-valueFrom validator.engines/base.py: shared pure helperscontainer_env/container_env_from/external_secret; both Knative and KEDA engines use them (identical behavior,render()stays pure).external-secrets.io/externalsecrets.examples/service-secret-env.yaml; unit tests for validation + rendered objects.191 unit tests pass, ruff clean, helm lint clean.