We saved money by running our GitHub Actions runner on the same server as our development Kubernetes cluster.
Most days, that worked well. The server had four CPUs, about 8 GB of memory, and plenty of quiet hours. It built our software, ran tests, and hosted the development environment our team used.
Then several pull requests merged at almost the same time.
For a few minutes, image builds, test suites, and browser tests all ran together. They used so much of the server that Kubernetes could not keep up with its own housekeeping. DNS stopped answering. Deployments stalled. One deployment task remained stuck after the server recovered.
The server stayed on throughout the incident. Its important processes stayed running too. They simply waited too long for CPU time.
The lesson was clear: a cheap runner can become expensive very quickly when it shares a small machine with a cluster.
A busy five minutes
On 27 September 2026, from 08:50 to 09:28 UTC, two StageFlow release jobs started building backend and frontend images. At the same time, test suites and Playwright browser tests ran for two other pull requests.
Each job was ordinary. Together, they were too much for the server.
Between 09:22 and 09:26:
- the one-minute system load reached 59 on a machine with four CPUs;
- available memory fell to 0.70 GiB out of 7.7 GiB;
- major page faults reached roughly 15,000 per second; and
- the server recorded CPU delays during about 86 percent of the time.
At 09:28, Kubernetes marked the server as NotReady. In plain terms, its
control plane had stopped hearing from the server often enough to trust it.
Every pod on that machine received the same warning.
This was our development cluster. People were still using the environments it hosted, so the impact was real.
Kubernetes runs a small agent on each server called the kubelet. The kubelet reports that server’s health to the rest of Kubernetes. During the burst, it did not receive enough CPU time to send its health report before the deadline.
Our cluster had one server, so there was nowhere to move the work while it was struggling.
DNS made the outage larger
The first visible problem was DNS.
Inside Kubernetes, DNS lets one service find another by name. For example, a
deployment tool can ask for argocd-repo-server by name. CoreDNS provides that
service in our cluster.
CoreDNS barely used any resources during the incident. It peaked at about 0.008 CPU and 40 MiB of memory. It still restarted because its health checks allowed only one second for a reply. A process waiting behind many build jobs can miss that deadline even when it is otherwise healthy.
Both CoreDNS replicas lived on the same server, so both slowed down together. Kubernetes restarted them after the failed health checks. A slow DNS service became an unavailable one.
CoreDNS had already restarted 144 times since December. That count showed that the incident exposed a problem that had been present for a while.
The DNS failure affected tools further up the stack. Kargo, our deployment
promotion tool, could not resolve argocd-repo-server and reported an
i/o timeout. A later attempt waited five minutes and failed too.
The deployment error and the DNS error came from the same source: the server had too many competing jobs.
A deployment stayed stuck after the server recovered
At 09:23:09, during the busiest part of the incident, Argo CD deleted a StageFlow database-migration Job as part of a new deployment.
Argo CD normally clears up the old Job after it finishes. In this case, the
cluster became too slow before that cleanup completed. Kubernetes left a
finalizer on the Job. A finalizer is a marker that says Kubernetes must wait
for a controller to finish a piece of cleanup before removing an object.
The Job remained in Terminating. Every later StageFlow deployment waited on
the Job and showed this message:
one or more tasks are running
The task had already finished. Its cleanup marker remained.
We removed the finalizer from the completed Job and added a check to our incident runbook:
kubectl get jobs -A -o json | jq -r '
.items[]
| select(.metadata.deletionTimestamp != null)
| select((.metadata.finalizers // [])
| index("argocd.argoproj.io/hook-finalizer"))
| "\(.metadata.namespace)/\(.metadata.name)"'
The command finds Jobs that are waiting to be deleted while an Argo CD hook finalizer is still present.
We now treat recovery as two pieces of work. First, make the server healthy. Then, check what the outage left half-finished.
We put CI in its own lane
After the incident, we put a limit on how much capacity CI can use. The runners still use spare capacity on Kubernetes hosts.
On every runner host, we created a systemd resource group called ci.slice.
It gives all CI work on the machine one shared limit:
[Slice]
CPUQuota=250%
CPUWeight=20
MemoryHigh=3G
MemoryMax=3.5G
IOWeight=20
The settings mean CI can use up to two and a half CPU cores on this example host. It receives lower priority than the cluster when the machine is busy. The system starts slowing CI down when its memory use is high. If memory use keeps rising, the system ends a CI process. That leaves room for the host and cluster services.
We want a failing build to stay contained within that build. DNS and deployment services need to remain available for everyone using the development environment.
We also had to limit the build containers
At first, we planned to place the GitHub runner service inside ci.slice.
That would have covered the shell commands that a workflow runs directly.
Image builds follow a different path. Docker Buildx starts a BuildKit container to build the image. Docker owns that container, so it needs its own route into the CI resource group.
We configured Docker to place its new containers in the same CI resource group:
{
"cgroup-parent": "ci.slice"
}
We checked the result using /proc/<pid>/cgroup. New BuildKit containers and
job containers appeared under /ci.slice/docker-*.scope, along with the runner
services.
Two runners on the same host share the same cap. That matches the physical reality. The host has one set of CPUs and one pool of memory.
This setting applies to every new Docker container on the host. One host also
runs a long-lived Docker Compose application. We placed those services in
system.slice and recreated them before restarting Docker. Existing containers
keep the resource group they received when they started.
Kubernetes needs room of its own
The CI limit protects the cluster from CI. Kubernetes also needs protection from its own pods.
We set aside part of each node’s CPU and memory for the operating system and for Kubernetes itself:
kubelet-arg:
- "system-reserved=cpu=500m,memory=768Mi"
- "kube-reserved=cpu=250m,memory=256Mi"
These are called kubelet reservations. They tell Kubernetes to leave enough capacity for the server and the cluster’s own work.
We also increased the health-report grace period to two minutes on the single-node cluster. That gave the kubelet more time to recover from a short burst before Kubernetes declared the only node unavailable.
We gave CoreDNS more time to answer on the old cluster. That was a live change which a k3s restart could undo. The new development cluster still uses the default health checks. Its extra capacity reduces the pressure, and a lasting probe change remains on our list.
What changed
We applied this pattern across three runner hosts. Each host has limits suited to its own size. The pattern stays the same:
- CI has a shared CPU, memory, and disk limit.
- Docker build containers live within that limit.
- Kubernetes has reserved room for its own services.
- Runner users use accounts without passwordless
sudoaccess.
Docker access still gives a runner broad power over its host. A workflow can mount the host filesystem into a container. We treat each runner as a machine that must only run code we trust.
We also moved the development cluster to a larger server. The old server had about one gigabyte of free memory before CI began. A larger machine gave us more breathing room. The limits remain important because every machine has a breaking point.
The lesson we kept
Average usage made the runner look cheap. The busiest five minutes showed its real cost.
Sharing a server between CI and Kubernetes can work. It needs clear limits, enough spare capacity, and a recovery plan for the work that an outage leaves behind.
The build should be the first thing to give way when a machine is under pressure. The cluster should have enough room to keep serving the people who depend on it.
Comments