Bootstrap a GitLab CI pipeline that runs in a Kubernetes executor with per-job ephemeral namespaces and pod resource limits

domain: docs.gitlab.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install GitLab Runner with the Kubernetes executor via Helm: helm repo add gitlab https://charts.gitlab.io && helm install gitlab-runner gitlab/gitlab-runner --set gitlabUrl=https://gitlab.com --set runnerToken=<TOKEN> --namespace gitlab-runner
  2. Configure config.toml (via Helm values runners.config) to set [runners.kubernetes] with namespace, image, cpu_request, cpu_limit, memory_request, memory_limit for the build container
  3. Set namespace_per_job = true (or per_job_namespace_labels) in the runner config so each CI job receives an isolated Kubernetes namespace, enabling resource cleanup via namespace deletion
  4. In .gitlab-ci.yml set resource_group: <env> on deploy jobs to serialize concurrent deployments to the same environment without manual locking
  5. Define image: and services: at the job level to override the default executor image; the Kubernetes executor launches services as additional containers in the same pod
  6. Use variables: KUBERNETES_CPU_REQUEST, KUBERNETES_MEMORY_LIMIT etc. at the job or pipeline level to override executor resource settings per job without changing runner config

Known gotchas

Related routes

Provision ephemeral namespace-per-PR environments using GitHub Actions and kubectl
docs.github.com/actions · 6 steps · unrated
Configure KEDA ScaledJob to scale CI build runners as Kubernetes Jobs based on a queue length from an SQS-like message queue
keda.sh · 6 steps · unrated
Configure GitLab CI needs: keyword with DAG to eliminate sequential stage bottlenecks and fan out parallel jobs
docs.gitlab.com · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans