Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 46,623
    • Issues 46,623
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,531
    • Merge requests 1,531
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #352186
Closed
Open
Issue created Feb 07, 2022 by Viktor Nagy (GitLab)@nagyv-gitlab🕊Developer

Add Environments support to the GitLab Agent

DRI from grouprelease: @shinya.maeda

Release notes

Problem to solve

  • As an Application Operator, I want to see what is currently running in my namespaces/clusters.
  • As an Application Operator, I want to control and monitor rollouts.
  • As a Release Manager, I want to control and monitor rollouts.

Add Environment support to deployments managed by the GitLab Agent for Kubernetes.

Proposal

By @marshall007:

I think a more logical short-term fit for the Agent is for it to facilitate the creation and teardown of "environments" within GitLab via the Kubernetes API (in the form of CRDs and/or annotations on the ConfigMap inventory object). In other words, let the cluster be the authoritative source of "environments" and "deployments" and have the Agent act as a shim for syncing that cluster state back to GitLab.

This would be awesome because users would no longer need to explicitly implement a CI job for tearing down environments. Tearing down an environment becomes synonymous with pruning all the resources associated with an inventory object/id. This could now be done either via the GitLab UI or manually in the cluster to the same effect. Currently if you manually delete the namespace in the cluster associated with a review app, GitLab is unaware that this environment has been deleted.

A ton of discussion happened in #350697 (comment 833047627)

apiVersion: k8s.gitlab.io/v1
kind: Environment
metadata:
  name: review-023f1bce01-my-review-branch
spec:
  name: review/my-review-branch
  externalUrl: https://023f1bce01-my-review-branch.review.example.com
  autoStop: "1 week"
  scope:
    inventoryId: 01243567789-my-inventory-id
    labels:
      customLabel: customValue
    namespace: my-environment-namespace

The UI could show the Kubernetes resources returned based on the scope filters:

  • inventoryId: return the resources owned by the given inventory id and their siblings

  • labels: return the resources that match the given labels

  • namespace: return the resources from the given namespace only

  • these filters are AND-ed together

  • The list of filters can be extended later if needed.

  • An Environment with an inventoryId filter could be auto-created by specifying the other parts of spec as part of the gitops.manifest_projects configuration to simplify the integration setup.

Intended users

  • Rachel (Release Manager)
  • Allison (Application Ops)

Metrics

  • Any ideas for MAU based metrics?

  • Number of environments updated / month

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Edited Jan 24, 2023 by Vladimir Shushlin
Assignee
Assign to
Time tracking