Skip to content

Support single replica deployments via CI jobs

When using a single replica, the chart is currently configured so that kubernetes kills off the old pod before trying to bring up a new one, which breaks the tunnel and causes the running CI job to fail.

This merge request will fix the issue by requiring that the new pod come up before the old pod is taken down when replicas is set to a value less than 2.


There is a risk that this will be a breaking change for a small number of users who run the the gitlab-agent in a namespace configured with resource-quota or limit-range resources with very restrictive values, so a breaking change notice should be provided for this.

Problem statement:

If the namespace where your gitlab-agent will be deployed has very restrictive limit-ranges or resource-quotas, this change could prevent the new gitlab-agent pod from being scheduled because there would temporarily be 2 gitlab-agent pods running at the same time.

Resolution statement:

Work with whoever controls those limit-range and resource-quota resources in your namespace to adjust the values to allow for a second gitlab-agent pod to run concurrently with the first. This second pod will take over the tunnel from the first pod to prevent outages when deploying the gitlab-agent from a CI pipeline.


This will not be a breaking change for users who already run more than one replica at all times, or users who have sufficiently "loose" values in their resource-quotas and limit-ranges for the namespace where the gitlab-agent is running.

Closes: #35 (closed)

Edited by Thomas Spear

Merge request reports