feat(helm): add extraObjects for arbitrary manifests#2174
Conversation
Add a top-level `extraObjects` value that renders arbitrary user-supplied Kubernetes manifests within the kagent chart. Each entry is processed through `tpl`, so values may reference the release context (e.g. release name, namespace, chart helpers). Both map and multi-line string entries are supported. This lets users manage companion resources such as ExternalSecret, HTTPRoute, or NetworkPolicy in the same chart lifecycle without maintaining a separate chart. When `extraObjects` is empty (the default), no additional documents are rendered, so existing installs are unaffected. Covered by a helm-unittest suite. Signed-off-by: younsl <cysl@kakao.com>
There was a problem hiding this comment.
Pull request overview
Adds a new Helm chart capability to render user-supplied, arbitrary Kubernetes manifests alongside the kagent chart via a top-level extraObjects value, enabling companion resources (e.g., ExternalSecret, HTTPRoute) to be managed in the same release lifecycle.
Changes:
- Introduces
extraObjects(default[]) invalues.yaml, with documentation and an example. - Adds a new Helm template to render each
extraObjectsentry viatpl(supporting both map and multi-line string entries). - Adds a helm-unittest suite covering empty/default behavior, multiple docs,
tplevaluation, and string entries.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| helm/kagent/values.yaml | Documents and introduces the extraObjects top-level value with an example manifest. |
| helm/kagent/templates/extra-objects.yaml | Implements rendering of arbitrary user manifests through tpl for both map and string entries. |
| helm/kagent/tests/extra-objects_test.yaml | Adds unit tests validating rendering behavior and templating against release context. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Younsung Lee <cysl@kakao.com>
Signed-off-by: younsl <cysl@kakao.com>
|
@EItanya PTAL |
EItanya
left a comment
There was a problem hiding this comment.
Personally this feels like a weird pattern to me. I'd be interested to hear how other projects and other systems are dealing with this problem today.
The commented example was indented under `extraObjects: []`, so uncommenting it alone produced a YAML parse error unless the empty list was also removed. Move the example above the key as a self-contained reference block; users now edit the value directly. Signed-off-by: younsl <cysl@kakao.com>
|
Fair question. This mirrors an established Helm pattern: a top level list rendered through tpl, used for companion resources like ExternalSecret, HTTPRoute, Istio DestinationRule, or NetworkPolicy that need to share the release lifecycle. Many popular community Helm charts follow this pattern through values named like extraObjects or extraManifests. A few examples with the same shape: The alternative is a second chart, which duplicates values, needs its own helm upgrade, and can drift from the app version. extraObjects keeps them atomic. Happy to rename to extraDeploy or extraManifests for familiarity if you prefer. Let me know. |
|
For context on my own use case: I needed to manage a separate HTTPRoute resource for the kagent UI as part of the same kagent chart release, rather than maintaining it in a detached manifest or a second chart. extraObjects lets that HTTPRoute live and upgrade alongside the app it fronts. |
|
Ok that all makes sense, I’ll do a little more research of my own. Since we merged that other HTTPRoute helm change do you still need this PR? |
|
Thanks for looking into this. I think it is still worth keeping. The HTTPRoute change covers UI routing, but extraObjects is the general way to add other related resources that may not each need their own value. A couple of cases I have in mind:
Adding a new value for every resource type does not scale well, while extraObjects stays generic. That said, I am happy to follow your call if you prefer a different direction. |
Summary
Adds an optional top-level
extraObjectsvalue that renders arbitrary Kubernetes manifests within the kagent chart. It is empty by default so existing installs stay unaffected. Each entry is rendered throughtplso values can reference the release context such as{{ include "kagent.fullname" . }}or{{ .Release.Namespace }}. Both map and multi-line string entries are supported.This lets users manage companion resources like
ExternalSecretorHTTPRoutein the same chart lifecycle. It follows a common pattern used by community charts such as:Changes
templates/extra-objects.yamlranging over.Values.extraObjects(default[]).extraObjectsinvalues.yamlwith anExternalSecretexample.tests/extra-objects_test.yaml.Testing
helm unittest helm/kagentpasses. The new suite covers the empty default map entries multiple documentstplevaluation against the release context and multi-line string entries.Notes
This change was originally intended for #2165 but was split into its own PR at a maintainer request so each concern can be reviewed on its own.