Blogs / My CI Runners Took Down My Kubernetes Cluster Twice in One Week

My CI Runners Took Down My Kubernetes Cluster Twice in One Week

December 3, 2026 • Matthew Duong • Kubernetes;Self Hosting;Devops • 17 min read

My CI Runners Took Down My Kubernetes Cluster Twice in One Week

On 5 November rackmount-a, one of the three control-plane nodes in my home Kubernetes cluster, went NotReady.

The only thing I’d changed was where my CI runners ran. The night before, I’d raised the cap on ds160’s self-hosted GitHub Actions runners from 10 to 30 and let them spread across every node. Six days later the same runners took out DNS for the whole cluster. This is what happened, in the order it happened. Times are US Pacific (UTC-8), and I give UTC as well where it matters.

The cluster is three rackmounts and two workers

It runs RKE2 v1.33. Three Dell rackmounts (rackmount-a, -b and -d) are the control plane. Each also holds about 45 database volumes (Postgres, MongoDB, ClickHouse, Prometheus) through the local-path provisioner, and those volumes share one root disk with etcd. The biggest worker, compute-b, has 16 CPUs and 60 GiB of memory and runs no databases. Runners stay off the other worker, compute-a, because Docker-in-Docker was unreliable on its newer containerd.

CI runs on Actions Runner Controller (the gha-runner-scale-set chart, 0.13.0), with one runner scale set per repo and Docker-in-Docker (dind) for image builds. The busiest repo is ds160.io, whose pipeline runs 20 to 30 jobs at once.

flowchart TB
  subgraph rack["rackmount-a, -b, -d (control plane)"]
      direction TB
      etcd["etcd"]
      vols["~45 database volumes each"]
      disk[("one root disk")]
      etcd --> disk
      vols --> disk
  end
  subgraph cb["compute-b (16 CPU, 60 GiB)"]
      free["no databases"]
  end
  subgraph ca["compute-a"]
      none["no runners"]
  end
  gh["GitHub Actions jobs<br/>ds160: 20 to 30 at once"] --> arc["actions-runner-controller"]
  arc -- "runner pods, no resource requests" --> rack
  arc -- "runner pods, no resource requests" --> cb
Before November. Runner pods could land on any node except compute-a, including the rackmounts where etcd and the databases share one disk.

Until 4 November the runner pods had no resource requests and one soft preference for compute-b:

template:
  spec:
    affinity:
      nodeAffinity:
        requiredDuringSchedulingIgnoredDuringExecution:
          nodeSelectorTerms:
            - matchExpressions:
                - key: kubernetes.io/hostname
                  operator: NotIn
                  values:
                    - thegalah-compute-a
        preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 100
            preference:
              matchExpressions:
                - key: kubernetes.io/hostname
                  operator: In
                  values:
                    - thegalah-compute-b

ds160 runs up to 30 jobs at once, and the cap was 10

The scale sets default to 10 runners. ds160’s pipeline runs 20 to 30 jobs at once, so up to 20 of them waited in GitHub’s queue. Builds were also getting slower. Successful web-app build-and-push runs went from a median of 7.7 minutes in the week of 5 October to 14.6 minutes in the week of 26 October, before I’d changed anything about the runners.

On the evening of 4 November I set maxRunners: 30 for ds160. My runner pods had no requests, so the scheduler had no way to tell that compute-b was busy. With the preference above, all 30 would have piled onto it. I made three attempts at placement that evening:

  1. 20:04. A soft topology spread constraint (maxSkew: 2, ScheduleAnyway) across every node, counting runners from every repo.
  2. 20:05. I swapped the spread for requests of 2 CPU and 4 GiB and put the compute-b preference back. With requests, compute-b would fill at about seven runners. After that it fails the fit check and the default scoring sends the rest to whichever rackmount has the most free capacity.
  3. 20:38. I added a hard spread on top, so the preference couldn’t run away:
