GitLab, the popular open source Git repository management tool, has just released a new feature called Helm. Helm is a chart-based repository management system that makes it easy to manage multiple repositories and versions of code simultaneously. If you’re not familiar with GitLab, it’s a great tool for managing your code and projects. It’s free and available on both Windows and MacOS. You can create a new project or use an existing project from GitHub or Bitbucket. To get started with Helm, first install the GitLab extension for Chrome or Firefox. Once installed, open the extension and click on the “New Repository” button in the top right corner. Next, enter a name for your repository (e.g., “My First Helm Repository”), select your language (e.g., Python), and choose your branch (e.g., master). Click on the “Create” button to create your repository. Now that you have created your repository, you need to add files to it. To do this, click on the “Add Files” button in the top left corner of the window and select files from your local machine or from GitHub or Bitbucket repositories that you want to include in your project. You can also use Git commands to add files directly into your repository using the “Add File” button in the bottom right corner of the window. Once you have added files, commit them using either Git commands or by clicking on the “Commit” button in the bottom right corner of the window. You can then push these commits up to GitHub or Bitbucket using their respective buttons in the top left corner of the window. ..


GitLab 14.1 added Helm charts to the software’s growing list of supported package repository formats. You can now store and share your charts using your GitLab projects, without a separate Helm registry.

Helm charts are a collection of Kubernetes YAML manifests distributed as a single package. They make it quicker and easier to deploy complex applications into your cluster. Using GitLab as a registry lets your team store charts alongside your code in an organization-managed repository.

Using the GitLab Helm Repository

Make sure your GitLab instance has been updated to version 14.1. If you’re using the hosted GitLab.com deployment, you’ll already have everything you need.

Prepare a simple Helm chart to push to your repository. Running helm create example will produce a new boilerplate chart called example if you’ve not got one available. The generated chart will be ready to push straight up to GitLab, without any modification.

Switch over to your GitLab instance. Either create a new project or find an existing one. Using the left sidebar, navigate to Packages & Registries > Package Registry within your project. If you don’t see these menus, head to Settings > General, expand the “Visibility, project features, permissions” heading, and enable the “Packages” toggle.

Adding the Repository to Helm

Now you’re ready to start using your package repository. You need to register it with your Helm client to begin with.

The local repository will be named example-repo. Replace with your GitLab username. The value of should be a personal access token that’s got permission to push packages.

You can generate a new token by clicking your profile icon in the top-right of GitLab’s interface. Select “Preferences” from the menu, then “Access Tokens” from the left sidebar. Add a new access token with the api scope. The write_repository scope might look correct but won’t actually work; it only facilitates access using Git over HTTP, whereas Helm requires API integration.

Substitute the in your repository URL with the ID of the GitLab project you want to push to. You can find this on its homepage, underneath its name.

Pushing to the Repository

Once the repository’s been added, you can push any directory with a valid Helm chart up to your GitLab instance. It’s usually easiest to install the helm-push plugin which adds a native helm push command.

Package your chart if you haven’t already:

This will create a gzipped tar archive, example-chart.tgz, containing your chart.

Add the helm-push plugin:

Finally, use the plugin to push your chart to your GitLab repository:

Back in the GitLab web interface, navigate to your project’s Packages & Registries > Package Registry screen. You should see your chart show up.

Click the chart’s name to view its details. This screen lets you track the chart’s history, download package files, and view older releases. You can delete the chart with the “Delete” button situated in the top-right.

Using Charts in the Repository

With the chart in your repository, you can deploy it into your Kubernetes cluster. helm install commands should work straightaway:

This will start a new chart deployment into your active cluster. Use the –kubeconfig and –namespace Helm flags if necessary to select an appropriate Kubernetes configuration file and specify the namespace to deploy into.

Accessing GitLab’s Repository in a CI Pipeline

As with its other package formats, GitLab’s Helm repository benefits from built-in integration with the software’s CI/CD system. Your pipelines will receive preset environment variables which simplify the chart publication process. You don’t need to set any custom CI variables to configure authentication.

Here’s an example pipeline which creates a chart and publishes it to your repository:

The $CI_REGISTRY variables are configured to let you push new packages into the registry. You can reuse them when authenticating to GitLab’s other repositories, such as npm, Composer, NuGet, and Maven.

Summary

GitLab now has an integrated Helm chart repository that lets you store your Kubernetes manifests alongside your code. Anyone with read access to the project’s repository will be able to add it to their Helm client and deploy charts into Kubernetes clusters.

When a new chart version is published, run helm repo update and then use helm upgrade to move deployed installations to the new release. You can manage chart versions from within GitLab and delete old releases which are wasting disk space.