Support multiple Kubernetes cluster per project
Description
It's common to have a different Kubernetes cluster for production vs the rest of development. Currently, the CI/CD > Cluster page only supports a single Kubernetes cluster per project. We should consider allowing multiple clusters for different environments.
Proposal
Extend the actual CI/CD > Cluster page to allow multiple clusters to be defined at the same time, and make them related to different Environments.
In case of an environment matching multiple patterns, the more specific one has precedence.
We need functionalities to:
- add a cluster to the list
- GKE cluster created from the web interface
- existing Kubernetes cluster (parameters added manually)
- assign a cluster to an environment pattern (supporting wildcards, similar to environment specific variables
- remove a cluster from the list (cannot be added again, you need to reconfigure it if needed)
Optional features:
- enable/disable a cluster in the list (without removing it)
Note: since multiple clusters will be available only to ~"EE Premium" and ~"EE Ultimate" customers, we should consider also how will be the page for the other versions.
Design
Cluster list
The cluster list follows the same format of other CI pages.
Since CE and EES can only have one cluster, this list will only show one item. After the first cluster is added, the Add cluster
button will become disabled. This is fitting with our approach of showing EE features on CE in a disabled state.
The columns shown are
- Cluster name
- Environment pattern. For CE and EES we can show
*
in this column - Project namespace
- Toggle to change active/inactive state
TODO: If possible, find a way to have a single list that shows active and inactive clusters all at once (remove, Active
, Inactive
and All
tabs)
EEP / EEU | CE / EES |
---|---|
![]() |
![]() |
Empty state
Like all lists, we need an empty state screen. The SVG illustration can be found here
TODO: Review the copy for this screen
Add cluster page
Once the user clicks the Add cluster
page, they are taken to the same page that was implemented in https://gitlab.com/gitlab-org/gitlab-ce/issues/35616. Some copy changes were made to adapt this page to the new multi-cluster implementation.
TODO: Review the copy for this screen
The help text was condensed on the GKE form, telling the user to visit our help page to review the requirements.
On the 'Existing cluster' form a new field for Cluster name
was added at the top.
Choose method | GKE | Existing |
---|---|---|
![]() |
![]() |
![]() |
View cluster page
On the view cluster page, the section at the top is renamed to Cluster integration
. Here the user can change the Active/Inactive state for the cluster and decide which environments it's used in.
On CE and EES we can disable the environment pattern field.
EEP / EEU | CE / EES |
---|---|
![]() |
![]() |
There are not changes to the cluster details section for GKE clusters. For existing clusters, a new Cluster name
field is added.
Links / references
https://gitlab.com/gitlab-org/gitlab-ce/issues/35956
Documentation blurb
Overview
What is it? Why should someone use this feature? What is the underlying (business) problem? How do you use this feature?
Use cases
Who is this for? Provide one or more use cases.
Feature checklist
Make sure these are completed before closing the issue, with a link to the relevant commit.
-
Feature assurance -
Documentation -
Added to features.yml