Skip to content

fix(chart): pin the edge Envoy's worker count; give install-supervisor a request and no CPU limit (#1344) - #1354

Merged
bpalermo merged 2 commits into
mainfrom
fix/1344-edge-concurrency-install-supervisor-resources
Oct 7, 2026
Merged

bpalermo merged 2 commits into
mainfrom
fix/1344-edge-concurrency-install-supervisor-resources

Conversation

@bpalermo

@bpalermo bpalermo commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Closes #1344. Written by an agent (Claude Code). Chart only, no Go change. Chart aether 2.4.12 → 2.4.13.

What changes

1. The edge Envoy gets a fixed worker count. New value edge.concurrency, default 2, the same shape and validation as proxy.concurrency: N > 0 passes --concurrency N, 0 passes no flag (one worker per node core, what every earlier chart did), a negative or non-integer value fails the render. The edge runs Envoy directly as the container's command (no hot-restart supervisor), so the flag is two plain entries on that command line; there is only ever one epoch.

2. install-supervisor gets resources. New value proxy.supervisor.resources, rendered through the aether.resources helper: requests 100m CPU / 32Mi memory, limit 64Mi memory, no CPU limit.

Containers changed: the edge Deployment's envoy container (command) and the proxy DaemonSet's install-supervisor init container (resources). Nothing else. I looked for a sibling: the edge pod has no init container, and install-supervisor was the only container in a default or edge-enabled render without a resources block (cni-install, authz, uds-csi, the webhook-injected identity-ready all had one already).

Rendered, before → after

