You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gha-runner-scale-set: no working way to protect in-flight jobs from node drain / cloud node auto-upgrade (PDBs non-functional, safe-to-evict doesn't apply to drains) #4618
A cloud node auto-upgrade (AKS) cordoned + drained the nodes running our gha-runner-scale-set runners mid-job. In-flight jobs died with ##[error]The runner has received a shutdown signal. A node drain is a voluntary eviction, so the expected protection is a PodDisruptionBudget — but there is currently no working pod-level mechanism to protect a busy ARC v2 runner from a drain:
PDBs are non-functional on ARC v2. The runner pod's controller owner is the per-pod EphemeralRunner CR, which implements only a status subresource, no scale. The K8s disruption controller resolves budgets via the pod's direct owner's scale subresource, can't find one, and marks the PDB SyncFailed (currentHealthy: 0, expectedPods: 0). Confirmed on controller 0.14.2 and still true on master (EphemeralRunner CRD subresources: {status: {}}). This was raised in Add scale subresource to EphemeralRunnerSet CRD for PDB compatibility #4493 and closed as architecturally won't-fix.
cluster-autoscaler.kubernetes.io/safe-to-evict and karpenter.sh/do-not-disrupt don't help — they're honored only by the Cluster Autoscaler / Karpenter when choosing to remove a node, not by kubectl drain or a cloud node auto-upgrade drain, which go through the eviction API and honor only PDBs. Add ability to add annotations to Runner Pods once they start running a job #2562 (busy-annotation request) is therefore CA-scoped and doesn't cover this.
Net: for the very common case of managed node auto-upgrade (AKS/EKS/GKE), there is no supported way to let a busy runner finish its job before its node is drained.
What I'd like
A supported mechanism to protect busy runners from voluntary node disruption. Options, roughly in order of preference:
Make PDBs work — give EphemeralRunner a scale subresource (reporting 1/1), or reparent runner pods to a set-level owner (EphemeralRunnerSet) that has one, so a standard PodDisruptionBudget can protect runner pods. This is the cleanest fit with how drains already work. (Reconsider Add scale subresource to EphemeralRunnerSet CRD for PDB compatibility #4493 with the node-drain use case, not just the API-compat framing.)
Native busy marker + graceful drain — controller sets a configurable label/annotation when a job lands and clears it on completion (Add ability to add annotations to Runner Pods once they start running a job #2562), and on receiving SIGTERM from a drain the runner finishes (or re-queues) the current job within terminationGracePeriodSeconds instead of dying immediately.
At minimum, document that ARC v2 runners cannot be protected from node drains and that the only mitigation is at the infrastructure layer (maintenance windows / controlled upgrade cadence).
Related: #4493 (PDB scale subresource, closed won't-fix), #2562 (busy annotations for CA), #4148 (EphemeralRunner stuck Running after node drain).
aandreev-akamai created an issue (actions/actions-runner-controller#4618)
What happened / the gap
A cloud node auto-upgrade (AKS) cordoned + drained the nodes running our gha-runner-scale-set runners mid-job. In-flight jobs died with ##[error]The runner has received a shutdown signal. A node drain is a voluntary eviction, so the expected protection is a PodDisruptionBudget — but there is currently no working pod-level mechanism to protect a busy ARC v2 runner from a drain:
1. PDBs are non-functional on ARC v2. The runner pod's controller owner is the per-pod EphemeralRunner CR, which implements only a status subresource, no scale. The K8s disruption controller resolves budgets via the pod's direct owner's scale subresource, can't find one, and marks the PDB SyncFailed (currentHealthy: 0, expectedPods: 0). Confirmed on controller 0.14.2 and still true on master (EphemeralRunner CRD subresources: {status: {}}). This was raised in #4493 and closed as architecturally won't-fix.
2. cluster-autoscaler.kubernetes.io/safe-to-evict and karpenter.sh/do-not-disrupt don't help — they're honored only by the Cluster Autoscaler / Karpenter when choosing to remove a node, not by kubectl drain or a cloud node auto-upgrade drain, which go through the eviction API and honor only PDBs. #2562 (busy-annotation request) is therefore CA-scoped and doesn't cover this.
Net: for the very common case of managed node auto-upgrade (AKS/EKS/GKE), there is no supported way to let a busy runner finish its job before its node is drained.
What I'd like
A supported mechanism to protect busy runners from voluntary node disruption. Options, roughly in order of preference:
1. Make PDBs work — give EphemeralRunner a scale subresource (reporting 1/1), or reparent runner pods to a set-level owner (EphemeralRunnerSet) that has one, so a standard PodDisruptionBudget can protect runner pods. This is the cleanest fit with how drains already work. (Reconsider #4493 with the node-drain use case, not just the API-compat framing.)
2. Native busy marker + graceful drain — controller sets a configurable label/annotation when a job lands and clears it on completion (#2562), and on receiving SIGTERM from a drain the runner finishes (or re-queues) the current job within terminationGracePeriodSeconds instead of dying immediately.
3. At minimum, document that ARC v2 runners cannot be protected from node drains and that the only mitigation is at the infrastructure layer (maintenance windows / controlled upgrade cadence).
Related: #4493 (PDB scale subresource, closed won't-fix), #2562 (busy annotations for CA), #4148 (EphemeralRunner stuck Running after node drain).
Environment
• gha-runner-scale-set / gha-runner-scale-set-controller 0.14.2
• AKS, node auto-upgrade (drain via eviction API)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
Following up with more detail, and I'd like to contribute this. Per CONTRIBUTING.md I'm signalling intent here before opening a PR.
Why this needs a decision
The only prior report of the PDB problem, #4493, was closed by its reporter (who switched to safe-to-evict), not by a maintainer. safe-to-evict is only honored by the Cluster Autoscaler. Managed node auto-upgrade (AKS/EKS/GKE) and kubectl drain use the eviction API and honor only PDBs. In our case an AKS auto-upgrade drain killed in-flight jobs with The runner has received a shutdown signal.
Root cause
A PDB selecting runner pods of a gha-runner-scale-set (controller 0.14.2) reports SyncFailed with expectedPods: 0, currentHealthy: 0. The pods' controller owner is an EphemeralRunner, whose CRD declares only subresources: {status: {}}. The disruption controller resolves expected pods through the owner's scale subresource and can't find one.
Proposal (two small parts)
scale subresource on EphemeralRunner. Add spec.replicas and status.replicas, both fixed at 1 (enum 1 on spec so kubectl scale is rejected). Existing objects pick up the default on read, so no migration is needed.
Busy marker on the pod. The EphemeralRunner controller sets actions.github.com/runner-busy: "true" on the runner pod once a job is assigned. Runner pods are single-use, so the label is never removed. Users can then create a PDB that selects only busy runners:
I have a working implementation and have verified it:
On a kind cluster, with the new CRD a busy pod's eviction is rejected (TooManyRequests) while an idle pod's eviction succeeds, and the PDB no longer reports SyncFailed.
A new envtest spec covers the busy label, and the existing envtest suite passes (187/187).
Chart tests pass.
Things to be aware of
The controller needs patch on pods, so the gha-runner-scale-set manager Role gains that verb. The scale-set chart must be upgraded along with the controller.
spec.replicas is part of the shared EphemeralRunnerSpec, which the EphemeralRunnerSet template embeds. The CRD default would otherwise make the stored template differ from the desired one and trigger a spurious revision bump (idle runners deleted), so the builder sets replicas: 1 explicitly.
There is a short window between job assignment and the controller labelling the pod where the runner is still evictable.
If there is no appetite for this, a documentation note saying ARC v2 runners cannot be protected from node drains would still help people on managed Kubernetes.
Activity
github-actions commentedon Sep 3, 2026
Hello! Thank you for filing an issue.
The maintainers will triage your issue shortly.
In the meantime, please take a look at the troubleshooting guide for bug reports.
If this is a feature request, please review our contribution guidelines.
humh25 commentedon Sep 3, 2026
github-actions commentedon Oct 4, 2026
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
aandreev-akamai commentedon Oct 9, 2026
Following up with more detail, and I'd like to contribute this. Per CONTRIBUTING.md I'm signalling intent here before opening a PR.
Why this needs a decision
The only prior report of the PDB problem, #4493, was closed by its reporter (who switched to
safe-to-evict), not by a maintainer.safe-to-evictis only honored by the Cluster Autoscaler. Managed node auto-upgrade (AKS/EKS/GKE) andkubectl drainuse the eviction API and honor only PDBs. In our case an AKS auto-upgrade drain killed in-flight jobs withThe runner has received a shutdown signal.Root cause
A PDB selecting runner pods of a
gha-runner-scale-set(controller 0.14.2) reportsSyncFailedwithexpectedPods: 0, currentHealthy: 0. The pods' controller owner is anEphemeralRunner, whose CRD declares onlysubresources: {status: {}}. The disruption controller resolves expected pods through the owner'sscalesubresource and can't find one.Proposal (two small parts)
scalesubresource onEphemeralRunner. Addspec.replicasandstatus.replicas, both fixed at 1 (enum1on spec sokubectl scaleis rejected). Existing objects pick up the default on read, so no migration is needed.Busy marker on the pod. The EphemeralRunner controller sets
actions.github.com/runner-busy: "true"on the runner pod once a job is assigned. Runner pods are single-use, so the label is never removed. Users can then create a PDB that selects only busy runners:Idle runners stay evictable, so drains and upgrades are not blocked by idle capacity. This also covers the busy-marker part of Add ability to add annotations to Runner Pods once they start running a job #2562 in a form that works for eviction-API drains, not only the Cluster Autoscaler.
Status
I have a working implementation and have verified it:
TooManyRequests) while an idle pod's eviction succeeds, and the PDB no longer reportsSyncFailed.Things to be aware of
patchonpods, so thegha-runner-scale-setmanager Role gains that verb. The scale-set chart must be upgraded along with the controller.spec.replicasis part of the sharedEphemeralRunnerSpec, which theEphemeralRunnerSettemplate embeds. The CRD default would otherwise make the stored template differ from the desired one and trigger a spurious revision bump (idle runners deleted), so the builder setsreplicas: 1explicitly.If there is no appetite for this, a documentation note saying ARC v2 runners cannot be protected from node drains would still help people on managed Kubernetes.
github-actions commentedon Nov 10, 2026
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
aandreev-akamai commentedon Nov 24, 2026
@mumoshu @toast-gear @nikola-jokic @rentziass @Steve-Glass
Please take a look for it... and open PR for fix 4710