Skip to content

Add namespace to service account manifest

What does this MR do?

This MR adds the namespace to the service account manifest.

Why was this MR needed?

When this chart is templated by Helm, the service account from templates/service-account.yaml does not specify the namespace.

All other templates include the namespace already.

The official documentation Install GitLab Runner / GitLab agent contains instructions to manually add the namespace to the service account manifest (https://docs.gitlab.com/runner/install/kubernetes-agent.html, step number 4 "Edit the runner-manifest.yaml file to include the namespace of your ServiceAccount.")

What's the best way to test this MR?

  1. Checkout the previous commit 1d19470e
  2. Run helm template . --namespace gitlab-runner-namespace --set rbac.create=true --show-only templates/service-account.yaml
    • :arrow-right: The service account manifest does not contain the namespace
  3. Checkout this MR
  4. Run helm template . --namespace gitlab-runner-namespace --set rbac.create=true --show-only templates/service-account.yaml
    • :arrow-right: The service account manifest does contain the namespace

This diff shows the difference between the service account manifest created by helm template . --namespace gitlab-runner-namespace --set rbac.create=true --show-only templates/service-account.yaml before and after this MR:

--- 1d19470.service-account.yaml	2023-02-02 20:29:01
+++ 2a49a10.service-account.yaml	2023-02-02 20:28:34
@@ -5,6 +5,7 @@
 metadata:
   annotations:
   name: release-name-gitlab-runner
+  namespace: "gitlab-runner-namespace"
   labels:
     app: release-name-gitlab-runner
     chart: gitlab-runner-0.49.0-beta

What are the relevant issue numbers?

Closes #404 (closed)

Merge request reports