Skip to content

Use the agent name as a namespace name

What does this MR do and why?

In order to use a different namespace for each agent, we are adding the agent name into the namespace with the prefix gitlab-agent. As the limit for the agent name is 63 characters and the limit for the namespace name is 63 characters as well, using the prefix we are limited to 50 characters remaining for the agent name. In case of exceeding the limit, we truncate the agent name used in the namespace name.

Screenshots or screen recordings

Before After After (truncated)
Screenshot_2022-11-29_at_07.54.54 Screenshot_2022-11-29_at_07.50.50 Screenshot_2022-11-29_at_07.53.44

How to set up and validate locally

  1. Visit Project -> Infrastructure -> Kubernetes clusters
  2. Select Connect cluster
  3. Create an agent from the modal
  4. Verify the agent installation instructions

To validate using GitPod you'll need to enable KAS:

  1. Go to the gitlab-development-kit folder

  2. Change the gdk.yml file to add the following lines:

    gitlab_k8s_agent:
      enabled: true
  3. Install Bazel using Bazelisk

    npm install -g @bazel/bazelisk
  4. Run gdk reconfigure and gdk restart

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Review progress:

Related to #366544 (closed)

Edited by Anna Vovchenko

Merge request reports