Helm chart repository on Sonatype Nexus OSS

Navratan Lal Gupta
Linux Shots
Published in
5 min readMay 28, 2022

Sonatype Nexus repository is widely used open-source artifacts and package repository tool. It is available as free OSS as well as paid professional version. Nexus repository helps manage artifacts and packages in several packaging format like NPM, Maven, Nuget, etc. Nexus also support helm repository and Container registry.

Here in this article, We will see how we can create a helm repository in Sonatype Nexus OSS.

Helm is a Kubernetes deployment tool, which helps packaging, versioning and configuration of Kubernetes manifests to enable better way of deployment and management of applications on cluster.

There are many tools available to store and manage helm chart repository like Chart Museum and Harbor. They are very well doing their job. But they need to be installed separately and only serve one purpose —Storing and managing helm chart.

If we already have Sonatype Nexus with us to store other packages, We can utilize same tool for storing helm charts rather than having a separate application for this purpose.

In Sonatype Nexus, We can create helm repository in two ways:

  1. Hosted — Helm repository is hosted in Sonatype Nexus itself.
  2. Proxy— A remote helm repository can be proxy-ied through Sonatype Nexus and charts are cached in Sonatype Nexus repository.

Contents

  1. Create hosted helm repository
  2. Create proxied helm repository

I am running a Sonatype Nexus OSS version 3.39.0 on my local machine which is accessible on http://localhost/nexus.

Sonatype Nexus version 3.39.0

Create hosted helm repository

  1. Login to Sonatype Nexus using admin user credentials.
  2. Open administration section
Sonatype Nexus administration

3. Under Repository →Repositories →Create repository, select helm (hosted) from listed recipe.

4. Add the required information and create repository.

I am creating a helm repo with name myhelmrepo.

Create helm

Name: myhelmrepo

Online: checked

Blob store: default

Strict content type Validation: checked

Deployment Policy: Disable redeploy

5. Once repository is created. It will be available under browse section.

6. Upload a helm chart in repository

To upload a helm chart to repository. Any of below two methods can be used after generating helm packaged file.

  • Upload using Nexus UI — Browse inside created helm repository and click upload to upload packaged chart file.
  • Upload using command — Follow below commands.
# Package helm chart
helm package CHARTNAME/ # This will generate TGZ packaged file
# Upload chart package
curl -u USERNAME:PASSWORD <NEXUS-URL>/repository/REPONAME/ --upload-file CHART-PACKAGE.tgz

7. Once chart is uploaded. We can see the chart inside helm repository.

Helm chart

8. Test installation of chart.

# Add helm repository
helm repo add REPONAME <NEXUS-URL>/repository/REPONAME/ --username USERNAME --password PASSWORD
# Install chart on K8s cluster
helm install RELEASENAME REPONAME/CHARTNAME

Create Proxy helm repository

We can also create a proxy helm repository on Sonatype Nexus. Sonatype Nexus, here, acts as proxy of remote helm repository and users can access chart in remote repository from Sonatype Nexus repository.

Here in example, We will create a proxy helm repository of a Kubernetes-dashboard helm repository.

Kubernetes Dashboard helm repository is available on https://kubernetes.github.io/dashboard.

Follow below steps to create proxy helm repository for above repository.

  1. Under Administration →Repository →Repositories →Create Repository
  2. Choose helm (proxy) from listed recipe.

3. Add the details in form and create repository. I will create repository with name kubernetes-dashboard.

Name: kubernetes-dashboard

Online: Checked

Remote Storage: Remote repo URL. https://kubernetes.github.io/dashboard

Maximum component Age: Time duration for which cache to be kept

Blob storage: default

Strict content validation: Checked

Authentication: Username and password of remote repository. If repository is private and required credentials.

4. Once repository is created, It will be visible in browse repository section. Charts will only be present after it is accessed for first time.

5. Test chart installation.

We should now be able to install remote chart on Kubernetes cluster by directly accessing Sonatype Nexus chart repository.

# Add the repo
helm repo add REPONAME <NEXUS-URL>/repository/REPONAME/ --username USERNAME --password PASSWORD
# Install the chart on K8s
helm install RELEASENAME REPONAME/CHARTNAME

6. Once chart is accessed for first time, Chart will be cached in Sonatype Nexus and now it can be viewed under Nexus repository.

Sonatype Nexus comes with many more features and package format. To read more about them, reach out to its official documentation.

Thanks

Navratan Lal Gupta

Linux Shots

--

--

Linux Shots
Linux Shots

Published in Linux Shots

Lets discuss about Linux, DevOps, Kubernetes, Docker and Cloud technology. Follow and subscribe for get my new article on E-mail. Medium Partner Program is not available here in India, You may consider supporting me by buying me a coffee ☕ from here → buymeacoffee.com/linuxshots

Navratan Lal Gupta
Navratan Lal Gupta

Written by Navratan Lal Gupta

I talk about Linux, DevOps, Kubernetes, Docker, opensource and Cloud technology. Don't forget to follow me and my publication linuxshots.