Skip to content

Draft: Implement multi-tenant cluster with Agent K in Auto DevOps pipeline

SGaist requested to merge SGaist/gitlab:auto_devops_agentk_multitenant into master

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

  1. Create 3 Kubernetes Cluster using your favorite online provider or for local testing a tool like k3d or kind
  2. To use the default template values, create a cluster management project named <PROJECT_NAMESPACE>-cluster-management where PROJECT_NAMESPACE matches the GitLab namespace where your project is located.
  3. Add configurations for agentk-testing, agentk-staging and agentk-production
  4. Follow the Connecting a Kubernetes cluster with GitLab documentation to deploy Agent K on each cluster
  5. Create a test project to use the Auto DevOps pipeline
  6. In .gitlab-ci.yaml include the Auto-DevOps-AgentK.gitlab-ci.yaml file
    include:
        - template: Auto-DevOps-AgentK.gitlab-ci.yml
  7. 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.

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.

Merge request reports