Skip to content

fix(chart): every container's resources render through aether.resources; document how to remove a default request or limit (#1355, #1357) - #1360

Merged
bpalermo merged 2 commits into
mainfrom
fix/chart-resources-helper-1355
Oct 7, 2026
Merged

bpalermo merged 2 commits into
mainfrom
fix/chart-resources-helper-1355

Conversation

@bpalermo

@bpalermo bpalermo commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Closes #1355
Closes #1357

Written by an agent (Claude Code).

What changes

Seven containers in charts/aether rendered their resources with plain toYaml. On those, emptying a quantity (--set <x>.resources.limits.cpu=) rendered cpu: "", which the apiserver rejects. They now render through the aether.resources helper, which drops an empty or null quantity.

I did not rely on the list in the issue. I rendered the chart with everything optional enabled (edge with TLS, admin, GeoIP and HTTP/3; the authz sidecar as the OPA preset and as a bring-your-own image; OTel; uds-csi; mesh-dns) and listed every container and init container. There are 11:

Workload Container Values key Before After
DaemonSet aether-agent agent agent.resources toYaml helper
DaemonSet aether-agent cni-install (init) cniInstall.resources helper unchanged
DaemonSet aether-proxy proxy proxy.resources toYaml helper
DaemonSet aether-proxy authz (native sidecar) proxy.authzSidecar.resources toYaml helper
DaemonSet aether-proxy install-supervisor (init) proxy.supervisor.resources helper unchanged
DaemonSet aether-mesh-dns mesh-dns agent.meshDnsDaemon.resources helper unchanged
DaemonSet aether-uds-csi uds-csi udsCsi.resources helper unchanged
Deployment aether-controller controller controller.resources toYaml helper
Deployment aether-registrar registrar registrar.resources toYaml helper
Deployment aether-edge agent edge.resources toYaml helper
Deployment aether-edge envoy edge.resources toYaml helper

The identity gate's init container is not in the chart's output: the controller's webhook builds it from four --identity-gate-* flags, which already pass an empty value through as "unset". Not touched.

docs/configuration.md gains one paragraph (a new "Resources" subsection at the top of the chart values) on how to remove a default request or limit. charts/README.md does not document resources, so it is unchanged.

Chart aether 2.4.13 -> 2.4.14. No Go change, no workflow change.

No default changes, so no GOMAXPROCS decision

This pull request changes no default value, so no container loses a CPU limit here and there is no GOMAXPROCS decision to make. One consequence for an operator is worth stating, and the new docs paragraph states it: emptying limits.cpu on the controller or the registrar used to produce a manifest the apiserver refused; it now produces a valid one, and those two containers take GOMAXPROCS from resourceFieldRef: limits.cpu, which follows the node's core count when there is no limit. Their defaults keep the limit for that reason.

Unchanged values render the same (measured)

Renders of origin/main (097f6ae) against this branch with the chart version set back to 2.4.13, Helm 3.18.4:

Scenario Lines Result
default values 2345 byte-identical
everything enabled, authz = OPA preset 3213 byte-identical
everything enabled, authz = bring-your-own image 3170 byte-identical

A caveat on "byte-identical": the chart generates a self-signed webhook CA and serving certificate on every render, so two renders of the same chart already differ in 6 lines (caBundle, tls.crt, tls.key, ca.crt). I compared two ways. With those four values masked, each scenario is identical. With controller.webhook.spire=true, which generates nothing, the raw files are identical under cmp (sha256 of the default render 924fc4b6… on both sides, all-enabled 47a3dfbc…, bring-your-own 9fdd7fbb…).

With the version bumped, the only differing lines are the helm.sh/chart: aether-2.4.13 -> aether-2.4.14 label (36 lines in the default render, 49 with everything enabled).

Whether pods roll. The template change itself changes no pod spec. But the chart puts the helm.sh/chart label on every pod template (6 workloads by default, 7 with the edge), so an upgrade to any new chart version, this one included, rolls every workload. That is how the chart behaves today for every release and is not something this pull request introduces; it is listed under "Noticed" below.

Emptied CPU limit, before and after (measured)

--set <key>.resources.limits.cpu= on all ten values keys at once, everything enabled:

origin/main this branch
lines reading cpu: "" 7 (the seven containers above) 0

Before, for example the controller:

          resources:
            limits:
              cpu: ""
              memory: 64Mi

After:

          resources:
            limits:
              memory: 64Mi
            requests:
              cpu: 50m
              memory: 64Mi

The same run with requests.cpu= gives 7 -> 0, and with limits.cpu=null 5 -> 0 (on main a null for a quantity that has no default rendered cpu: null on the five containers without a default CPU limit).

Tests, red first

15 new helm_template_test targets in charts/aether/BUILD.bazel. Each pattern ends on the line that follows that container's block, so another container of the same pod cannot satisfy it.

