Publish & Deploy Packages w/OCI
In this tutorial, we are going to run through how to publish a Zarf package to an OCI compliant registry, allowing end users to pull and deploy packages without needing to build locally, or transfer the package to their environment.
- Internet access to download resources or upload packages
- Access to a registry (this tutorial uses Docker Hub)
For following along locally, please ensure the following prerequisites are met:
- Zarf binary installed on your
$PATH
: (Installing Zarf) - Access to a Registry supporting the OCI Distribution Spec, this tutorial will be using Docker Hub
- Access to a cluster that has been initialized with zarf.
This tutorial will require a registry to be configured (see prerequisites for more information). The below sets up some variables for us to use when logging into the registry:
With those set, you can tell Zarf to login to your registry with the following:
First, create a valid Zarf package definition (zarf.yaml
), with the metadata.version
key set.
Create the package locally:
Then publish the package to the registry:
Inspecting a Zarf package stored in an OCI registry is the same as inspecting a local package and has the same flags:
Deploying a package stored in an OCI registry is nearly the same experience as deploying a local package:
Packages can be saved to the local disk in order to deploy a package multiple times without needing to fetch it every time.
- Use the
zarf package list
command to get a list of the installed packages. This will give you the name of the games package to remove it.
- Use the
zarf package remove
command to remove thehelm-oci-chart
package. Don’t forget the--confirm
flag. Otherwise you’ll receive an error.