Add support to multiple environments with the GitLab Kubernetes Agent

Problem to solve

As an Application Operator, in order to test the changes to applications thoroughly before they reach production servers, I want to deploy to development, testing and production environments in sequence.

How can we deploy the same manifest repo to multiple environments? (Think of dev, staging, production)

The current manifest repo configuration file is

deployments:
    - id: cool-company/operations/project1

We expect the referenced project to contain kubernetes manifest yaml files that are deployed as is to the cluster.

Intended users

User experience goal

The user can deploy to various environments with the GitLab Kubernetes Agents.

Proposal

Directories

Example manifest repo: https://gitlab.com/nagyv-gitlab/gitops-test-manifest/

Branches

Branches could be used for the various environments

deployments:
    - id: cool-company/operations/project1
      branch: staging

Pro:

  • simple setup
  • easy to manage with the manifest projects

Cons:

  • ?

Questions:

  • how to handle branches that are not referenced in any agent config file?
  • can we have wildcard branch configs like
  • how can we connect this logic with GitLab environment "labels"?
deployments:
    - id: cool-company/operations/project1
      branch: *

Further details

Even if we once move the Agent to GitLab Core, this functionality could be in GitLab Starter as multiple environments are not expected by single contributors.

Permissions and Security

Documentation

Availability & Testing

What does success look like, and how can we measure that?

What is the type of buyer?

Is this a cross-stage feature?

Links / references

Edited by Viktor Nagy (GitLab)