Helm Repositories
Introduction
Helm is the first application package manager running atop Kubernetes(k8s). It allows describing the application structure through convenient helm-charts and managing it with simple commands. More information about Helm can be found in the official documentation. Nexus Repository functions with both Helm2 and Helm3.
You can publish your charts and provenance files to a private repository in a hosted Helm repository. You can also use a proxy Helm repository reducing time and bandwidth usage for accessing Helm charts as well as more easily sharing your charts within your organization.
Note
Legacy High-Availability Clustering (HA-C) does not support the Helm format.
Proxying Helm Repositories
You can set up a Helm proxy repository to access a remote repository location.
To proxy a Helm repository, create a new helm (proxy). Minimal configuration steps for the Helm proxy are:
Define Name, e.g.
helm-proxy
Define URL for Remote storage (e.g.,
https://charts.helm.sh/stable
)Select a Blob store for Storage
Hosting Helm Repositories
Creating a Helm-hosted repository allows you to register charts in the repository manager. The hosted repository acts as an authoritative location for these components.
To add a hosted helm repository, create a new repository with the recipe helm (hosted). Minimal configuration steps for Helm hosted are:
Define Name (e.g., helm-hosted)
Select the Blobstore to use for Storage
Uploading Charts to Helm Hosted Repositories
Upload with Nexus Repository UI
Upload in the UI to upload charts to helm helm-hosted repository (e.g., for all OS, just upload the chart (extension .tgz)).
Upload by HTTP POST
The following example uses the curl command to upload mysql-1.4.0.tgz
file to a hosted Helm repository (fill in <> with your respective data):
curl -u <username>:<password> http://<host>:<port>/repository/<repository_name>/ --upload-file mysql-1.4.0.tgz -v
Upload with Helm Push Plugin
To upload a chart to a Helm-hosted repository using the Helm Push plugin, you must provide authentication credentials (e.g., --username=<username> --password=<password>
) and specify a context-path
parameter specifying the path to the hosted repository (e.g., --context-path=/repository/<repository_name>/
).
Uploading Provenance Files to Helm Hosted Repositories
Uploading provenance files with the extension .prov.tgz
to a hosted repository is the same as uploading a chart. The provenance file will be at the same tree structure level as the chart.
More information about provenance files can be seen on the Helm website.
Using Helm Client
Once you have Helm up and running you'll want to run a command similar to the following to add a Helm repo:
helm repo add <helm_repository_name> http://<host>:<port>/repository/<nexus_repository_name>/ --username <username> --password <password>
The below command will fetch the latest chart or with the version:
1. helm fetch <helm_repository_name>/<chart_name> 2. helm fetch <helm_repository_name>/<chart_name> --version <chart_version>
For example, Nexus Repository has a Helm proxy repository called helm-proxy
and your Nexus Repository is running on localhost:8081
where username is admin
and password is admin
. You would like to add this repository to the Helm client. Also, you would like to fetch the latest MySQL chart. To accomplish this, you would do the following:
1. helm repo add nexusrepo http://localhost:8081/repository/helm-proxy/ --username admin --password admin 2. helm fetch nexusrepo/mysql
If you want to fetch a chart with a specific version, just run it, like so:
helm fetch nexusrepo/mysql --version 1.4.0