Default values (helm template, main's chart vs this branch, generated webhook certificates aside) — the only difference:

           volumeMounts:
             - name: supervisor-bin
               mountPath: /opt/aether
+          resources:
+            limits:
+              memory: 64Mi
+            requests:
+              cpu: 100m
+              memory: 32Mi
       containers:
         - name: proxy

Talos-like values (edge.enabled=true, proxy.concurrency=2, 2 edge replicas) — the same hunk, plus:

             - "aether-edge"
             - "--service-node"
             - "$(POD_NAME)"
+            - "--concurrency"
+            - "2"
           env:

With edge.concurrency=0 the edge Deployment renders byte-identical to main's. The node proxy's --envoy-arg=--concurrency / --envoy-arg=2 lines are unchanged.

Why these numbers

  • edge.concurrency: 2 — the count the node proxies run with on talos-main since proxy: a multi-second node-local stall at the parent's 'closing and draining listeners' during some hot-restart handoffs (1 liveness timeout in the 2026-10-01 soak, not #1085) #1093 (decided in the issue thread's brief). Measured today on talos-main, read-only: both edge replicas report envoy_server_concurrency = 4 (4-core nodes) and the envoy container used 14m of CPU each over the last hour.
  • 100m / 32Mi request — cni-install's request, the other init container in this chart that does one short burst on every pod start. An init container's request only counts toward the pod's effective request where it exceeds the app containers' sum (the proxy's 500m / 512Mi), so it reserves nothing extra on a node; it is the container's CFS weight while it runs, and it now shows up in request accounting.
  • No CPU limit — a quota is what stretched cni-install's 50–80 ms of work to 500–800 ms (chart: cni-install init container has a 100m CPU limit — it runs on every agent pod start #1335).
  • 64Mi memory limit — a backstop at about 4× the measured peak. Measured on a workstation fastbuild of //agent/cmd/proxy-supervisor (16.4 MB), --install-path onto ext4, five runs: max RSS 14.1–14.6 MB, 0.05–0.06 s wall, ~0.04–0.05 s CPU; it also completed in a memory cgroup capped at 32M, 16M and 8M (systemd-run --scope -p MemoryMax=…).
  • No GOMAXPROCS pin on install-supervisor: single-threaded copy, exits within the second (same call as cni-install).

Tests, red first

Added to charts/aether/BUILD.bazel and run against the unchanged chart before any template edit: Executed 89 out of 89 tests: 82 tests pass and 7 fail locally.

Test Against main's templates
aether_edge_concurrency_test (default → --concurrency 2) red: The file aether/templates/edge-deployment.yaml does not contain the pattern: - "--service-node"\n\s+- "\$\(POD_NAME\)"\n\s+- "--concurrency"\n\s+- "2"\n\s+env:\n
aether_edge_concurrency_override_test (=4) red, same kind
aether_edge_concurrency_invalid_test (=-1) red: FAIL: expected 'helm template' to be rejected, but it rendered successfully.
aether_install_supervisor_resources_test red: The file aether/templates/agent-proxy-daemonset.yaml does not contain the pattern: - name: supervisor-bin\n\s+mountPath: /opt/aether\n\s+resources:\n\s+limits:\n\s+memory: 64Mi…
aether_install_supervisor_empty_cpu_limit_test (limits.cpu= renders no limit) red, same kind
aether_install_supervisor_resources_override_test red, same kind
aether_install_supervisor_resources_with_authz_test red — see the note below
aether_edge_concurrency_off_test (=0 → no flag) green before and after: it describes the old behaviour
aether_edge_concurrency_leaves_proxy_alone_test (guard) green before and after, by design

Note on the authz test: its first red was for the wrong reason (I had left out proxy.authzSidecar.opa.policy, so the render itself failed). After fixing the options I put main's agent-proxy-daemonset.yaml back and ran it again: red with does not contain the pattern, then green with the change.

After the change: bazel test //charts/... → 98 tests pass. bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //... and make format-check are clean.

On upgrade

Measure after a deploy (also in docs/runbook.md, "Edge Envoy worker count"):

envoy_server_concurrency{job="aether-edge-proxy"}     # 4 per replica today on talos-main; 2 after
kubectl get ds -n aether-system aether-proxy \
  -o jsonpath='{.spec.template.spec.initContainers[0].resources}{"\n"}'

Measured vs inferred, and not verified

  • Measured: the render diffs above; the supervisor self-copy's CPU, RSS and behaviour under a memory cap (workstation, fastbuild binary, not the released image); today's edge worker count and CPU on talos-main.
  • Inferred: that 2 workers are ample for the edge (from 14m of CPU on a lightly loaded cluster; not load-tested), and that fewer workers save memory and idle wake-ups (not measured).
  • Not verified: nothing was deployed. The edge was not run with --concurrency 2 on kind or talos-main, and install-supervisor was not run under the 64Mi limit in a real pod (containerd, the pod's emptyDir).

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…r a request (#1344)

The edge `envoy` container was started without --concurrency, so it ran one
worker per node core. New value edge.concurrency (default 2, 0 omits the flag),
the same shape and validation as proxy.concurrency, rendered straight onto the
container's command: the edge runs Envoy directly, with no supervisor.

The proxy pod's install-supervisor init container rendered no resources at all.
New value proxy.supervisor.resources (requests 100m / 32Mi, limits memory 64Mi,
no CPU limit), rendered through the aether.resources helper.

Chart 2.4.13.

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.

🟡 Changes recommended

Boolean concurrency values bypass the documented integer validation, and the runbook contains an inaccurate capacity comparison.

2 open findings
What changed in this PR

Pins edge Envoy worker concurrency and adds resource controls for the proxy supervisor init container.

Changes:

  • Adds configurable edge.concurrency, defaulting to 2.
  • Adds requests and a memory limit for install-supervisor.
  • Updates chart tests, documentation, and version to 2.4.13.
File Description
charts/​aether/​Chart.yaml Bumps chart version.
charts/​aether/​values.yaml Adds concurrency and supervisor resource defaults.
charts/​aether/​templates/​_helpers.tpl Shares concurrency validation.
charts/​aether/​templates/​edge-deployment.yaml Passes edge concurrency to Envoy.
charts/​aether/​templates/​agent-proxy-daemonset.yaml Renders supervisor resources.
charts/​aether/​BUILD.bazel Adds Helm rendering tests.
docs/​configuration.md Documents new values.
docs/​runbook.md Adds operational guidance.

🧠 Review effort: Balanced


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

Comment thread charts/aether/templates/_helpers.tpl Resolved
Comment thread docs/runbook.md Resolved
… correct the runbook's headroom figure

Review on #1354. 'default 0' read false and the empty string as unset, so
a mistyped edge.concurrency or proxy.concurrency silently became one worker
per core. Only null reads as 0 now. Two render-failure tests, seen failing
without the helper change. 2 cores against 12m is about 167x, not 1,000x.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
Copilot AI balanced review requested due to automatic review settings October 7, 2026 19:38

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, validation, tests, version bump, and operational documentation are consistent and complete.

0 open findings

2 resolved since last review

🧠 Review effort: Balanced

@bpalermo
bpalermo merged commit b16c774 into main Oct 7, 2026
31 checks passed
@bpalermo
bpalermo deleted the fix/1344-edge-concurrency-install-supervisor-resources branch October 7, 2026 20:34
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: the edge Envoy takes no --concurrency (workers follow the node's cores); install-supervisor has no resource requests

2 participants