topologySpreadConstraints:
  - maxSkew: 4
    topologyKey: kubernetes.io/hostname
    whenUnsatisfiable: DoNotSchedule
    nodeTaintsPolicy: Honor
    labelSelector:
      matchLabels:
        app.kubernetes.io/component: runner

nodeTaintsPolicy: Honor drops cordoned nodes from the skew calculation. Without it, a cordoned node stuck at zero runners would cap every other node at four.

I capped compute-b with a pod that does nothing

Early the next morning I wanted compute-b held to four runners to limit CPU contention between builds. There’s no Kubernetes setting for “at most N pods with this label on a node”, and maxSkew only limits the difference between nodes. So I took the capacity away instead. A pause container requested 5.5 CPUs on compute-b. It used no real CPU, but the scheduler counted its request:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: compute-b-runner-cap
  namespace: github-runners
spec:
  replicas: 1
  # Recreate, so a rollout never needs a second 5.5 CPU slot on compute-b.
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: compute-b-runner-cap
  template:
    metadata:
      labels:
        app: compute-b-runner-cap
    spec:
      nodeSelector:
        kubernetes.io/hostname: thegalah-compute-b
      terminationGracePeriodSeconds: 0
      automountServiceAccountToken: false
      containers:
        - name: reserve
          image: registry.k8s.io/pause:3.10
          resources:
            requests:
              cpu: 5500m
              memory: 16Mi
            limits:
              memory: 16Mi

The sizing was arithmetic on the node’s free CPU. compute-b has 16 allocatable CPUs and runners requested 2 each, so four runners fit only while free CPU stays between 8 and 10. Everything else on the node requested between 0.66 CPU (DaemonSets) and about 1.8 CPU, and 5.5 kept the free space inside that window.

Three runners on rackmount-a stalled the node

On 5 November three runners landed on rackmount-a. That was the setup doing what I’d built it to do. With compute-b capped by the pause pod and the spread limiting how far ahead of the other nodes it could get, the extra runners were meant to go to the rackmounts. Their builds pushed I/O pressure on rackmount-a’s root disk to about 55%. The API server on that node failed its liveness probe and the node went NotReady.

At the time I put it down to etcd falling behind on the disk it shares with the builds. That was an inference, not a measurement. I wasn’t scraping etcd’s metrics until 20 November, so there are no fsync numbers from that day. I didn’t save any graphs either, and Prometheus only keeps seven days.

At 08:05 I limited the rackmounts to one runner each, using required pod anti-affinity on a rackmount label that only the rackmounts carry:

podAntiAffinity:
  requiredDuringSchedulingIgnoredDuringExecution:
    - topologyKey: rackmount
      labelSelector:
        matchLabels:
          app.kubernetes.io/component: runner

A spread constraint on the rackmount label couldn’t do this. With DoNotSchedule it rejects nodes that don’t have the topology key, which would have excluded compute-b. With maxSkew it only balances the rackmounts against each other. compute-b has no rackmount label, so the anti-affinity left it alone. That gave four runners on compute-b plus one per rackmount, and the rest waited in GitHub’s queue.

The pause pod turned out to be fragile. Six minutes later I raised the compute-b cap to five and reserved 3.2 CPUs, assuming 2.8 CPUs of other requests. It was really 3.0, which left 9.77 CPUs free: still four runners. Two minutes later I dropped the reservation to 2 CPUs. The cap moved whenever anything else on the node changed its requests.

Builds on the rackmounts were three times slower anyway

Over the next few days the numbers made the decision for me. A ds160 web build job took 25 to 30 minutes on a rackmount and about 8 on compute-b. A job that waited in GitHub’s queue for a compute-b slot still finished before one that started straight away on a rackmount.

On 9 November I deleted the spread constraint, the anti-affinity and the pause pod, and pinned every runner to compute-b:

affinity:
  nodeAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
      nodeSelectorTerms:
        - matchExpressions:
            - key: kubernetes.io/hostname
              operator: In
              values:
                - thegalah-compute-b

A minute later I lowered the CPU request from 2 to 1 so more runners would fit. That was the change that set up the next outage. Until then CPU had been the limit, and about six runners fit on compute-b. With 1 CPU, memory became the limit, and about 13 fit.

I never measured the 4 GiB. It went in on 4 November next to the 2 CPU request, as a hint for the scheduler, and while CPU was the limit it didn’t matter. Halving the CPU request made 4 GiB the number that decided how many builds shared the node, and I didn’t recheck it.

Looking back, it wasn’t far off on average. In the week before, no more than nine runners ran at once and the node peaked at 41 GiB. In the outage, 13 runners took it from 9 GiB to 54 GiB, about 3.5 GiB each. What 4 GiB didn’t leave room for was everything else. Thirteen runners at 4 GiB plus the node’s other requests come to about 56 GiB, on a node with 59.6 GiB and nothing reserved for the kernel or the kubelet. I didn’t know that last part yet.

On 10 November ds160’s image builds also started stalling on large downloads. That was a separate problem, an MTU mismatch inside Docker-in-Docker, and it didn’t cause either outage.

The next evening three unrelated APIs started returning 503s

At 21:36 on 10 November (05:36 UTC on the 11th) the API pods for uptimeprobe, salesdingo and coderone started returning 503s and restarting. It lasted five minutes. None of them run CI, and none of them were on compute-b.

Their readiness checks were failing with this:

ENOTFOUND uptimeprobe-clickhouse-headless

ENOTFOUND means the name didn’t resolve. That’s an in-cluster Service name, so the lookup goes to CoreDNS. One of the CoreDNS replicas was on compute-b. On that node, anonymous memory had gone from 9 GiB to 54 GiB in five minutes, and 13 ds160 runners were running.

The kernel’s OOM killer had fired. It killed ingress-nginx, MetalLB and the CoreDNS autoscaler, but not the builds that were using the memory.

The CoreDNS replica on compute-b wasn’t killed. It was starved of memory but stayed Ready, so the kube-dns Service kept sending it lookups, and those lookups failed. CoreDNS runs two replicas today. If it ran two that night, about half of all lookups in the cluster went to the starved one. That’s worked out from the replica count. I didn’t measure the failure rate.

Until then I’d thought pinning the runners had contained them. All it had done was move the damage. Anything that shared compute-b with the builds was exposed, and CoreDNS made that cluster-wide.

RKE2 on my nodes reserves no memory for the system

I’d assumed the kubelet would evict a runner before the node ran out of memory. Here is the live kubelet config on compute-a, which I haven’t changed:

$ kubectl get --raw /api/v1/nodes/thegalah-compute-a/proxy/configz \
    | jq -c '.kubeletconfig | {evictionHard, systemReserved, kubeReserved}'
{"evictionHard":{"imagefs.available":"5%","nodefs.available":"5%"},"systemReserved":null,"kubeReserved":null}

rackmount-d shows the same, and on both nodes allocatable memory equals capacity. RKE2 v1.33.13 sets the two disk thresholds and nothing else. The Kubernetes docs say that once you set any hard eviction threshold, the others aren’t inherited from the defaults and are set to zero. So there’s no memory.available threshold at all. (An earlier version of this post said the threshold was 100 MiB. That’s the upstream kubelet default, not what my nodes run.)

Nothing sat between the runners and the kernel’s OOM killer.

What I changed that night

By 04:48 the next morning I’d made three changes.

I reserved memory on compute-b. This is an RKE2 config drop-in on the node, followed by a restart of rke2-agent:

# /etc/rancher/rke2/config.yaml.d/50-kubelet-reserved.yaml on compute-b
kubelet-arg+:
  - "system-reserved=cpu=500m,memory=2Gi"
  - "kube-reserved=cpu=500m,memory=1Gi"
  - "eviction-hard=memory.available<2Gi,nodefs.available<10%,imagefs.available<15%,nodefs.inodesFree<5%,imagefs.inodesFree<5%"

