Argo CD With Helm: Charts, Values, and Versioned Releases
81%
Creating a Helm Repository
A Helm chart can be hosted in several ways: a static HTTP repository (GitHub Pages, Amazon S3, Google Cloud Storage), or an OCI registry. This section uses the GitLab Package Registry, which exposes an HTTP-style Helm repository.
You need these variables. GITLAB_USERNAME and GITLAB_TOKEN (a personal access token with the api scope) were set earlier. Two more:
PROJECT_ID: the GitLab project ID that will host the chart. Find it underSettings>General.
GitLab Project ID
HELM_CHANNEL: the channel the chart is filed under:stable,alpha,beta, or any name you choose.
Here is an example. Make sure to replace the project ID with your own:
# Change the project ID with your own
export PROJECT_ID=82537150
# Change the values accordingly
cat <> $HOME/.bashrc && source $HOME/.bashrc
export PROJECT_ID=$PROJECT_ID
export HELM_CHANNEL="stable"
EOF
We also need to define the URL of the GitLab Package Registry:
cat <> $HOME/.bashrc && source $HOME/.bashrc
export HELM_CHARTS_URL="https://gitlab.com/api/v4/projects/$PROJECT_ID/packages/helm/api/$HELM_CHANNEL/charts"
EOF
Now, we can upload the Helm chart to the GitLab Package Registry:
# The package is named -.tgz
CHART_PKG="todo-0.1.0.tgz"
# Upload the package to the GitLab Helm registry
curl \
--fail-with-body \
--request POST \
--form "chart=@${CHART_PKGGitOps the Hard Way, with Argo CD
Build Real GitOps Pipelines From Empty Clusters to Automated DeploysEnroll now to unlock all content and receive all future updates for free.

