Join us
@datails ・ Sep 01,2022 ・ 1 min read ・ 4k views
In this article I’ll show how to store and consume Helm charts in GitLab’s private registry.
You’ll learn how to create 2 simple helm charts, called store-chart and consume-chart where store-chart will be stored in GitLab and consume-chart will consume the stored chart.
The following directory structure outlines the final result.
To see a working example see GitLab.
Create the store-chart
Let’s create the store-chart
first and add the following to the config.yaml
.
Create the Chart.yaml
.
And finally the default values in the values.yaml
.
Store the chart in GitLab
Now create a basic .gitlab-ci.yml
.
For convenience use the alpine/helm image so the helm
cli is given out-of-the-box to you. Explicitly override the entrypoint, to prevent running a subcommand of the helm
cli.
helm
chart repository given by GitLab. The chart repository follows the following URL structure.
3. Create the Helm
package and push it to GitLab’s private registry.
You should now be able to run the pipeline.
Now verify if the chart has been created.
All done!
Create the consumer
Now let’s create the consume-chart
and add the following:
To use the store-chart
refer to it as a dependency, where the repository URL equals the registry URL found in GitLab, as shown in the last step of storing the chart.
Now override the default values of the chart by adding a values.yaml
:
Note the store-chart
prefix key is necessary here to override the values of a the dependency.
Update your .gitlab-ci.yml
to verify if you can consume your chart from the pipeline:
The consume-chart
step should now output the following:
All done, you can see the name of the ConfigMap
has been successfully overwritten 🚀!
Join other developers and claim your FAUN account now!
Influence
Total Hits
Posts
Only registered users can post comments. Please, login or signup.