The + in kubelet-arg+ appends to the existing list instead of replacing it. eviction-hard replaces every threshold, so the disk ones have to be written out again. I used the upstream defaults, 10% and 15%, which are stricter than the 5% RKE2 had set. Allocatable memory went from 59.6 GiB to 54.6 GiB, and the kubelet’s /configz on compute-b now shows the reservations.

I raised the runner memory request from 4 GiB to 6 GiB. That fits about eight runners. A request only affects scheduling. It doesn’t stop a pod using more. The higher request lowers concurrency because fewer pods fit on the node, and it works across every repo’s runners. maxRunners only counts one scale set.

I moved CoreDNS and its autoscaler off compute-b with a node affinity in RKE2’s HelmChartConfig for CoreDNS. Setting affinity replaces the chart’s default, which also held CoreDNS to one replica per node, so I restated that:

affinity:
  nodeAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
      nodeSelectorTerms:
        - matchExpressions:
            - key: kubernetes.io/hostname
              operator: NotIn
              values:
                - thegalah-compute-b
  podAntiAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
      - topologyKey: kubernetes.io/hostname
        labelSelector:
          matchExpressions:
            - key: k8s-app
              operator: In
              values:
                - kube-dns
autoscaler:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
          - matchExpressions:
              - key: kubernetes.io/hostname
                operator: NotIn
                values:
                  - thegalah-compute-b

The eviction threshold hasn’t been tested under that load

The 6 GiB request means 13 runners can’t happen again on compute-b, so the new eviction threshold hasn’t been tested under the load that caused the outage. In the last seven days (all Prometheus keeps) compute-b peaked at 8 runners and 37.6 GiB of anonymous memory. Available memory never went below 6.1 GiB, so the 2 GiB threshold never came close to firing.

I’m also not sure the kubelet would evict the right pod if it did fire. I didn’t set a memory limit on the runners because the dind sidecar reported almost no memory. This week I checked that properly. Over the same seven days:

  • The largest runner pod’s cgroup peaked at 1.6 GiB, and the largest dind container at 0.26 GiB.
  • All runner pods together peaked at 3.6 GiB.
  • The node’s anonymous memory exceeded the combined working set of every pod on it by up to 30.8 GiB.

So most of the build memory isn’t charged to the runner pods. That part is measured. Why it happens isn’t confirmed. My guess is that dockerd in the privileged dind container puts the build containers in cgroups outside the pod’s cgroup.

If that’s right, it has two consequences. A memory limit on the runner wouldn’t contain a build. And the kubelet ranks pods for eviction first by whether their usage exceeds their requests. A runner looks like it’s using 1.5 GiB of a 6 GiB request, so it would be one of the last pods picked. For now the only real protection is the 6 GiB request holding compute-b to eight runners. Without limits, one runaway build can still use as much memory as the node has free.

Moving the runners off the rackmounts exposed a disk problem that was already there

After 9 November no runners ran on the rackmounts, but the control plane still wasn’t healthy. On 19 November I looked into controllers that had been restarting a few times a day: the cnpg operator, kube-controller-manager, kube-scheduler, clickhouse-operator and others. All of them restarted at the same moment, and their logs ended the same way:

failed to renew lease ... context deadline exceeded
leader election lost

It was the same shared root disk. During a stall, API server p99 latency rose from about 0.3 seconds to between 5 and 17 seconds on all three control-plane nodes at once. etcd logged hundreds of apply request took too long warnings an hour (the worst was 3.2 seconds) and an occasional slow fdatasync (the worst was 2.2 seconds). The root disks averaged 27% to 48% busy and went over 85% during stalls.

