Skip to content

fix(chart): the default install works with one helm command; the chart no longer creates the release's own namespace by default (#1403, #1404, #1405, #1406) - #1464

Merged
bpalermo merged 15 commits into
mainfrom
fix/1403-namespace-create-default
Oct 9, 2026

Conversation

@bpalermo

@bpalermo bpalermo commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Closes #1403
Closes #1404
Closes #1405
Closes #1406

An agent wrote this. It replaces the workaround #1398 documented.

Upgrading an existing install. If an older chart installed the release with namespace.create=false, run this once before upgrading:

kubectl annotate namespace aether-system helm.sh/resource-policy=keep
# prober chart, before its first upgrade to 1.0.6 (every prober release: its default was already false)
kubectl annotate namespace <prober namespace> helm.sh/resource-policy=keep

Without it the first upgrade is refused with a message naming that command; nothing is changed or deleted. Under a GitOps controller that drives Helm the symptom is a release that fails to upgrade until the namespace is annotated. Installs made with the old default need nothing. The maintainer chose this rule: a refusal that names the command over any path to a deleted namespace.

The problem

With namespace.create=true (the old default) and the release stored in the namespace the chart creates, no single helm command could first-install: Helm writes the release record into the release namespace before it creates anything the chart renders.

What changes

charts/aether 2.4.21

  • namespace.create defaults to false. The first install is one helm command with --create-namespace. On a cluster that enforces Pod Security admission the operator labels the namespace first (the three pod-security.kubernetes.io/{enforce,audit,warn}=privileged labels the chart used to set); the docs give the kubectl label command.
  • namespace.create=true stays for a release stored in a different namespace. For the release's own namespace the render fails and names both ways out. The edge namespace is unchanged in the normal case and gets the same check for a release stored in the edge namespace itself.
  • Upgrade safety, in one step. A release installed with the old default owns its Namespace, and Helm deletes an object that leaves the manifest. The chart reads the live namespace at render time (lookup): one this release owns is rendered whatever namespace.create says, and now carries helm.sh/resource-policy: keep. The default flip therefore lands in this release, not a later one.
  • On an upgrade the Namespace is left out of the render only when the chart can see that is safe: the live namespace carries helm.sh/resource-policy: keep, or the previous revision was written by this chart and recorded that it rendered none (an annotation on the agent ServiceAccount). Otherwise the render is refused with the one kubectl annotate ... helm.sh/resource-policy=keep command. That covers a failed first install of an older chart, a namespace that lost every sign of its owner, and, because the chart cannot tell it apart, a release an older chart installed with namespace.create=false (see "What an operator does on upgrade").
  • A namespace that lost only Helm's ownership annotations is still recognised by the labels every chart version put on it, and keeps being rendered.
  • The install notes print a NAMESPACE NOTE when the namespace is not labelled privileged.

charts/prober 1.0.6 — the same rule for namespace.create=true and the same protection for a namespace the chart rendered. Its default was already false. It reads the cluster on an upgrade only, so a first install with default values needs no access to the Namespace object.

CI — e2e/first-install.sh and a first-install job in the nightly e2e workflow, through run-e2e-script.

Docs — the adoption pre-step is gone from README.md, charts/README.md, docs/getting-started.md, docs/runbook.md, docs/configuration.md and website/pages/index.md. The runbook gains "Recovering from a failed first install" and "Chart 2.4.21".

Upgrade safety: measured on kind

kind v0.33.0, kindest/node:v1.35.8, Helm 3.18.4, one node, the API server enforcing Pod Security baseline by default. "Old" is the chart on main (2.4.20). The namespace UID is compared before and after.

