Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to push a helm chart to Harbor using Helm CLI V3.7.2 and Harbor 2.4.0-d4affc2

Struggling finding documentation around this that works with specific versions of Harbor and Helm.

Ive tried adding my repo...

Helm repo add harbor https://myharbor.mydomain.com/chartrepo/myproject --username myusername --password mypassword

No issues so far

Then I try to push a chart in the local directory (.tgz file)

Helm push myhelmchart.tgz harbor 

I get an error 'Error: scheme prefix missing from remote (e.g. "oci://")'

If I try

Helm push myhelmchart.tgz oci://harbor 

I get an error 'dial tcp: lookup harbor: no such host'

I tried

helm repo add harbor oci://myharbor.mydomain.com/chartrepo/myproject --username myusername --password 

I get an error 'looks like oci://myharbor.mydomain.com/chartrepo/myproject is not a valid chart repository'

If I just try and push directly and not use a registered repo

helm push myhelmchart.tgz oci://myharbor.mydomain.com/chartrepo/myproject

I get and error 'Error: unexpected status: 401 Unauthorized'

If I login first...

helm registry login myharbor.mydomain.com/chartrepo/myproject
Username: myusername
Password: mypassword
Login Succeeded

The attempt to push again

helm push myhelmchart.tgz oci://myharbor.mydomain.com/chartrepo/myproject

Same error 'Error: unexpected status: 401 Unauthorized'

My goal is to be able to push helm charts into Harbor and have them show up in this area... enter image description here

like image 652
pforsthoff Avatar asked Feb 02 '26 08:02

pforsthoff


2 Answers

There are three options how helm charts can be pushed to Harbor

  1. As you correctly found out yourself, you can install the helm addon chartmuseum/helm-push and use that to push Helm chart to Harbor
  2. You create the Helm Chart locally with helm package and upload the tgz file via the Harbor UI
  3. Since version 3.8 Helm support pushing and pulling Charts from OCI compliant container registries such as Harbor.

To be safe for the future, I recommend you switch to option 3, as Chartmuseum is already marked as deprecated in Harbor.

Here is a quick rundown how to push/pull Helm Chart to OCI compliant Registries

Push Helm Chart to OCI registry:

helm registry login -u user container-registry.com
helm push harbor-1.7.4.tgz oci://container-registry.com/container-registry

Pull and Install Helm Chart from OCI registry:

helm pull oci://container-registry.com/container-registry/harbor --version 1.7.4

This is pulling to tgz file to your current directory. Unlike with the common approach where you would first add a repo and the pull from it in order to be able to install a Chart you can do it all in one go with an OCI registry:

helm install myrelease  oci://container-registry.com/container-registry/harbor --version 1.7.4

Same procedure for template and upgrade

The oci:// protocol is also available in various other subcommands. Here is a complete list:

helm pull
helm show
helm template
helm install
helm upgrade

The Helm documentation has a page with more OCI related examples.

like image 108
Vad1mo Avatar answered Feb 04 '26 00:02

Vad1mo


add harbor repo

helm repo add --username=username --password=xxxx myrepo https://harbor.xxxx.cn/chartrepo/xxxx

create chart

helm create  xxxxxx

lint chart in chart dir

helm lint . 

package chart in chart dir

helm package .

install push plugin

helm plugin install https://github.com/chartmuseum/helm-push

push chart to repo

helm cm-push xxxxxx-0.1.0.tgz myrepo
like image 25
bzd111 Avatar answered Feb 04 '26 00:02

bzd111



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!