Skip to main content
Argo CD supports Jsonnet for templating Kubernetes manifests. Any file matching *.jsonnet in a directory application is treated as Jsonnet and evaluated to generate manifests.

Basic Jsonnet Application

Argo CD automatically detects Jsonnet files and evaluates them:

External Variables

Pass external variables to Jsonnet templates:
array
List of external variables passed to Jsonnet. Values are treated as strings.

Top-Level Arguments (TLAs)

Provide top-level arguments to Jsonnet:
array
List of top-level arguments passed to Jsonnet functions

Shared Libraries

Add shared library paths (e.g., vendor folders) relative to the repository root:
array
List of library paths available to Jsonnet imports

Complete Example

Application with all Jsonnet features:

Build Environment

Jsonnet applications have access to standard build environment variables:
  • ARGOCD_APP_NAME - The application name
  • ARGOCD_APP_NAMESPACE - The application namespace
  • ARGOCD_APP_REVISION - The git revision being deployed
  • ARGOCD_APP_SOURCE_REPO_URL - The source repository URL
  • ARGOCD_APP_SOURCE_PATH - The path within the repository
  • ARGOCD_APP_SOURCE_TARGET_REVISION - The target revision
Use these in external variables and TLAs with the $VARIABLE_NAME syntax.

CLI Usage

Configure Jsonnet via CLI:

Jsonnet Output

Argo CD evaluates Jsonnet and expects valid Kubernetes objects or arrays:
Use Jsonnet’s powerful templating features to reduce duplication and dynamically generate manifests based on parameters.