Start Then Result
Control: old default, release owns the namespace (8 pods) main's chart with only the default flipped, no values upgrade reports deployed; namespace Terminating, then gone, with the pods and the release record
(a) old default, release owns the namespace this chart, no values same UID, Active, 8 pods; Namespace still in the manifest, now with keep
this chart, namespace.create=false same UID; still in the manifest
ownership annotations removed by hand, then this chart Namespace leaves the manifest; same UID (keep stops the delete)
helm uninstall namespace stays
(b) old chart, explicit namespace.create=true this chart, namespace.create=true; then no values same UID both times
(c) old chart, namespace.create=false + --create-namespace this chart, same values; then no values refused both times, naming kubectl annotate namespace aether-system helm.sh/resource-policy=keep; same UID, release still at revision 1
that command, then this chart deployed, same UID, 8 pods
keep removed again, this chart again deployed, same UID (the marker is stamped; no step needed any more)
Control (before the last fix): old default, deployed, namespace lost Helm's ownership annotations this branch as it was upgrade reports deployed; namespace Terminating
the same this chart same UID, Active; Namespace stays in the manifest, keep and the ownership annotations are back (recognised by the chart's labels)
old default, deployed, namespace lost the annotations and the chart's labels this chart refused with the same kubectl annotate command; same UID
prober, old chart, namespace.create=true stored elsewhere, namespace lost the annotations this chart, namespace.create=false same UID, keep back (it was Terminating before the last fix)
Control (before the last fix): old chart rendering ns-old, release stored elsewhere this branch as it was, namespace.name=ns-new upgrade reports deployed; ns-old Terminating
the same this chart, namespace.name=ns-new refused, naming kubectl annotate namespace ns-old helm.sh/resource-policy=keep; ns-old untouched, ns-new not created
that command, the same helm command again deployed; ns-old same UID, ns-new Active
this chart, first install failed on a --wait timeout (re-measured with the final chart) the same command again deployed, no extra step (the ServiceAccount carries the marker false)
old chart, failed first install (--create-namespace, "already exists") this chart without the new guard (control) upgrade reports deployed; namespace Terminating
the same this chart render refused, naming kubectl annotate namespace aether-system helm.sh/resource-policy=keep; namespace untouched
that command, the labels, the same helm command again deployed, same UID, 8 pods
prober, old chart, namespace.create=true stored elsewhere old chart, namespace.create=false (control) namespace deleted
the same this chart, namespace.create=false same UID, keep

Why lookup rather than a two-release transition: helm.sh/resource-policy: keep only protects an object that already carries it, so a keep-only release followed by a later flip would still delete the namespace of anyone who skipped the first one. The chart already depends on lookup (the seeded MeshConfig, the webhook Secret).

What is left. Under Helm the upgrade either keeps rendering the namespace, finds keep, finds the marker, or is refused. Known gaps, all outside the default flip:

  • The refusal also hits two safe cases the chart cannot tell apart: an old namespace.create=false install (the one-time step above), and a first install of this chart that failed before its ServiceAccount was written.
  • Moving a release to another namespace on an upgrade (namespace.name changed) is refused while a namespace the release owns would be left behind without keep. It finds that namespace by Helm's ownership annotations only, so an old namespace that also lost those is not seen. The prober chart runs this check only when namespace.name or namespace.create is set (it needs a cluster-wide namespace list), so a prober release moved back to its own release namespace with both values at their defaults is not covered.
  • Turning the edge off still removes the edge namespace the chart made, as on main.

The limit of this. helm template has no cluster, so it cannot see ownership and renders no Namespace. Helm itself is safe (measured above). A pipeline that renders with helm template and prunes what left the render would remove a namespace the old chart rendered. I did not test any such tool. The docs tell those users to protect the namespace in their tool before upgrading.

Pod Security: measured

  • Unlabelled namespace, one helm command: the release is deployed, the two Deployments get their pods, the four DaemonSets get none (FailedCreate: violates PodSecurity "baseline:latest").
  • Namespace labelled first: 8 pods, zero FailedCreate events, all six workloads Ready.
  • Label applied 25 s after the refusals began: pods within 5 s. Applied after 4 minutes: no pods 20 s later; kubectl -n aether-system rollout restart daemonset brought them at once. The docs give both commands.

Renders, before and after (helm template, no cluster)

Values main this branch
default, release in aether-system 1 Namespace no Namespace
namespace.create=false no Namespace no Namespace
namespace.create=true, release elsewhere Namespace Namespace + helm.sh/resource-policy: keep
namespace.create=true, release in aether-system Namespace (uninstallable) render error
edge.enabled=true edge Namespace, baseline the same

The only other difference in any render is one annotation on the agent ServiceAccount (aether.io/release-namespace-rendered), and on the prober's. No pod template changes, so the upgrade rolls nothing.

Red, then green

  • Template tests (19 new, written first): against main's templates 17 fail and 2 pass; the 2 are guards that must hold on both sides (the edge namespace still renders; the prober default renders no Namespace). On the branch bazel test //charts/... //e2e:all //website:site_test passes.
  • e2e/first-install.sh:
    • main's chart and docs: red at the docs check (the label command is not there).
    • main's chart with this branch's docs: red at the install, namespaces "aether-system" already exists.
    • this branch: green; up 111 s, verify about 6 minutes on a clean cluster (most of it one namespace deletion waiting out the proxy pod's 180 s termination grace period).
    • a scratch copy of this chart with the failed-first-install guard removed: red in the guard leg, namespace Terminating.
    • a scratch copy of this chart with the ownership lookup removed: red in the upgrade-safety leg ("a namespace the release owns is not in its manifest"), so that leg can fail.
  • bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //..., make format-check, make actionlint, scripts/check-shell-lint.sh, scripts/check-chart-version-bump.sh origin/main: clean.

What an operator does on upgrade

  • Installed with the old default or namespace.create=true: nothing. helm uninstall will leave the namespace behind from now on.
  • Installed by an older chart with namespace.create=false: one command, once, before the upgrade or when the refused upgrade names it: kubectl annotate namespace aether-system helm.sh/resource-policy=keep. It is harmless on a namespace the release never rendered and may be removed after that upgrade. This is the cost of refusing the cases above without being able to read the previous manifest; every later upgrade passes without it. A GitOps controller driving Helm shows the refusal as a failed release until the namespace is annotated.
  • The prober chart 1.0.6 asks the same of its namespace on the first upgrade from an older chart.
  • Rendering with helm template and pruning: protect the namespace in that tool first.
  • The check before and after is in the runbook, "Chart 2.4.21" (namespace UID, helm get manifest | grep -c '^kind: Namespace', and a --dry-run=server render).

Not verified

  • The new workflow job has not run on GitHub; it runs nightly or by workflow_dispatch with only=first-install. Locally the script ran with images built from this tree.
  • In CI the failed-first-install state is rebuilt with this chart (a first install the API server rejects, then ownership and keep removed from the namespace); the real pre-2.4.21 chart was only measured by hand.
  • Only Helm 3.18.4, and only Helm's secret storage driver. With another driver the failed-first-install guard sees no release record and does not act.
  • No GitOps tool was tried. That a controller driving the Helm SDK against the cluster behaves like the CLI is inferred.
  • helm rollback across the change could not be measured cleanly: rolling back to a first revision already fails on main (no MeshConfig with the name "default" found), unrelated to this change. The namespace kept its UID through the failed rollback and the next upgrade.
  • restricted enforcement was not tried, only baseline.
  • The published OCI charts were not installed; the runs use the charts from this tree.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

bpalermo and others added 4 commits October 8, 2026 17:02
…y default; a namespace the release owns is never deleted (#1403, #1405)

Helm writes the release record into the release namespace before it creates
anything a chart renders, so with namespace.create=true and the release stored
in that namespace no helm command could first-install: "already exists" with
--create-namespace, "not found" without, "invalid ownership metadata" for a
namespace made with kubectl.

charts/aether (2.4.21):
- namespace.create defaults to false. Helm (--create-namespace) or the operator
  creates the namespace, and the operator labels it for Pod Security admission.
- namespace.create=true is for a release stored in another namespace. For the
  release's own namespace the render fails and names both ways out. The edge
  namespace has the same check (a release stored in the edge namespace).
- Upgrade safety. A release installed with the old default owns its Namespace,
  and Helm deletes an object that leaves the manifest. A Namespace the live
  cluster says this release owns is therefore rendered whatever
  namespace.create says, and carries helm.sh/resource-policy: keep.
- A release whose only revision is a failed first install of an older chart
  lists a Namespace it does not own; upgrading it would delete the namespace.
  That upgrade is refused with the command that makes it safe. The agent
  ServiceAccount records whether a render included the Namespace, so a failed
  first install of this chart is retried without that step.
- The install notes say when the namespace is not labelled privileged.

charts/prober (1.0.6): the same rule for namespace.create=true, the same
protection for a namespace the chart rendered.

Template tests were written first and fail against the unchanged charts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…th default values, and upgrades once (#1404)

e2e/first-install.sh runs the documented commands on an empty kind cluster whose
API server enforces Pod Security "baseline" by default, with SPIRE installed as
the documented prerequisite: the crds chart, the namespace and its three
pod-security labels, one `helm upgrade --install ... --create-namespace` with
default values (only the image coordinates point at the build under test), then
the same command again. It also checks that the docs give those commands, that
the cluster refuses the agent's kind of pod without the labels, that
namespace.create=true for the release's own namespace fails the render and
leaves nothing behind, and that a release which owns its namespace keeps it
across upgrades.

The job runs through the existing run-e2e-script composite action.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…recovering from a failed first install (#1403, #1406)

Replaces the namespace-adoption pre-step of #1398 everywhere it appeared with
the namespace and its pod-security labels, adds the runbook section on
recovering from a failed first install, and a "Chart 2.4.21" note with the
check to run before and after the upgrade.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…of the DaemonSets (#1406)

Measured on kind: four minutes after the pods were first refused, labelling the
namespace did not bring them back within 20 s; `rollout restart daemonset` did
at once. The runbook, getting-started and the install notes say so.

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 8, 2026 20:05

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

Recovery commands fail for existing PSA labels, and critical failed-release safeguards lack live-cluster coverage.

4 open findings
What changed in this PR

Updates namespace ownership behavior so default Helm installs work safely while preserving namespaces across upgrades.

Changes:

  • Defaults namespace creation to Helm/operator ownership.
  • Adds upgrade safeguards and chart tests.
  • Adds first-install e2e coverage and updates documentation.
File Description
.github/​workflows/​e2e.yaml Adds nightly first-install job.
README.md Updates installation commands.
charts/​README.md Documents namespace ownership rules.
charts/​aether/​BUILD.bazel Adds namespace render tests.
charts/​aether/​Chart.yaml Bumps chart to 2.4.21.
charts/​aether/​templates/​NOTES.txt Adds Pod Security guidance.
charts/​aether/​templates/​_helpers.tpl Adds namespace safety checks.
charts/​aether/​templates/​agent-serviceaccount.yaml Records namespace-render state.
charts/​aether/​templates/​edge-namespace.yaml Guards edge namespace creation.
charts/​aether/​templates/​namespace.yaml Implements safe namespace retention.
charts/​aether/​values.yaml Defaults namespace creation off.
charts/​prober/​BUILD.bazel Adds namespace render tests.
charts/​prober/​Chart.yaml Bumps chart to 1.0.6.
charts/​prober/​templates/​_helpers.tpl Adds upgrade safeguards.
charts/​prober/​templates/​namespace.yaml Retains rendered namespaces.
charts/​prober/​templates/​serviceaccount.yaml Records namespace-render state.
charts/​prober/​values.yaml Documents namespace behavior.
docs/​configuration.md Updates configuration reference.
docs/​getting-started.md Revises first-install procedure.
docs/​runbook.md Adds recovery and upgrade guidance.
e2e/​first-install.sh Tests documented installation flow.
website/​pages/​index.md Updates website installation steps.

🧠 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/prober/BUILD.bazel Resolved
Comment thread e2e/first-install.sh Resolved
Comment thread charts/aether/templates/NOTES.txt Resolved
Comment thread docs/runbook.md Resolved
…s; recovery commands overwrite existing pod-security labels

Review round 1.

- e2e/first-install.sh builds the state the guard exists for (a release never
  deployed, whose failed revision lists a Namespace it does not own) for the
  aether chart and the prober chart, and asserts the upgrade is refused with the
  fix in the message, the namespace untouched, and the same upgrade going
  through once the namespace is marked keep. Against a copy of the chart without
  the guard the leg fails with the namespace Terminating.
- The recovery commands (install notes, the guard's message, the runbook) pass
  --overwrite: a namespace already labelled baseline or restricted refuses a
  plain `kubectl label`. The note also prints the level it found.

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 8, 2026 20:32

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

Namespace creation guidance mishandles custom target namespaces, and the prober’s default install unnecessarily requires cluster-scoped namespace access.

1 open finding
4 resolved since last review
Previously missed (3)

In code that hasn't changed since last review

Low severity Document create-namespace limitation for custom target namespaces

charts/​aether/​values.yaml:34

--create-namespace creates only Helm's release namespace, not a different namespace selected by namespace.name. With namespace.create=false and -n releases --set namespace.name=aether-system, this documented command leaves aether-system absent and the install fails. Clarify that the flag works only when the target is the release namespace; otherwise the target must be created beforehand.

Low severity Handle custom target namespaces with create-namespace

charts/​prober/​values.yaml:9

--create-namespace creates the release namespace only. If namespace.name points elsewhere while create=false, following this comment still leaves the prober's target namespace missing and all rendered resources fail to install. Distinguish the default same-namespace case from a custom target namespace.

Low severity Clarify create-namespace and custom target namespace semantics

docs/​configuration.md:27

This says Helm can create the target whenever namespace.create=false, but --create-namespace only creates .Release.Namespace. If namespace.name selects another namespace, that target must already exist or every namespaced resource fails. Document that distinction here because these are the canonical value semantics.

🧠 Review effort: Balanced

Comment thread charts/prober/templates/_helpers.tpl Resolved
…an upgrade only

Review round 2. The prober chart's default render is a DaemonSet and a
ServiceAccount, which an operator limited to one namespace may install; reading
the Namespace on a first install could refuse them, and a first install has no
stored manifest to protect. Ownership and the failed-first-install guard are now
evaluated on upgrades only. The e2e leg for the prober guard builds its state
the supported way (namespace.create=true, release stored in another namespace).

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 8, 2026 20:49

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.

🔵 Needs a closer look

Recovery commands cannot replace an existing non-keep resource-policy annotation, leaving affected upgrades blocked.

0 open findings

1 resolved since last review
Previously missed (3)

In code that hasn't changed since last review

Medium severity Add --overwrite to annotation remediation command

charts/​aether/​templates/​_helpers.tpl:104

The guard accepts any existing value other than keep, but this remediation cannot replace an existing annotation because kubectl annotate defaults to --overwrite=false. A namespace with helm.sh/resource-policy set to another value remains blocked by the command in the error; include --overwrite so the prescribed fix works for every state this branch handles.

Medium severity Ensure remediation overwrites existing resource-policy annotation

charts/​prober/​templates/​_helpers.tpl:93

This branch also matches a namespace whose resource-policy annotation exists with a non-keep value, but the printed command cannot replace that value without --overwrite. Make the remediation command work for all states that trigger the guard.

Low severity Add --overwrite so recovery command succeeds

docs/​runbook.md:1422

The chart guard also triggers when helm.sh/resource-policy exists with a value other than keep. In that case this recovery command fails rather than replacing it, so the documented upgrade remains blocked; add --overwrite to match the states handled by the guard.

🧠 Review effort: Balanced

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

The prober’s real failed-install recovery path bypasses the promised one-step safeguard, and the new workflow job lacks explicit permissions.

2 open findings

🧠 Review effort: Balanced

Comment thread .github/workflows/e2e.yaml Resolved
Comment thread charts/prober/templates/namespace.yaml Resolved
Copilot AI balanced review requested due to automatic review settings October 8, 2026 21:51

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.

🔵 Needs a closer look

Namespace lifecycle safety depends on live Helm lookups and destructive upgrade behavior tested against only one Helm version.

2 open findings

🧠 Review effort: Balanced

…espace.create=true gets the message with the fix first; the first-install job declares its permissions

Review round 3.

- Both charts checked "cannot create the release's own namespace" before the
  failed-first-install guard. The failed installs the guard is about were made
  with namespace.create=true, so a retry of that command got the "cannot create"
  message, and only after changing the value the one that names
  `helm.sh/resource-policy=keep`: two failures. The guard now runs first in that
  case, and its message says to drop namespace.create=true as well.
- The prober chart reads namespace ownership on an upgrade or when
  namespace.create is set (not on a default first install).
- e2e/first-install.sh builds the state with the release stored in the target
  namespace and namespace.create=true, for both charts, and retries with and
  without namespace.create=true; both must be refused by the guard's message.
  Seen red against the previous ordering, green after.
- The first-install job declares `permissions: contents: read`.

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 8, 2026 22:02

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

Legacy namespaces can still be deleted when ownership annotations drift before the first protected upgrade.

2 open findings
2 resolved since last review

🧠 Review effort: Balanced

Comment thread charts/aether/templates/_helpers.tpl Resolved
Comment thread charts/prober/templates/_helpers.tpl Resolved
Copilot AI balanced review requested due to automatic review settings October 8, 2026 22:29

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.

🔵 Needs a closer look

Namespace retention depends on high-impact live-cluster Helm behavior, and the new workflow job has not yet run on GitHub.

2 open findings

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 8, 2026 22:42

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.

🔵 Needs a closer look

Namespace deletion safeguards affect cluster lifecycle and the new GitHub e2e job has not yet run.

2 open findings

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 8, 2026 23:09

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

Both upgrade guards can misclassify safe retries when ServiceAccount creation failed before the live marker was applied.

4 open findings

🧠 Review effort: Balanced

Comment thread charts/aether/templates/_helpers.tpl Resolved
Comment thread charts/prober/templates/_helpers.tpl Resolved
bpalermo and others added 2 commits October 8, 2026 20:18
…an see that is safe

Review round 4. A deployed release of an older chart whose Namespace had lost
Helm's ownership annotations looked unowned on the very upgrade that drops the
Namespace from the manifest, before `keep` was ever stamped, and Helm deleted
it (reproduced on kind with the chart on main: namespace Terminating).

Both charts:
- On an upgrade the labels every chart version put on the Namespace it rendered
  (app.kubernetes.io/managed-by: Helm, app.kubernetes.io/instance: <release>)
  count as ownership too, on a namespace without `keep`. Helm patches a
  Namespace that is in the previous manifest and stamps ownership and `keep`
  back.
- Otherwise the Namespace is left out of an upgrade only when the live
  namespace carries helm.sh/resource-policy: keep, or the previous revision was
  written by this chart and recorded that it rendered none (the ServiceAccount
  marker). Anything else is refused with the one `kubectl annotate` command.
  The check no longer reads Helm's release Secrets.

User-visible cost: a release an older chart installed with
namespace.create=false cannot be told from one whose namespace lost every sign
of its owner, so its first upgrade is refused until the namespace has been
annotated once. The runbook, getting-started, configuration and values say so.

e2e/first-install.sh covers the drift case for both charts and the one-time
refusal for an unmarked release.

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 8, 2026 23: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.

🟡 Changes recommended

Changing namespace.name during the first protected upgrade can still delete the namespace previously owned by either chart.

4 open findings
2 resolved since last review

🧠 Review effort: Balanced

Comment thread charts/aether/templates/_helpers.tpl Resolved
Comment thread charts/prober/templates/_helpers.tpl Resolved
…ed namespace to be deleted; the one-time keep step leads the upgrade notes

Review round 5.

- Both charts: an upgrade that changes namespace.name (or edge.namespace) no
  longer renders the namespace the release rendered before, and Helm deleted
  it (reproduced on kind: Terminating). On an upgrade, a namespace carrying
  Helm's ownership annotations for this release that the render no longer
  names, and that has no helm.sh/resource-policy: keep, now fails the render
  with the command that protects it. The prober chart runs the check only when
  namespace.name or namespace.create is set (it lists the cluster's
  namespaces). e2e/first-install.sh has a leg for it.
- The refusal for an unmarked release stays as it is (maintainer's decision: a
  refusal that names the command over any path to a delete). Its message now
  also names a first install that failed before the ServiceAccount was
  written, and the docs say such a retry may ask for the annotation once.
- The runbook's "Chart 2.4.21" section leads with the one command for releases
  an older chart installed with namespace.create=false, for both charts, and
  the GitOps symptom.

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 8, 2026 23:54

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.

🔵 Needs a closer look

Several recovery commands fail when replacing existing labels or annotations because they omit --overwrite.

0 open findings

4 resolved since last review
Previously missed (3)

In code that hasn't changed since last review

Medium severity Include --overwrite in resource-policy annotation remediation

charts/​aether/​templates/​_helpers.tpl:124

This branch also runs when helm.sh/resource-policy already exists with a non-keep value, but the prescribed kubectl annotate command cannot replace an existing annotation without --overwrite. In that state the upgrade remains blocked even after following the error. Include --overwrite in the command.

This issue also appears on line 149 of the same file.

Medium severity Add --overwrite to Pod Security label recovery command

charts/​aether/​templates/​namespace.yaml:35

This error path can apply to a pre-existing namespace already labelled baseline or restricted, but the displayed kubectl label command cannot replace those values without --overwrite. The advertised way out therefore fails for that common Pod Security state; include --overwrite as the other remediation messages do.

Medium severity Add --overwrite to annotation recovery command

charts/​prober/​templates/​_helpers.tpl:93

This condition includes namespaces where the resource-policy annotation already has a non-keep value. The command in the failure message then fails unless --overwrite is supplied, so following the stated recovery cannot unblock the upgrade.

This issue also appears on line 115 of the same file.

🧠 Review effort: Balanced

@bpalermo
bpalermo merged commit 3bca3d7 into main Oct 9, 2026
31 checks passed
@bpalermo
bpalermo deleted the fix/1403-namespace-create-default branch October 9, 2026 00:05
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