Course contentsShow
← Docker, Kubernetes & CI/CD
Lesson 467 of 8027. Package Management and AutomationFree lesson

Packaging Charts as OCI Artifacts

Convert standard Helm charts into OCI-compliant packages to leverage existing container registry infrastructure for distribution and storage.

In this lesson, you will learn how to store and distribute Helm charts directly within your existing container registries by packaging them as OCI (Open Container Initiative) artifacts.

The Shift to OCI Registries

Traditionally, we have managed Helm charts using dedicated repositories, often hosted on web servers or cloud-native storage like ChartMuseum. However, because modern container registries (like Docker Hub, GitHub Container Registry, or AWS ECR) are already built to handle OCI artifacts, we can treat Helm charts just like Docker images. This consolidation allows you to use one infrastructure for both your application container images and the templates used to deploy them.

Packaging and Pushing

To package a chart as an OCI artifact, you use the standard helm package command. This creates a .tgz file that adheres to OCI standards. Instead of hosting a separate repository, you can push this directly to your container registry using helm push.

To begin, ensure you are logged into your registry using helm registry login. Once authenticated, you can package your chart:

# Package the chart into a .tgz file
helm package ./my-app-chart

# Push the chart to your container registry
helm push my-app-chart-0.1.0.tgz oci://registry.example.com/my-charts

Pulling and Deploying

Once the chart is in the registry, you no longer need to add a repository with helm repo add. Instead, you interact with it as a URI. You can pull the chart locally or install it directly from the registry:

# Install the chart directly from the OCI registry
helm install my-app oci://registry.example.com/my-charts/my-app-chart --version 0.1.0

By using OCI artifacts, you inherit the security, access control, and replication features of your container registry. You no longer need to manage index files or worry about the maintenance of custom web-based chart repositories. Your CI/CD pipelines benefit from a unified workflow where images and their deployment blueprints live side-by-side.

Key Takeaway: Packaging charts as OCI artifacts allows you to leverage your existing container registry infrastructure to store, version, and distribute Helm charts without the overhead of maintaining dedicated chart repositories.