doc/user/clusters/management_project.md
{{< details >}}
{{< /details >}}
{{< history >}}
{{< /history >}}
[!flag] This feature is not available by default on GitLab Self-Managed. To make it available, an administrator can enable the feature flag named
certificate_based_clusters.
A project can be designated as the management project for a cluster.
[!warning] The cluster management project was deprecated in GitLab 14.5. To manage cluster applications, use the GitLab agent for Kubernetes with the Cluster Management Project Template.
A management project can be used to run deployment jobs with
Kubernetes
cluster-admin
privileges.
This can be useful for:
cluster-admin privileges.Only the management project receives cluster-admin privileges. All
other projects continue to receive namespace scoped edit level privileges.
Management projects are restricted to the following:
To use a cluster management project to manage your cluster:
Prerequisites:
To associate a cluster management project with your cluster:
After designating a project as the management project for the cluster,
add a .gitlab-ci.yml file in that project. For example:
configure cluster:
stage: deploy
script: kubectl get namespaces
environment:
name: production
Environment scopes are usable when associating multiple clusters to the same management project.
Each scope can only be used by a single cluster for a management project.
For example, the following Kubernetes clusters are associated to a management project:
| Cluster | Environment scope |
|---|---|
| Development | * |
| Staging | staging |
| Production | production |
The environments set in the .gitlab-ci.yml file deploy to the
Development, Staging, and Production cluster.
stages:
- deploy
configure development cluster:
stage: deploy
script: kubectl get namespaces
environment:
name: development
configure staging cluster:
stage: deploy
script: kubectl get namespaces
environment:
name: staging
configure production cluster:
stage: deploy
script: kubectl get namespaces
environment:
name: production