apply
Apply rendered manifests to the Kubernetes cluster with release tracking.
Synopsis
Section titled “Synopsis”nyl apply [OPTIONS] <FILE>Description
Section titled “Description”The apply command renders manifests, applies them with server-side apply, and tracks release state.
For shared rendering behavior and namespace resolution details, see
Rendering Pipeline.
Arguments
Section titled “Arguments”<FILE>- Path to the manifest file to apply (required)
Options
Section titled “Options”Common Options
Section titled “Common Options”--only-source-kind <KIND>- Filter top-level resources by kind (e.g.,ConfigMap,Deployment) or by apiVersion/kind (e.g.,apps/v1/Deployment) before expansion.--only-kind <KIND,...>- Filter final rendered manifests to only include specific kinds (post-render).--exclude-kind <KIND,...>- Filter final rendered manifests to exclude specific kinds (post-render, mutually exclusive with--only-kind).-p, --profile <PROFILE>- Profile to use for rendering. If omitted, Nyl triesdefault; if profiles exist butdefaultis missing, apply fails with an error.--max-depth <MAX_DEPTH>- Maximum evaluation depth for recursive resource expansion (default: 10)--track-parent- Track parent resource information in annotations
Release Options
Section titled “Release Options”--name <NAME>- Release name (required if no NylRelease in file)--namespace <NAMESPACE>- Release namespace (required if no NylRelease in file)--append-release- Merge current resources with the previous deployed revision and skip pruning removed resources--no-release- Apply resources without creating release revisions, without release metadata, and without pruning
Cluster Options
Section titled “Cluster Options”--context <CONTEXT>- Kubernetes context to use
Examples
Section titled “Examples”Basic Apply
Section titled “Basic Apply”# Apply a manifest filenyl apply manifest.yaml
# Apply with specific profilenyl apply -p production manifest.yaml
# Apply only top-level ConfigMap resourcesnyl apply --only-source-kind ConfigMap manifest.yaml
# Apply only final rendered Deploymentsnyl apply --only-kind Deployment manifest.yamlRelease Management
Section titled “Release Management”# Apply with explicit release name (overrides NylRelease if present)nyl apply --name my-release --namespace default manifest.yaml
# Use different Kubernetes contextnyl apply --context production manifest.yamlDry Run
Section titled “Dry Run”Use nyl diff to preview changes before running nyl apply.
No Release Mode
Section titled “No Release Mode”# Apply resources without release tracking or pruningnyl apply --no-release manifest.yaml- Nyl processes single files only. Directory paths are not supported.
- A
NylReleaseresource in the manifest provides release metadata automatically. - Release state is tracked in Kubernetes Secrets in the release namespace.
--no-releasedisables release tracking entirely. In this mode,nylcannot compute or prune resources removed from subsequent applies.- See Rendering Pipeline for namespace resolution and filter semantics.