RKE2 binds etcd’s metrics port to localhost, so Prometheus couldn’t scrape it until I exposed it on 20 November. The etcd FAQ says p99 WAL fsync should be under 10 ms. On rackmount-a and -b, the PERC H730’s write cache answers a typical fsync in 0.6 ms. Under the databases’ steady 20 MB/s of writes, though, about 1 in 300 took over 128 ms, and the worst took 1.2 seconds. rackmount-d has no cache in front of its Samsung 870 SSD and ran at 4 ms p50 and 58 ms p99. It was also the etcd leader, and every write in the cluster waits for the leader’s fsync.

This changes how I read the 5 November outage. The disk was probably already stalling etcd before any runners arrived, and the three dind builds added to it. I can’t show that for 5 November, because etcd wasn’t being scraped yet.

On 24 November rackmount-a went NotReady again, for 10 minutes, with no runners on it. I/O pressure reached about 40% and write latency on its root disk went from 0.3 ms to 96 ms. SMART still reported the disks as healthy. The root disk turned out to be a RAID0 of two Samsung 870 QVO drives, about 44% worn. QVOs use QLC flash, which slows down sharply once the fast cache in front of it fills. Latency jumping that far under steady writes, with the drives otherwise healthy, fits that explanation better than anything else I found. The 44% wear figure doesn’t prove it by itself, and I haven’t ruled out the RAID card.

I alert on I/O pressure now, not write latency

Nothing alerted on that stall. I added a SMART exporter on every node, alerts for wear and failing drives, and this rule:

- alert: NodeDiskIOStalled
  expr: |
    rate(node_pressure_io_stalled_seconds_total[5m]) * on (instance) group_left (nodename) node_uname_info > 0.2
  for: 5m

node_pressure_io_stalled_seconds_total is the kernel’s PSI “full” counter for I/O: the time when every non-idle task on the node was waiting on I/O at once. Above 0.2 for five minutes means the node spent over a fifth of that time doing nothing but waiting for the disk.

I back-tested it over 10 to 24 November. It would have fired four times: rackmount-a on 18, 20 and 24 November, and compute-b on 21 November. An alert on write latency above 50 ms would have fired 58 times, mostly for compute-b’s NVMe drive doing normal CI work. High write latency on its own often means the disk is busy. PSI only climbs when the node is actually waiting on that disk.

The disk fix is planned but none of it has started. On rackmount-a and -b the database volumes move to an mdadm RAID1 of two spare SSDs. etcd stays on the PERC virtual disk and gets the write cache to itself. rackmount-d gets a small enterprise SSD with power-loss protection, used only for etcd.

Where things stand

Before 4 Nov4 to 9 Nov9 to 10 NovNow
ds160 maxRunners10303030
Runner requestsnone2 CPU, 4 GiB1 CPU, 4 GiB1 CPU, 6 GiB
Placementany node but compute-a, prefers compute-bprefers compute-b, spread, 1 per rackmountcompute-b onlycompute-b only
Most runners on compute-bno capabout 7, then 4 and 5 with the pause podabout 13about 8
Memory reserved on compute-bnonenonenone3 GiB plus a 2 GiB eviction threshold

Build times are for successful runs of ds160’s web-app build-and-push workflow, start to finish, including time spent waiting for a runner:

Week ofRunsMedianp90
5 Oct547.7 min10.9 min
26 Oct4914.6 min16.8 min
2 Nov11115.1 min26.1 min
9 Nov12117.9 min32.3 min
30 Nov4115.0 min20.5 min

The “about 8 minutes on compute-b” figure from earlier was a single build job, not a whole run. Whole runs had already doubled in October, before any of these changes, and spreading runners onto the rackmounts made the slow tail worse. Now that runners are pinned to compute-b, the p90 is down to 20.5 minutes, but the median is no better than before 4 November.

Still open:

  • Build memory isn’t charged to the runner pods, and I haven’t confirmed why. Until I do, the eviction threshold on compute-b is untested and may pick the wrong pods.
  • Only compute-b has reserved memory. compute-a and the rackmounts still run with nothing reserved and no memory eviction threshold.
  • The etcd disk work hasn’t started, so etcd on the rackmounts still shares its disk with about 45 database volumes.