feat(langsmith): add extraManifests values key#714
Conversation
Add a top-level `extraManifests` list that lets users ship arbitrary
Kubernetes resources alongside the chart without forking. Each entry
may be a YAML object or a multi-line string; both are passed through
`tpl` so template expressions like `{{ .Release.Name }}` work in
either form.
Useful for ConfigMaps, Secrets, NetworkPolicies, ServiceMonitors, or
anything else the chart doesn't natively support.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a second top-level list, preInstallManifests, that renders each entry as a Helm pre-install / pre-upgrade hook (weight -5, delete-policy before-hook-creation) so the resources are applied before the rest of the chart. Intended for prerequisites the chart consumes during install/upgrade -- e.g. an ExternalSecret whose materialized Kubernetes Secret is referenced via config.existingSecretName or the per-datastore *.external.existingSecretName values. Hook annotations are injected automatically; user-supplied annotations on the same keys take precedence so behavior can be overridden per entry. Entries support both YAML-object and YAML-string forms, both rendered through tpl. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
For adding arbitrary manifests, I would recommend using helm composition. something where you have this kind of structure: this is your chart.yaml: this anything you want in the templates folder. example: and your values file would look like this: That's the general idea with the helm composition that allows you to combine different manifests or helm charts. |
|
Thanks joaquin-borggio-lc — composition is the right tool for arbitrary side-car manifests, and I'm convinced it covers the The reason I'd still like to land the In a parent/child chart setup, both layers render into a single release manifest list, and Helm sorts by The standard fix is
|
|
joaquin-borggio-lc Any update here ? |
Summary
Adds two top-level lists to the
langsmithchart so users can ship arbitrary Kubernetes resources alongside the chart without forking it:extraManifests— plain resources, normal lifecycle.preInstallManifests— prerequisite resources rendered aspre-install/pre-upgradeHelm hooks, applied before the rest of the chart. Useful for resources the chart consumes during install/upgrade, such as an ExternalSecret (External Secrets Operator) whose materialized Kubernetes Secret is referenced byconfig.existingSecretNameor the per-datastore*.external.existingSecretNamevalues.Each entry in either list may be a YAML object or a multi-line YAML string; both are rendered through
tplso template expressions like{{ .Release.Name }}work.Useful for ConfigMaps, Secrets, NetworkPolicies, ServiceMonitors, ExternalSecrets, or anything else the chart doesn't natively support.
Usage
extraManifests(plain resources)preInstallManifests(pre-requisite hooks)The chart then consumes the materialized Secret via the existing knobs:
Implementation
templates/extra-manifests.yaml— iterates.Values.extraManifests, runs each entry throughtpl(object entries viatoYamlfirst).templates/pre-install-manifests.yaml— iterates.Values.preInstallManifests, runs each entry throughtpl, then injects the following annotations (user-provided values on the same keys win):helm.sh/hook: pre-install,pre-upgradehelm.sh/hook-weight: "-5"helm.sh/hook-delete-policy: before-hook-creationvalues.yaml— addsextraManifests: []andpreInstallManifests: []with doc comments and examples covering both forms.Defaults are
[]for both, so behavior is unchanged for existing users.Caveats
preInstallManifests) are not tracked as part of the Helm release and are recreated on every upgrade. For ExternalSecret entries, prefertarget.creationPolicy: Orphan(ortarget.deletionPolicy: Retainon newer ESO versions) so the materialized Secret survives upgrades and pods consuming it don't restart.preInstallManifestsentry must be a single resource (no---separators inside one string);extraManifestscontinues to pass strings through as-is and supports multi-doc strings.