There are certain fields that will be common across all component definitions. These fields are:
Field
Type
Description
name*
string
The name of the component.
cosignKeyPath
string
[Deprecated] Specify a path to a public key to validate signed online resources. This will be removed in Zarf v1.0.0.
default
boolean
Determines the default Y/N state for installing this component on package deploy.
description
string
Message to include during package deploy describing the purpose of this component.
group
string
[Deprecated] Create a user selector field based on all components in the same group. This will be removed in Zarf v1.0.0. Consider using 'only.flavor' instead.
healthChecks
array
List of resources to health check after deployment
import
object
Import a component from another Zarf package.
only
object
Filter when this component is included in package creation or deployment.
Images can either be discovered manually, or automatically by using zarf dev find-images. The image list is not limited to containers, any OCI image following the Image Manifest specification can be pulled
Tag-based git repository cloning is the recommended way of cloning a git repository for air-gapped deployments because it wraps meaning around a specific point in git history that can easily be traced back to the online world. Tag-based clones are defined using the scheme://host/repo@tag format as seen in the example of the zarf-dev/zarf repository (https://github.com/zarf-dev/zarf.git@v0.15.0).
A tag-based clone only mirrors the tag defined in the Zarf definition. The tag will be applied on the git mirror to a zarf-specific branch name based on the tag name (e.g. the tag v0.1.0 will be pushed to the zarf-ref-v0.1.0 branch). This ensures that this tag will be pushed and received properly by the airgap git server.
In addition to tags, Zarf also supports cloning and pushing a specific SHA hash from a git repository, but this is not recommended as it is less readable/understandable than tag cloning. Commit SHAs are defined using the same scheme://host/repo@shasum format as seen in the example of the zarf-dev/zarf repository (https://github.com/zarf-dev/zarf.git@c74e2e9626da0400e0a41e78319b3054c53a5d4e).
A SHA-based clone only mirrors the SHA hash defined in the Zarf definition. The SHA will be applied on the git mirror to a zarf-specific branch name based on the SHA hash (e.g. the SHA c74e2e9626da0400e0a41e78319b3054c53a5d4e will be pushed to the zarf-ref-c74e2e9626da0400e0a41e78319b3054c53a5d4e branch). This ensures that this tag will be pushed and received properly by the airgap git server.
If you need even more control, Zarf also supports providing full gitrefspecs, as seen in https://repo1.dso.mil/big-bang/bigbang.git@refs/heads/release-1.54.x. This allows you to pull specific tags or branches by using this standard. The branch name used by zarf on deploy will depend on the kind of ref specified, branches will use the upstream branch name, whereas other refs (namely tags) will use the zarf-ref-* branch name.
Full clones are used in this example with the stefanprodan/podinfo repository and follow the scheme://host/repo format (https://github.com/stefanprodan/podinfo.git). Full clones will contain all branches and tags in the mirrored repository rather than any one specific tag.
Datasets to inject into a container in the target cluster.
During zarf package create, data injections pull files from the host at the path specified by the source key. During zarf package deploy, these files are injected into the container specified by the target key. The pod holding the targeted container must have the variable ###ZARF_DATA_INJECTION_MARKER### within the pod spec otherwise the data injection will not occur. This variable gets templated at deploy time to become the name of the extra file Zarf injects into the pod to signify that the data injection is complete.
The kiwix example showcases a simple data injection use case.
The import key in Zarf supports two modes to pull in a component:
The path key allows you to specify a path to a directory that contains the zarf.yaml that you wish to import on your local filesystem. This allows you to have a common component that you can reuse across multiple packages within a project (i.e. within one team/codebase).
The url key allows you to specify an oci:// URL to a skeleton package that was published to an OCI registry. Skeleton packages are special package bundles that contain the zarf.yaml package definition and any local files referenced by that definition at publish time. This allows you to version a set of reusable components and import them into multiple packages across projects (i.e. across teams/codebases).
When merging components together Zarf will adopt the following strategies depending on the kind of primitive (files, required, manifests) that it is merging:
Kind
Key(s)
Description
Component Behavior
name, group, default, required
These keys control how Zarf interacts with a given component and will always take the value of the overriding component
Component Description
description
This key will only take the value of the overriding component if it is not empty
Cosign Key Path
cosignKeyPath
[Deprecated] This key will only take the value of the overriding component if it is not empty
Un’name’d Primitive Arrays
actions, dataInjections, files, images, repos
These keys will append the overriding component’s version of the array to the end of the base component’s array
’name’d Primitive Arrays
charts, manifests
For any given element in the overriding component, if the element matches based on name then its values will be merged with the base element of the same name. If not then the element will be appended to the end of the array
List of resources to health check after deployment
Health checks wait until the specified resources are fully reconciled, meaning that their desired and current states match. Internally, kstatus is used to assess when reconciliation is complete. Health checks supports all Kubernetes resources that implement the status field, including custom resource definitions. If the status field is not implemented on a resource, it will automatically pass the health check.
When deploying a Zarf package, components are deployed in the order they are defined in the zarf.yaml.
The zarf.yaml configuration for each component also defines whether the component is ‘required’ or not. ‘Required’ components are always deployed without any additional user interaction while optional components are printed out in an interactive prompt asking the user if they wish to the deploy the component.
If you already know which components you want to deploy, you can do so without getting prompted by passing the components as a comma-separated list to the --components flag during the deploy command.