doc/user/clusters/management_project_template.md
{{< details >}}
{{< /details >}}
GitLab provides a cluster management project template, which you use to create a project. The project includes cluster applications that integrate with GitLab and extend GitLab functionality. You can use the pattern shown in the project to extend your custom cluster applications.
[!note] The project template works on GitLab.com without modifications. If you're on a GitLab Self-Managed instance, you must modify the
.gitlab-ci.ymlfile.
If you have not yet used the agent to connect your cluster with GitLab:
$KUBE_CONTEXT
and set the value to path/to/agent-configuration-project:your-agent-name.If you have already configured the agent and connected a cluster with GitLab:
$KUBE_CONTEXT
and set the value to path/to/agent-configuration-project:your-agent-name.To create a project from the cluster management project template:
After you use the cluster management template to create a project, you can configure:
.gitlab-ci.yml fileThe .gitlab-ci.yml file:
You can edit and extend the pipeline definitions.
The base image used in the pipeline is built by the cluster-applications project. This image contains a set of Bash utility scripts to support Helm v3 releases.
If you are on a GitLab Self-Managed instance, you must modify the .gitlab-ci.yml file.
Specifically, the section that starts with the comment Automatic package upgrades does not
work on a GitLab Self-Managed instance, because the include refers to a GitLab.com project.
If you remove everything below this comment, the pipeline succeeds.
helmfile.yml fileThe template contains a Helmfile you can use to manage cluster applications with Helm v3.
This file has a list of paths to other Helm files for each app. They're all commented out by default, so you must uncomment the paths for the apps that you would like to use in your cluster.
By default, each helmfile.yaml in these sub-paths has the attribute installed: true. This means that, depending on the state of your cluster and Helm releases, Helmfile attempts to install or update apps every time the pipeline runs. If you change this attribute to installed: false, Helmfile tries to uninstall this app
from your cluster. Read more about how Helmfile works.
The template contains an applications directory with a helmfile.yaml configured for each
application in the template.
The built-in supported applications are:
Each application has an applications/{app}/values.yaml file.
For GitLab Runner, the file is applications/{app}/values.yaml.gotmpl.
In this file, you can define default values for your app's Helm chart. Some apps already have defaults defined.