Add a Pack to a Basic OCI Registry
This guide explains how to upload packs to an OCI registry that supports basic authentication. You will learn how to authenticate to your Basic OCI registry, push a custom pack, and configure the registry in Palette.
Prerequisites
-
Tenant administrator access.
-
Custom pack files available on your computer. Refer to the Add an Add-on Pack guide to learn how to create a custom pack.
-
A private OCI registry that supports basic authentication. This guide uses Harbor as an example. Learn how to set up a Harbor registry server using the Harbor Installation and Configuration guide.
-
ORAS v1.0.0 installed and available.
warningThis specific version of ORAS is explicitly required for pushing packs to OCI registries.
-
Tar installed and available.
-
If your OCI registry is using a self-signed certificate or a certificate that is not signed by a trusted Certificate Authority (CA), you will need the certificate to add the registry to Palette.
Upload Pack to a Basic OCI Registry
Palette supports all OCI-compliant registries that use basic authentication. This guide uses a Harbor registry as an example. Follow the steps described below to set up your Harbor registry, push the pack, and configure the registry in Palette.
-
Access the Harbor registry server domain on your web browser and log in using your credentials.
tipIf you have kept the default credentials, the username and password are admin and Harbor12345, respectively.
-
In the Projects section, click New Project. A project in Harbor contains all repositories of an application.
-
Give your project a name and keep the default settings for the remaining configuration. Click OK to proceed.
-
In your terminal, export the
HARBOR_ADDRESS
variable, which will store your Harbor server hostname. Do not include the "https://" prefix. For example,harbor.yourdomain.com
.export HARBOR_ADDRESS=<your-harbor-address>
-
Issue the command
oras login
to log in to your Harbor registry. When prompted, enter your username and password.oras login $HARBOR_ADDRESS
If the login is successful, you will receive a confirmation message.
Login Succeeded
-
Next, export the variables required for creating the Harbor repository and pushing the pack.
HARBOR_PROJECT
- Specify a name for the Harbor project that will store the repositories and the pack files. For example,spectro-oci-registry
.NAME
- The pack's name, which must match thename
parameter in the pack.json file.VERSION
- The pack's version, which must match theversion
parameter in the pack.json file.
export HARBOR_PROJECT=<your-harbor-project-name>
export NAME=<your-pack-name>
export VERSION=<your-pack-version> -
Navigate to the directory containing the folder with the pack files.
-
Before pushing the pack to the registry, compress the contents of the pack folder into an archive file. Issue the command below to create the archive file. Replace
<your_pack_folder_name>
with the name of the folder containing the pack files.tar -czvf $NAME-$VERSION.tar.gz <your-pack-folder-name>
-
Create a base path repository to store your pack repositories. Note that Harbor creates a repository when the user pushes an artifact to a project.
oras push $HARBOR_ADDRESS/$HARBOR_PROJECT/spectro-packs/archive
The command output is similar to the following.
Uploading empty artifact
Pushed [registry] harbor.yourdomain.com/spectro-oci-registry/spectro-packs/archive
Digest: sha256:93239180c18b0b6fa99b1f0463853165bdf9fc9c6a69eff3d7545f9852b6c86e -
Now, proceed to create the pack repository and push your pack to the Harbor registry.
oras push $HARBOR_ADDRESS/$HARBOR_PROJECT/spectro-packs/archive/$NAME:$VERSION $NAME-$VERSION.tar.gz
The command output is similar to the following.
Uploading ba65d21e72f1 your-pack-name-1.0.0.tar.gz
Uploaded ba65d21e72f1 your-pack-name-1.0.0.tar.gz
Pushed [registry] harbor.yourdomain.com/spectro-oci-registry/spectro-packs/archive/your-pack-name:1.0.0
Digest: sha256:448bc5d5ba0675dfc1906f442c5f0f294e21b85b62cea1ede789ba039c7b3f80
Make sure to include the spectro-packs/archive path in all your repositories. Palette expects this namespace in custom OCI registries.
-
After pushing the pack to the Harbor registry, follow the steps in Add OCI Packs Registry to add your Harbor registry to Palette.
infoPalette automatically synchronizes the registries. However, you can manually trigger the synchronization if needed. From the OCI Registries page, click the three-dot Menu next to the registry name you added and select Sync.
Validate
Follow the steps below to validate that your pack has been successfully pushed to your OCI registry.
-
Log in to Palette.
-
From the left Main Menu, click on Profiles.
-
Click Add Cluster Profile.
-
Provide a name and select the type Add-on.
-
In the following screen, click Add Pack.
-
Select the Basic OCI registry you added in the Registry drop-down Menu.
-
Verify the pack you uploaded to the Harbor registry is displayed.