diff options
Diffstat (limited to 'doc/user/clusters/agent/index.md')
-rw-r--r-- | doc/user/clusters/agent/index.md | 53 |
1 files changed, 16 insertions, 37 deletions
diff --git a/doc/user/clusters/agent/index.md b/doc/user/clusters/agent/index.md index 83933524fd4..c59d2a1f61c 100644 --- a/doc/user/clusters/agent/index.md +++ b/doc/user/clusters/agent/index.md @@ -140,46 +140,25 @@ All the options for the [Kubernetes Agent configuration repository](repository.m ### Create an Agent record in GitLab +> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/5786) in GitLab 14.1, you can create a new Agent record directly from the GitLab UI. + Next, create a GitLab Rails Agent record to associate it with the configuration repository project. Creating this record also creates a Secret needed to configure -the Agent in subsequent steps. You can create an Agent record with GraphQL: - - ```graphql - mutation createAgent { - # agent-name should be the same as specified above in the config.yaml - createClusterAgent(input: { projectPath: "path-to/your-configuration-project", name: "<agent-name>" }) { - clusterAgent { - id - name - } - errors - } - } - - mutation createToken { - clusterAgentTokenCreate( - input: { - clusterAgentId: "<cluster-agent-id-taken-from-the-previous-mutation>" - description: "<optional-description-of-token>" - name: "<required-name-given-to-token>" - } - ) { - secret # This is the value you need to use on the next step - token { - createdAt - id - } - errors - } - } - ``` +the Agent in subsequent steps. -WARNING: -GraphQL only displays the token and ids **one time** after creating it. Make sure to write down the `secret`, `clusterAgentId`, and `clusterAgentTokenId`; you'll need them later. +In GitLab: + +1. From your project's sidebar, select **Infrastructure > Kubernetes clusters**. +1. Select the **GitLab Agent managed clusters** tab. +1. Select **Integrate with the GitLab Agent**. +1. From the **Select an Agent** dropdown menu, select the Agent you want to connect and select **Next** to access the installation form. +1. The form reveals your registration token. Securely store this secret token as you cannot view it again. +1. Copy the command under **Recommended installation method**. + +In your computer: - If you are new to using the GitLab GraphQL API, refer to the - [Getting started with the GraphQL API page](../../../api/graphql/getting_started.md), - or the [GraphQL Explorer](https://gitlab.com/-/graphql-explorer). +1. Open your local terminal and connect to your cluster. +1. Run the command you copied from the installation form. ### Install the Agent into the cluster @@ -192,7 +171,7 @@ kubectl create namespace gitlab-kubernetes-agent To perform a one-liner installation, run the command below. Make sure to replace: -- `your-agent-token` with the token received from the previous step. +- `your-agent-token` with the token received from the previous step (identified as `secret` in the JSON output). - `gitlab-kubernetes-agent` with the namespace you defined in the previous step. - `wss://kas.gitlab.example.com` with the configured access of the Kubernetes Agent Server (KAS). For GitLab.com users, the KAS is available under `wss://kas.gitlab.com`. |