Against the unchanged chart, 10 of them failed (bazel test //charts/aether:all: "96 tests pass and 10 fail locally"):

  • one per container, emptied CPU limit: aether_agent_empty_cpu_limit_test, aether_proxy_empty_cpu_limit_test, aether_authz_sidecar_empty_cpu_limit_test, aether_controller_empty_cpu_limit_test, aether_registrar_empty_cpu_limit_test, aether_edge_agent_empty_cpu_limit_test, aether_edge_envoy_empty_cpu_limit_test
  • on the proxy block: aether_proxy_null_cpu_limit_test (a nulled quantity), aether_proxy_no_limits_test (the only limit emptied: no limits: key), aether_proxy_empty_cpu_request_test (an emptied request)

One failing line, from aether_agent_empty_cpu_limit_test:

Error: The file `aether/templates/agent-daemonset.yaml` does not contain the pattern:
resources:\n\s+limits:\n\s+memory: 128Mi\n\s+requests:\n\s+cpu: 200m\n\s+memory: 96Mi\n\s+volumes:\n

The other 5 are guards that passed before and after: the controller and registrar still render their default 100m limit, and a CPU limit set by the operator still renders on the proxy, the authz sidecar and both edge containers.

After the change: bazel test //charts/... 115 of 115 pass; bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //... succeeds; make format-check succeeds.

#1357: the spellings, and which were rendered

All rendered with helm template against this branch, on controller.resources (which has all four quantities by default):

Do not remove anything (the defaults render unchanged):

  • --set-json 'controller.resources={}'
  • --set-json 'controller.resources.limits={}'
  • values file resources: {}
  • values file limits: {}

Remove one limit:

  • --set controller.resources.limits.cpu=null
  • --set controller.resources.limits.cpu= (also --set-string, and --set-json 'controller.resources.limits.cpu=""')
  • --set-json 'controller.resources.limits={"cpu":null}', --set-json 'controller.resources.limits.cpu=null'
  • values file limits: {cpu: null}, limits: {cpu: ""}, limits: {cpu: ~}

Remove one request:

  • --set controller.resources.requests.cpu=null
  • --set controller.resources.requests.cpu=
  • values file requests: {memory: null}, requests: {memory: ""}

Remove a whole map: --set controller.resources.limits=null, --set controller.resources.requests=null, values file requests: ~. Removing limits also removes GOMEMLIMIT. --set controller.resources=null renders resources: {}.

The empty-string and null spellings for limits.cpu and requests.cpu were also rendered on all ten values keys at once (table above).

What an operator does on upgrade

Nothing. Values that rendered before render the same. To check a release's values against the new chart before upgrading (read the values back; never --reuse-values):

helm get values aether -n aether-system -o yaml > values.yaml
helm template aether <chart 2.4.14> -n aether-system -f values.yaml | grep -n -E '^\s+(cpu|memory): (""|null)?$'

No output means no container carries an empty quantity.

Not verified

  • Nothing was applied to a cluster. That the apiserver rejects cpu: "" is taken from the issue and from the helper's existing comment, not re-measured here; likewise that it accepts resources: {}.
  • That GOMAXPROCS follows the node's cores when limits.cpu is removed from the controller or registrar is the documented behaviour of resourceFieldRef and what values.yaml already says; I did not run a pod to observe it.
  • The values-file spellings were rendered for limits.cpu and requests.memory, not for every quantity of every key.

Noticed, not changed

  • charts/prober has the same pattern (toYaml .Values.resources in templates/daemonset.yaml), but that chart has no resources helper, so the fix there is a new helper plus tests and a version bump, not this one-line change. Its authz-canary containers hard-code their resources. charts/udsecho renders no resources from values.
  • Every workload's pod template carries helm.sh/chart: aether-<version>, so every chart release rolls every pod even when nothing else in the pod spec changed.
  • aether.resources renders {} when every quantity is removed, so the two blocks guarded by with (proxy, authz sidecar) then render resources: {} rather than no key. Valid, and the same as the other nine containers.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…es; document how to remove a default request or limit (#1355, #1357)

Seven containers still rendered `resources` with plain `toYaml`: the node
agent, the proxy, the authz sidecar, the controller, the registrar and both
edge containers. On those, `--set <x>.resources.limits.cpu=` rendered
`cpu: ""`, which the apiserver rejects as a quantity. They now go through
`aether.resources`, like cni-install, install-supervisor, mesh-dns and
uds-csi already did.

With unchanged values the render is byte-identical to main's (default, and
with edge, the authz sidecar, OTel and uds-csi enabled), apart from the
`helm.sh/chart` label that carries the chart version.

docs/configuration.md gains one paragraph on removing a default request or
limit: Helm merges maps, so an empty map removes nothing; the quantity has to
be nulled or emptied.

No default changes, so no GOMAXPROCS decision is made here.

Chart 2.4.14.

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 21:19

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

Resource rendering is consistently updated, documented, versioned, and covered by targeted Helm tests.

0 open findings

What changed in this PR

Standardizes resource rendering so empty or null quantities are safely omitted.

Changes:

  • Routes seven remaining resource blocks through aether.resources.
  • Adds Helm regression tests for empty, null, default, and overridden quantities.
  • Documents resource removal and bumps chart version to 2.4.14.
File Description
docs/​configuration.md Documents removing resource defaults.
charts/​aether/​templates/​registrar-deployment.yaml Uses resource helper for registrar.
charts/​aether/​templates/​edge-deployment.yaml Uses helper for both edge containers.
charts/​aether/​templates/​controller-deployment.yaml Uses resource helper for controller.
charts/​aether/​templates/​agent-proxy-daemonset.yaml Uses helper for proxy and authz sidecar.
charts/​aether/​templates/​agent-daemonset.yaml Uses resource helper for agent.
charts/​aether/​templates/​_helpers.tpl Records chart-wide helper requirement.
charts/​aether/​Chart.yaml Bumps chart to 2.4.14.
charts/​aether/​BUILD.bazel Adds resource-rendering regression tests.

🧠 Review effort: Balanced


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

Copilot AI balanced review requested due to automatic review settings October 7, 2026 21:37

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 helper is applied consistently, the chart bump is present, and comprehensive regression tests cover the changed behavior.

0 open findings

🧠 Review effort: Balanced

@bpalermo
bpalermo merged commit 90718a7 into main Oct 7, 2026
31 checks passed
@bpalermo
bpalermo deleted the fix/chart-resources-helper-1355 branch October 7, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants