Skip to content

fix(chart): no CPU limit on the cni-install init container; pin the edge agent's GOMAXPROCS (#1335) - #1343

Merged
bpalermo merged 1 commit into
mainfrom
fix/1335-cni-install-cpu-limit
Oct 7, 2026
Merged

bpalermo merged 1 commit into
mainfrom
fix/1335-cni-install-cpu-limit

Conversation

@bpalermo

@bpalermo bpalermo commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Closes #1335

Measured first (talos-main, read-only)

cni-install CFS throttling: not readable from metrics. There is no container_cpu_cfs_* and no container_cpu_usage_seconds_total series for container="cni-install" (nor install-supervisor) in the 45 h cAdvisor has been scraped, eight agent rolls included — the cgroup lives for under a second and never meets a ~60 s scrape. kube-state-metrics exports only kube_pod_init_container_status_restarts_total (no ..._state_started yet). kubectl gives startedAt/finishedAt at 1 s resolution (all five live pods: 0–1 s) and no CPU time.

Wall time, from the installer's own log timestamps (VictoriaLogs, 48 h, 40 agent starts = 8 rolls × 5 nodes):

first log line → last
min / median / max 496 ms / 598 ms / 802 ms
"running CNI installer" → "already installed and unchanged" (the byte compare) 400–700 ms
every other gap between consecutive lines ~0–10 ms or ~90–100 ms

Every total is a multiple of ~100 ms and every gap is either nothing or a whole CFS period. That is the signature of a 100m quota (10 ms per 100 ms period) on a CPU burst: spend 10 ms, park until the next period. Five to eight periods bound the work at 50–80 ms of CPU (an inference, not a counter), so about half a second of every agent start was the quota. All 40 starts took #1123's "unchanged; not rewriting it" path; a start that rewrites the plugin was not in the sample.

What it does (cni/internal/install): Go start-up, a byte-for-byte compare of the plugin on the host against the image's, a few small conflist reads. No writes on that path.

Edge agent container (aether-ingress, 2 replicas, cAdvisor, 45 h): average 1.8m, busiest 5 minutes 4.4m. Live spec: no CPU limit, GOMEMLIMIT set, no GOMAXPROCS — so the Go runtime follows the node's core count.

Changed

Rendered, cni-install resources:

# before                 # after
limits:                  limits:
  cpu: 100m                memory: 32Mi
  memory: 32Mi           requests:
requests:                  cpu: 100m
  cpu: 100m                memory: 32Mi
  memory: 32Mi

Rendered, edge agent env: GOMEMLIMIT=241591910 before; GOMEMLIMIT=241591910, GOMAXPROCS="2" after.

Other init containers (reported, not changed)

  • install-supervisor (proxy pod): renders no resources at all — no limit, so nothing throttles it, but no request either (minimum CFS weight, invisible to request accounting). ≤ 1 s wall on talos-main.
  • authz native sidecar: 10m request, no CPU limit (deliberate, commented in values).
  • aether-identity-ready (webhook-injected): 5m request, limits.cpu: "" — no CPU limit.
  • Not an init container, same family: the edge envoy container takes no --concurrency, so its worker count follows the node's cores.

Tests

New helm_template_tests in charts/aether/BUILD.bazel. Run before the chart change: aether_cni_install_cpu_resources_test, aether_cni_install_empty_cpu_limit_test, aether_edge_gomaxprocs_test, aether_edge_gomaxprocs_override_test failed; aether_cni_install_cpu_limit_override_test and aether_edge_gomaxprocs_off_test passed (they assert what was already true). After: all pass.

  • bazel test //charts/... — 89 pass
  • bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //... — clean
  • make format-check — clean

Not verified: the post-change wall time on a cluster (nothing was applied; the runbook says so and gives the query).

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…dge agent's GOMAXPROCS (#1335)

cni-install runs ahead of the agent on every agent pod start with
request = limit = 100m CPU. Its work is one short CPU burst (Go start-up and
a byte compare of the plugin on the host against the image's), and a 100m
quota is 10 ms per 100 ms CFS period: on talos-main all 40 agent starts of
2026-10-05..07 took 496-802 ms from the installer's first log line to its
last (median 598 ms), always a multiple of ~100 ms, for at most 50-80 ms of
CPU. Inferred from log timestamps: a sub-second init container never meets a
60 s cAdvisor scrape, so there is no container_cpu_cfs_* series to read.

Keep the 100m request (the agent container's 200m is the pod's effective
request), drop limits.cpu, and render the block through aether.resources so
an empty limits.cpu means "no limit".

The edge pod's `agent` container has no CPU limit and had no GOMAXPROCS, so
its Go runtime sized itself to the node's cores. Pin it with edge.goMaxProcs
(default 2, the node agent's value from #1116; the container averages 1.8m).

Chart 2.4.11 -> 2.4.12.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The chart behavior, documentation, and focused rendering tests consistently implement the requested resource changes.

0 open findings

What changed in this PR

Removes CNI installer CPU throttling and bounds edge-agent runtime parallelism.

Changes:

  • Removes the default cni-install CPU limit while retaining requests and memory limits.
  • Adds configurable edge-agent GOMAXPROCS, defaulting to 2.
  • Adds Helm rendering tests, documentation, and chart version 2.4.12.
File Description
docs/​runbook.md Documents measurements and verification guidance.
docs/​configuration.md Updates CNI and edge configuration references.
charts/​aether/​values.yaml Changes resource defaults and adds edge.goMaxProcs.
charts/​aether/​templates/​edge-deployment.yaml Renders edge-agent GOMAXPROCS.
charts/​aether/​templates/​agent-daemonset.yaml Uses empty-resource filtering for CNI installation.
charts/​aether/​Chart.yaml Bumps the chart to 2.4.12.
charts/​aether/​BUILD.bazel Tests defaults, overrides, and disabled settings.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@bpalermo
bpalermo merged commit 77b0fcc into main Oct 7, 2026
31 checks passed
@bpalermo
bpalermo deleted the fix/1335-cni-install-cpu-limit branch October 7, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chart: cni-install init container has a 100m CPU limit — it runs on every agent pod start

2 participants