Introduction
Helm, the popular package manager for Kubernetes, simplifies the deployment and management of applications by utilizing charts. Helm charts encapsulate all the necessary resources and configurations required to run an application on Kubernetes. When it comes to securely storing and distributing Helm charts, Harbor Registry provides a reliable solution. In this blog post, we will walk you through the process of pushing a Helm chart to Harbor Registry.
Step 1: Package your Helm Chart
Before pushing the Helm chart to Harbor, you need to package it into a compressed file format known as a tarball (.tgz). Ensure you have the Helm command-line tool installed on your system. In the directory containing your Helm chart, run the following command to package it:
helm package <chart_directory>
Replace <chart_directory>
with the path to your Helm chart directory. This command creates a tarball file with the chart’s name and version.
Step 2: Authenticating with Harbor
To push the Helm chart to Harbor, you need to authenticate yourself. Obtain the Harbor credentials (username and password) from your system administrator or Harbor administrator. Use the following command to log in to Harbor:
helm registry login <harbor_registry_url> --username <username> --password <password>
Replace <harbor_registry_url>
with the URL of your Harbor Registry instance, <username>
with your Harbor username, and <password>
with your Harbor password.
Incase if you get a TLS Error during login you can use the below command:
helm registry login -u username <harbor_registry_url>
--insecure
Step 3: Pushing the Helm Chart
With the Helm chart packaged and authenticated, you can now push it to Harbor. Use the following command:
helm registry push <tarball_path> <harbor_registry_url>/<project>/<repository>:<tag>
Replace <tarball_path>
with the path to the Helm chart tarball file, <harbor_registry_url>
with the URL of your Harbor Registry instance, <project>
with the name of the project or repository in Harbor, <repository>
with the name of the Helm chart repository within the project, and <tag>
with the desired version or tag for the chart.
This command uploads the Helm chart tarball to the specified project and repository in Harbor.
You can also use the OCI Command to push the Chart
helm push <tarball_path> oci://<harbor_registry_url>/<project>/<repository>:<tag>
in case if you get a TLS error use the tag: –insecure-skip-tls-verify
Step 4: Verifying the Helm Chart in Harbor
To ensure the Helm chart has been successfully pushed to Harbor, you can verify its presence through the Harbor web interface or by using the Harbor API. Log in to your Harbor instance via the web interface and navigate to the appropriate project/repository. You should see the pushed Helm chart listed there.
Conclusion
Pushing a Helm chart to Harbor Registry streamlines the storage and distribution of Kubernetes application packages. By following the steps outlined in this guide, you can securely upload your Helm chart to Harbor and leverage its robust features for Helm chart management. Harbor ensures the integrity and availability of your Helm charts, simplifying the deployment process and promoting collaboration within your Kubernetes environment.