Skip to content

feat: add envFrom support to agent deployment spec#2321

Open
uncycler wants to merge 1 commit into
kagent-dev:mainfrom
uncycler:envfrom
Open

feat: add envFrom support to agent deployment spec#2321
uncycler wants to merge 1 commit into
kagent-dev:mainfrom
uncycler:envfrom

Conversation

@uncycler

Copy link
Copy Markdown

Summary

Add an envFrom field to the agent deployment spec so users can populate
container environment variables from entire ConfigMaps/Secrets (Kubernetes'
native envFrom), instead of enumerating each key via env.

Fix

Add EnvFrom []corev1.EnvFromSource to SharedDeploymentSpec and wire it
through the translator to the pod container, exactly parallel to the existing

Testing

New unit tests assert EnvFrom propagation for both BYO and declarative specs.

Signed-off-by: Frédéric Marchand <frederic.marchand@kudelskisecurity.com>
@uncycler
uncycler requested review from a team, Charlesthebird and peterj as code owners July 23, 2026 12:59
@github-actions github-actions Bot added the enhancement New feature or request label Jul 23, 2026
Comment on lines +458 to +459
// +optional
EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this necessary? Env above already has ValueFrom support

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

These solve different problems. env + valueFrom binds a single ConfigMap/Secret key to a single env var, so every key has to be listed explicitly. envFrom imports all keys from a ConfigMap/Secret at once, using each key as the variable name.

The use case is a ConfigMap/Secret whose key set isn't fixed (populated from an external system, like external secret operator), where enumerating keys in the spec isn't practical. Same reason upstream PodSpec exposes both.

@mesutoezdil

Copy link
Copy Markdown
Contributor

looks good

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants