Rendering Pipeline
nyl render, nyl diff, and nyl apply share the same manifest generation pipeline.
Shared Pipeline Steps
- Load project configuration and select the active profile.
- Load secrets and build the template context.
- Load the input manifest file and render Jinja templates.
- Apply
--only-source-kindfiltering on top-level input resources (before expansion). - Expand resources recursively (
HelmChart,Component,RemoteManifest, aliases) with--max-depth. - Process
ApplicationGeneratorresources into Argo CDApplicationmanifests. - Apply Kyverno policies (Global scope currently supported).
- Deduplicate final manifests (last occurrence wins).
- Apply post-render kind filtering with
--only-kind/--exclude-kind.
Namespace Resolution (Online Mode)
In online mode, Nyl connects to Kubernetes and resolves missing metadata.namespace for namespaced resources.
Fallback order:
- Existing
metadata.namespace - Release namespace hint (
NylRelease.metadata.namespaceor--namespacefor release commands) - Kube context default namespace
- Error if no namespace can be determined
When --offline is used (render only), namespace resolution is skipped.
Online vs Offline
render --offline:- does not connect to the cluster for API discovery during rendering;
- requires
--kube-versionand--kube-api-versions; - skips namespace resolution.
render(without--offline),diff, andapply:- require cluster connectivity;
- initialize Kubernetes discovery once per command run and reuse it for scope checks.
Command-Specific Behavior After Rendering
render: outputs rendered YAML to stdout.diff: compares desired state with live cluster state and prints differences.apply: applies resources and manages release tracking/pruning.
Source Filter vs Post-Render Filters
--only-source-kindfilters only top-level resources in the input file, before expansion.--only-kind/--exclude-kindfilter the final rendered manifests, after expansion.