Cluster management project (alpha)
Introduced in GitLab 12.5
A project can be designated as the management project for a cluster.
A management project can be used to run deployment jobs with
Kubernetes
cluster-admin
privileges.
This can be useful for:
- Creating pipelines to install cluster-wide applications into your cluster, see Install using GitLab CI/CD (alpha) for details.
- Any jobs that require
cluster-admin
privileges.
Permissions
Only the management project will receive cluster-admin
privileges. All
other projects will continue to receive namespace scoped edit
level privileges.
Management projects are restricted to the following:
- For project-level clusters, the management project must be in the same namespace (or descendants) as the cluster’s project.
- For group-level clusters, the management project must be in the same group (or descendants) as the cluster’s group.
- For instance-level clusters, there are no such restrictions.
Usage
To use a cluster management project for a cluster:
- Select the project.
- Configure your pipelines.
- Set an environment scope.
Selecting a cluster management project
To select a cluster management project to use:
- Navigate to the appropriate configuration page. For a:
- Project-level cluster, navigate to your project’s Operations > Kubernetes page.
- Group-level cluster, navigate to your group’s Kubernetes page.
- Instance-level cluster, navigate to Admin Area’s Kubernetes page.
- Select the project using Cluster management project field in the Advanced settings section.
Configuring your pipeline
After designating a project as the management project for the cluster,
write a .gitlab-ci.yml
in that project. For example:
configure cluster:
stage: deploy
script: kubectl get namespaces
environment:
name: production
Setting the environment scope
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, let’s say the following Kubernetes clusters are associated to a management project:
Cluster | Environment scope |
---|---|
Development | *
|
Staging | staging
|
Production | production
|
The following environments set in
.gitlab-ci.yml
will deploy to the
Development, Staging, and Production cluster respectively.
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
Help and feedback
If there's something you don't like about this feature
To propose functionality that GitLab does not yet offer
To further help GitLab in shaping new features
If you didn't find what you were looking for
If you want help with something very specific to your use case, and can use some community support
POST ON GITLAB FORUM
If you have problems setting up or using this feature (depending on your GitLab subscription)
REQUEST SUPPORT
To view all GitLab tiers and features or to upgrade
If you want to try all features available in GitLab.com
If you want to try all features available in GitLab self-managed
If you spot an error or a need for improvement and would like to fix it yourself in a merge request
EDIT THIS PAGE
If you would like to suggest an improvement to this doc