Convert Helm charts to OCI
Overview
When an application's Helm chart is hosted in a traditional Helm repository (not OCI-native), you need to pull it locally and push it to an OCI registry so NKP and Flux can consume it.
Steps
-
Add the Helm repository:
helm repo add <repo-name> <repo-url>
helm repo update -
Search for available versions:
helm search repo <repo-name>/<chart> --versions -
Pull the chart locally:
helm pull <repo-name>/<chart> --version <version>This downloads a
.tgzfile to the current directory. -
Push to your OCI registry:
helm push <chart>-<version>.tgz oci://<your-oci-registry>/<chart> -
Reference the OCI URL in your application's
helmrelease/helmrelease.yaml:apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
name: ${releaseName}-source
namespace: ${releaseNamespace}
spec:
interval: 6h0m0s
url: oci://<your-oci-registry>/<chart>
ref:
tag: <version>
Authentication
If your OCI registry requires authentication, configure credentials before pushing:
helm registry login <registry> --username <user> --password <token>
For GHCR (GitHub Container Registry):
echo $GITHUB_TOKEN | helm registry login ghcr.io --username <github-user> --password-stdin