Draft: Implement multi-tenant cluster with Agent K in Auto DevOps pipeline
What does this MR do and why?
The template added allows people to configure different clusters to be used for the various stages of deployment when using Agent K for the Auto DevOps pipeline.
It currently handles the three usual clusters: testing, staging and production.
One can either use a cluster management project which contains configuration named agentk-testing
, agentk-staging
and agentk-production
or configure each one independently.
Related issues
Fixes #386140
How to set up and validate locally
- Create 3 Kubernetes Cluster using your favorite online provider or for local testing a tool like k3d or kind
- To use the default template values, create a cluster management project named
<PROJECT_NAMESPACE>-cluster-management
wherePROJECT_NAMESPACE
matches the GitLab namespace where your project is located. - Add configurations for
agentk-testing
,agentk-staging
andagentk-production
- Follow the Connecting a Kubernetes cluster with GitLab documentation to deploy Agent K on each cluster
- Create a test project to use the Auto DevOps pipeline
- In
.gitlab-ci.yaml
include theAuto-DevOps-AgentK.gitlab-ci.yaml
fileinclude: - template: Auto-DevOps-AgentK.gitlab-ci.yml
- Push the project to trigger the pipeline
You should see service deployment done on each cluster separately corresponding to the various jobs.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Most of the items of the acceptance checklist should be good however the rspec tests needs to be written. A skeleton rspec file has been added however, it's not clear how to write the checks properly to ensure that the variables of each job that are modified are properly defined.
Also missing, a test that does a full run of the pipeline.