summaryrefslogtreecommitdiff
path: root/doc/user/clusters
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-12-15 18:09:34 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-12-15 18:09:34 +0000
commita84aefe0bb8fc2ad47ab67cb4ddcfbb7aecfbd5e (patch)
treedfcd00dc9603a8c652211c6066ceae0c97df1a7f /doc/user/clusters
parent16cdacff02fbf0069182e090df2eeaa754007957 (diff)
downloadgitlab-ce-a84aefe0bb8fc2ad47ab67cb4ddcfbb7aecfbd5e.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/user/clusters')
-rw-r--r--doc/user/clusters/agent/ci_cd_workflow.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/user/clusters/agent/ci_cd_workflow.md b/doc/user/clusters/agent/ci_cd_workflow.md
index 7645398e84e..2a66549f9cb 100644
--- a/doc/user/clusters/agent/ci_cd_workflow.md
+++ b/doc/user/clusters/agent/ci_cd_workflow.md
@@ -287,6 +287,35 @@ The identity can be specified with the following keys:
See the [official Kubernetes documentation for details](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#user-impersonation).
+## Restrict project and group access to specific environments **(FREE)**
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/343885) in GitLab 15.7.
+
+By default, if your agent is [available to a project](#authorize-the-agent), all of the project's CI/CD jobs can use that agent.
+
+To restrict access to the agent to only jobs with specific environments, add `environments` to `ci_access.projects` or `ci_access.groups`. For example:
+
+ ```yaml
+ ci_access:
+ projects:
+ - id: path/to/project-1
+ - id: path/to/project-2
+ environments:
+ - staging
+ - review/*
+ groups:
+ - id: path/to/group-1
+ environments:
+ - production
+ ```
+
+In this example:
+
+- All CI/CD jobs under `project-1` can access the agent.
+- CI/CD jobs under `project-2` with `staging` or `review/*` environments can access the agent.
+ - `*` is a wildcard, so `review/*` matches all environments under `review`.
+- CI/CD jobs for projects under `group-1` with `production` environments can access the agent.
+
## Related topics
- [Self-paced classroom workshop](https://gitlab-for-eks.awsworkshop.io) (Uses AWS EKS, but you can use for other Kubernetes clusters)