How to maintain helm repository in gitlab

6/28/2021

I have a helm chart and I want to add it to my gitlab repository. But when I run:

helm repo add repo_name url 

I am getting the following error:

Error: looks like "https://gitlab.<domain>.com/group/infra/repo/helm/charts/" is not a valid chart repository or cannot be reached: error converting YAML to JSON: yaml: line 3: mapping values are not allowed in this context

Linter shows it is a valid chart.

Here is index.yaml:

apiVersion: v1
entries:
  helloworld:
  - apiVersion: v2
    appVersion: 1.0.0
    created: "2021-06-28T14:05:53.974207+01:00"
    description: This Helm chart will be used to create hello world 
    digest: f290432f0280fe3f66b126c28a0bb21263d64fd8f73a16808ac2070b874619e7
    name: helloworld
    type: application
    urls:
    - https://gitlab.<domain>.com/group/infra/repo/helm/charts/helloworld-0.1.0.tgz
    version: 0.1.0
generated: "2021-06-28T14:05:53.973549+01:00"

Not sure what is missing here.

-- Ram
gitlab
kubernetes
kubernetes-helm

2 Answers

6/29/2021

You can host your own Public Helm repository on git.I have done it on Github and the process is very easy and straightforward.

You can follow this link https://medium.com/@mattiaperi/create-a-public-helm-chart-repository-with-github-pages-49b180dbb417

You will have to package the chart and create an index.yaml file.You will also have to host your repository branch as Github pages.

I am not sure if gitlab also supports this but worth a shot.

-- Avinash Jha
Source: StackOverflow

6/29/2021

It looks like you want to use the helm chart that is hosted on the gitlab. Unfortunately, it won't work as you want it to. As Lei Yang mentioned well in the comment:

helm repo and git repo are different things.

In the official documentation of Helm, you can find The Chart Repository Guide. You can find it also a guide how to create a chart repository:

A chart repository is an HTTP server that houses an index.yaml file and optionally some packaged charts. When you're ready to share your charts, the preferred way to do so is by uploading them to a chart repository.

Here you can find section, how to properly host chart repos. There are several ways to do this - for example you can use a Google Cloud Storage (GCS) bucket, Amazon S3 bucket, GitHub Pages, or even create your own web server.

You can also use the ChartMuseum server to host a chart repository from a local file system.

ChartMuseum is an open-source Helm Chart Repository server written in Go (Golang), with support for cloud storage backends, including Google Cloud Storage, Amazon S3, Microsoft Azure Blob Storage, Alibaba Cloud OSS Storage, Openstack Object Storage, Oracle Cloud Infrastructure Object Storage, Baidu Cloud BOS Storage, Tencent Cloud Object Storage, DigitalOcean Spaces, Minio, and etcd.

Alternatively it could be also possible to host helm charts in JFrog.

-- Mikołaj Głodziak
Source: StackOverflow