Skip to content

hetzner-mgmt pod placement: a worker without agents or CI runners (2026-11)

Kind: reference (measurement and placement, task #2676)

worker-1 stalled five times from 2026-11-04 to 11-07, each time on memory while a container agent and a CI runner pod grew past their requests (roll-up report). The first stall (11-04 13:57) broke nothing downstream: Flux's controllers, the CNPG operator, Alertmanager and gitea-postgresql-0 were on worker-3. After the worker-3 stall of 11-04 17:17 (#2490) they all landed on worker-1, and every stall since took Gitea down for 1–4 minutes and froze Flux. This page keeps the pods whose loss freezes the platform on one worker that runs neither, and the agents and CI runners on the other two.

The two groups

Platform core: a single pod each, whose loss freezes the platform. They prefer worker-2.

Pod Why Where it is set
Flux source-controller, kustomize-controller, helm-controller, notification-controller No reconcile, ArtifactFailed, no failure events to Taskbase cluster/hetzner-mgmt/flux/kustomization.yaml (flux2 values)
gitea and gitea-postgresql-0 Every agent run, CI job and Flux source needs Gitea cluster/hetzner-mgmt/gitea/kustomization.yaml (affinity, postgresql.primary.affinity)
alertmanager-…-0 A stall must not silence the alerts about it cluster/hetzner-mgmt/prometheus-stack/manifests/kustomization.yaml (alertmanagerSpec.affinity)

The CNPG operator is not in the list: it runs two replicas spread over two workers (#2634). The Barman Cloud plugin prefers any worker but worker-1 (#2661), which includes worker-2.

Growers: pods whose request is well below what they use while working. The CI runners prefer any worker but worker-2; the container agents never run there (#2992).

Pod Request Limit Working set, max over 7 days
gitea-act-runner (×2, one per worker) 2208Mi (with the 32Mi act-cache sidecar, #2674) 6400Mi 4209Mi
miki-container-agent 512Mi idle, 1Gi in a run (+64Mi sidecar) 4Gi 4108Mi
emilia-container-agent 512Mi idle, 1536Mi in a run (+64Mi sidecar) 4Gi 3394Mi

The agents never share a worker (#1813, required since #2999). agent-runner-probe is a blackbox exporter (22Mi) and not a grower.

The core pods' rule and the CI runners' rule are preferredDuringSchedulingIgnoredDuringExecution on kubernetes.io/hostname, weight 100, like #2661. Preferred, so a pod still schedules elsewhere when worker-2 is down or full, and a runner still lands on worker-2 when worker-1 and worker-3 are. Neither moves a running pod: a pod that landed on the wrong worker stays until it restarts.

The agents' rules are requiredDuringSchedulingIgnoredDuringExecution: NotIn worker-2 (#2992) and an anti-affinity against the other agent on kubernetes.io/hostname (#2999), in cluster/hetzner-mgmt/agent-runners/*-container-agent/helm-release.yaml. So each of worker-1 and worker-3 runs exactly one agent, either one.

Why the agents' rule is required

On 2026-11-12 14:10 worker-3 evicted emilia-container-agent for memory (#2884). worker-3 had MemoryPressure, so the replacement could go to worker-1, where miki runs, or worker-2. Both of emilia's preferences then failed once each: the anti-affinity against worker-1 and NotIn worker-2 against worker-2. The scheduler chose worker-2, and emilia stayed there 43 hours with the core pods (worker-2 at 92 % requested, a run's grow Deferred).

A higher weight on NotIn worker-2 would not have changed that. The scheduler scores node affinity and pod affinity in separate plugins, and each scales its result to 0–100 over the candidate nodes before adding them up. With one term in each, the node that meets the term gets 100 and the other 0, whatever the weight; both plugins have weight 2 in the default profile, which hetzner-mgmt's scheduler runs (Talos, no custom profile). So worker-1 and worker-2 tie and the resource scores decide, and 100 is the highest weight anyway. Only a required rule keeps an agent off worker-2.

What it costs:

  • worker-1 or worker-3 down, drained or under MemoryPressure. The agent on it has nowhere else to go: worker-2 is excluded and the other worker runs the other agent. A replacement stays Pending until its worker takes pods again, and that agent's runs wait; nothing of the platform does. After a memory eviction that is the MemoryPressure taint, 5–8 minutes (below). A worker NotReady for more than 5 minutes (the pods' default tolerationSeconds) or drained for a Talos upgrade (2–5 minutes a node, after the agent's up to 30-minute grace) keeps it off for as long. A worker lost for good keeps the agent off until a person changes these rules or the worker is back; KubePodNotReady fires after 15 minutes Pending and raises the incident.
  • A third container agent on hetzner-mgmt has no worker and stays Pending: it needs a fourth worker, or a change here first.
  • worker-2 cordoned or drained (a Talos upgrade, #2409's node work). No agent runs there, so nothing of theirs moves. The core pods move to worker-1 and worker-3 next to the agents until worker-2 is back and they restart; the agents do not keep them out.
  • Taking worker-2 back for agents (worker-1 or worker-3 removed, or worker-2 freed of the core pods) needs a change here first: an agent will not go to worker-2 on its own.

Why the agents' anti-affinity is required

Until #2999 the agents only preferred a worker without the other agent. A memory eviction sets MemoryPressure on the evicting worker, so the replacement went to the only other worker allowed, next to the other agent, and stayed there after the taint cleared (IgnoredDuringExecution). While the two shared a worker, the second of two concurrent grows was Deferred, and the moved agent's heavy runs were evicted sooner where less memory was free: on 2026-11-14 miki was evicted on worker-1 at 12:59, replaced on worker-3 next to emilia, and evicted there at 13:13 with emilia idle; its third replacement, at 13:30, stacked on worker-3 again and stayed (#2995).

2996 added a manual move to the PodEvicted runbook, which ran only when an operator run worked the

alert, and only while the agent was idle.

Two ways to move it back without a person or a run were weighed (#2999):

  • Required anti-affinity (chosen). The agents can no longer stack, so there is nothing to move back: the replacement waits Pending for the evicting worker's taint and returns there. Measured from kube_node_status_condition and kube_node_spec_unschedulable over 11-03 to 11-14 (30 s samples):

    Worker MemoryPressure episodes Length NotReady episodes Cordoned
    worker-1 11 5 minutes each 5, 1–4 minutes never
    worker-3 29 5–8 minutes 2, 2 and 5 minutes never

    So an evicted agent is off for 5–8 minutes before it comes back, against hours stacked (miki was still next to emilia on worker-3 at 14:05, 35 minutes after its last eviction). The eviction has already ended its run, so the wait loses no run; queued tasks start a few minutes later. No NotReady lasted past the 5-minute toleration, so none moved an agent, and no worker was drained: the cost of a worker outage (above) has not come up yet. - A descheduler, rejected. Its RemovePodsViolatingInterPodAntiAffinity acts only on required rules, which already keep the agents apart at scheduling; it has no strategy for a preferred inter-pod rule. And it cannot tell an idle agent from one in a run (list_runners, /data/state.json): it would evict a running agent, and its run gets at most the 25-minute shutdown_grace. Making it see idleness (a label the resizer sets, matched by a descheduler labelSelector) is a new component, new code in the chart and still a race with a run claimed between the check and the eviction.

The CI runners keep a preference. Their spread (DoNotSchedule, one per worker) is a filter, not a score, and no runner pod has run on worker-2 since the merge, through 23 evictions: worker-2 has no room for a runner's 2208Mi request.

Why worker-2

On 2026-11-07 every worker ran a grower: worker-1 miki-container-agent and a runner, worker-2 emilia-container-agent, worker-3 a runner. With two runners (one per worker) and two agents on three workers, a worker without growers means an agent next to each runner. worker-2 needs the fewest moves: emilia leaves it, and the runners stay where they are.

Requested memory (allocatable 7245Mi per worker), 2026-11-07 08:40 UTC and after the moves:

Worker Now After Change
worker-1 5626Mi (77 %) 4882Mi (67 %) gitea-postgresql-0 512Mi, Alertmanager 104Mi, source- and helm-controller 2×64Mi leave
worker-2 5870Mi (81 %) 6038Mi (83 %) those arrive; emilia (576Mi idle) leaves
worker-3 5126Mi (70 %) 5702Mi (79 %) emilia arrives; 6726Mi (93 %) while it runs

worker-2 stays the most requested (#2409: no new capacity), but its usage falls: the core pods' working set is ~520Mi together (Prometheus container_memory_working_set_bytes), against emilia's 3394Mi peak that leaves. worker-2's MemAvailable was at least 379Mi over the 7 days to 11-07.

What it costs. worker-3 now carries an agent next to a runner, as worker-1 does: their peaks (3394Mi and 4209Mi) together are above the worker's memory, so worker-3 can stall like worker-1. A stall there now takes Keycloak, Mattermost and the Harbor database down for its length, not Flux or Gitea. A runner rollout's new pod (maxSurge: 0) took the free worker before; now it prefers the draining pod's worker and waits for the drain when that worker has no room (worker-2 has 1207Mi free, less than a runner's 2208Mi).

Rollout

The merge restarts every pod above: Flux's four controllers (an upgrade of flux2), gitea and gitea-postgresql-0, Alertmanager, both agents and both runners. gitea-postgresql-0 moves its RWO hcloud volume from worker-1 to worker-2, and Gitea is down while it does, so the pull request is merged drained (drain-before-merge, Renovate ADR §9 step 9), like #2557. Alertmanager keeps no volume: a move drops its silences and notification log, so check that no silence is active first.

2992's change to the agents' affinity restarts both agents (Recreate) when Flux applies it, and

ends a run in progress on either. It also moves emilia off worker-2, so no separate restart is needed. Merge it while both agents are idle.

2999's required anti-affinity restarts both agents the same way, and places them on worker-1 and

worker-3, one each, whichever was where before. Merge it while both agents are idle (list_runners: runs_in_progress 0 and no session_turns_running for both).

Check

Where the core pods and the growers run; no worker should have both. A container-agent pod on worker-2 is an error since #2992, and two on one worker since #2999; an Evicted or ContainerStatusUnknown pod left on a worker does not run and is not a match (kube_pod_info counts it too until it is deleted):

kubectl --context admin@mgmt-cluster get pods -A -o custom-columns=NS:.metadata.namespace,POD:.metadata.name,NODE:.spec.nodeName \
  | grep -E 'source-controller|kustomize-controller|helm-controller|notification-controller|gitea-[0-9a-f]+-|gitea-postgresql-0|alertmanager-monitoring|container-agent|gitea-act-runner'

The same from kube_pod_info: a worker that has both returns a row (on 2026-11-07, before the merge: worker-1 with 4 core pods, worker-2 with 3).

count by (node) (kube_pod_info{pod=~"source-controller.*|helm-controller.*|kustomize-controller.*|notification-controller.*|gitea-[0-9a-f]+-[a-z0-9]+|gitea-postgresql-0|alertmanager-monitoring.*"})
  and on (node)
count by (node) (kube_pod_info{pod=~".*-container-agent-.*|gitea-act-runner-.*"})

After the merge

Measured on 2026-11-14 09:15 UTC over the 6.8 days since the merge (2026-11-07 14:20), with the Check above, kube_pod_info, kube_pod_status_ready, kube_pod_status_reason, kube_node_status_condition, probe_success and the raw node_memory_MemAvailable_bytes samples (task #2680). All read-only, through the Prometheus Service proxy of admin@mgmt-cluster.

Placement. The rollout put every core pod on worker-2 by 14:31; none has run anywhere else since. A worker held both groups three times:

Worker From To Why
worker-1, worker-3, worker-2 11-07 14:21 14:31 The rollout: core pods and growers moving (11, 5 and 7 minutes)
worker-2 11-12 14:11 still on 11-14 09:15 (43 h) worker-3 evicted emilia-container-agent for memory (report, #2884). worker-3 had MemoryPressure 14:11–14:15 and took no new pod; worker-1 runs miki, which emilia's anti-affinity avoids, and worker-2 is the one emilia's node affinity avoids, both at weight 100. The scheduler chose worker-2, and a preferred rule does not move the pod back

No CI runner pod ran on worker-2: neither the rollouts of #2683, #2803, #2804 and #2931 nor the 23 replacements of evicted runner pods. The second row is more than a rollout: #2992 makes the agents' NotIn worker-2 required (why), and its rollout moves emilia back.

Stalls. One, on worker-3, and none on worker-1 or worker-2 (gaps over 60 s in node-exporter's 30 s samples):

Worker Day Longest gap MemAvailable min
worker-3 11-11 210 s from 12:07:46 399Mi, at the stall
worker-1 — none 324Mi (11-08 16:04)
worker-2 — none 1795Mi (11-12 15:23)

worker-3 did not go NotReady. Down with the stall, from kube_pod_status_ready and the probes:

  • Keycloak: keycloak-0 and keycloak-db-1 not Ready 12:09:30–12:12:15; probe failing 12:08:30–12:11:15.
  • Mattermost: mattermost-db-1 not Ready 12:08:30–12:12:15, the server 12:09:30–12:11:45. Its probe also failed on and off from 11:54 to 12:33, so not only because of the stall.
  • Harbor: harbor-database-0, core and registry not Ready 12:09:30–12:11:45.
  • Not on this page's list before: Taskbase prod (platform-tasks-api, -mcp, -ui on worker-3) not Ready 12:09:30–12:11:45, /api/health failing 12:08:45–12:11:30; and tasks-dev/tasks-db-1.
  • Every external probe, Gitea, OpenBao and the docs included, failed 12:08:30–12:09:15 (45 s), though none of their pods is on worker-3. worker-3 runs one of the two CoreDNS pods, a cilium-envoy and a MetalLB speaker; which of them broke the path was not determined.
  • No core pod restarted. worker-3's runner pod was not Ready 12:09:30–12:11:15.

The stall came before the kubelet's soft eviction at 2Gi reached worker-3 (#2543, 11-11 19:10). From then on the workers evicted instead of stalling: 24 evictions, 19 on worker-3 (18 runner pods and emilia) and 5 on worker-1 (runner pods), none on worker-2 (report, decision #2898).

Against worker-1 before. worker-1 stalled five times in the three days before the merge, for 2–5 minutes, and from the second time on took Gitea down for 1–4 minutes and Flux for up to 24 (roll-up). worker-3 stalled once in a week, for 3.5 minutes, and took Keycloak, Mattermost, Harbor and Taskbase down for about 3 minutes and the external path for 45 s, but no Gitea pod and no Flux controller. That is less than worker-1's stalls cost, so the stall cost needs no next step. Taskbase prod on worker-3 is worth knowing: a worker-3 stall stops agent runs reaching Taskbase for its length.

worker-2. Requested memory (allocatable 7245Mi), from kube_pod_container_resource_requests of Running pods:

Period Requested
11-07 14:31 – 11-11 ~10:00 6470Mi (89 %), not the 6038Mi this page expected
11-11 – 11-12 14:10 6118–6214Mi (84–86 %)
11-12 14:11 on, emilia idle 6630–6662Mi (92 %)
11-12 15:18–15:29, emilia in a run 7686Mi (106 %) in the pods' specs

The last row is above allocatable, so emilia's grow to 1536Mi for its run could not be granted and was Deferred, as #2884's report expected: its run went on with the 512Mi idle request. MemAvailable on worker-2 was at least 3073Mi until emilia arrived (379Mi in the 7 days before the merge), and 1795Mi with it, below the 2Gi soft-eviction threshold, though worker-2 evicted nothing.