Package & Push a Helm Chart to an OCI Registry
This guide walks you through a practical CI scenario: your Git repository already contains a Helm chart (Chart.yaml, templates/, values.yaml, etc.).
We'll use Pipeline to:
- Clone the repository with the
git-cloneTask - Package the chart with Helm
- Push the built chart to an OCI registry (e.g., Harbor)
You will create a Pipeline with two Tasks:
git-clone: clone your repo into a shared workspacehelm: packages the chart and pushes the.tgzto your OCI registry
TOC
PrerequisitesStep-by-Step InstructionsStep 1: Create the Registry Credential SecretStep 2: Prepare helm imageStep 3: Define the PipelineStep 4: Run It with a PipelineRunTroubleshootingNext StepsPrerequisites
- A Kubernetes cluster (you can use minikube for local testing).
- Tekton Pipelines installed on your cluster.
- A Helm 3.8+ container image (Helm v3 with OCI support).
- An OCI registry and repository path (e.g., oci://registry.example.com/charts).
- Push credentials for your OCI registry as a
Secretofkubernetes.io/dockerconfigjsontype:- Create a Kubernetes Secret of type
kubernetes.io/dockerconfigjson(example below).
- Create a Kubernetes Secret of type
- A Git repository that contains a valid Helm chart (directory with
Chart.yaml,templates/,values.yaml). - Git access to the repository:
- Public repo: nothing special.
- Private repo: create a Git credential Secret (SSH or basic-auth).
Why Secret of kubernetes.io/dockerconfigjson type? We'll point Helm to distribution registry via HELM_REGISTRY_CONFIG.
Step-by-Step Instructions
Step 1: Create the Registry Credential Secret
You need a registry credential for your OCI registry as a Secret of kubernetes.io/dockerconfigjson type.
You can refer to the Prepare Registry Credential.
Step 2: Prepare helm image
You need a Helm 3.8+ container image (Helm v3 with OCI support) to run the helm command.
You can refer to the Discover Tool Image.
When searching by label, specify the image as helm, for example: -l operator.tekton.dev/tool-image=helm.
Step 3: Define the Pipeline
This Pipeline uses git-clone to fetch your repo, then calls helm to package and push your chart.
Please replace <helm-image> with your Helm image.
Step 4: Run It with a PipelineRun
Bind workspaces and pass your parameters.
Troubleshooting
helm: command not found: Ensure yourimageactually contains the Helm binary.Error: unknown command "push": Your Helm image lacks OCI push support. Use a newer Helm (3.8+) image.unauthorized: authentication required: Ensure the Secret is correct and mounted to registry-creds. ConfirmHELM_REGISTRY_CONFIGis set to that path.