Skip to content

feat: release-secret size estimator + /helm-render-all check - #408

Open
infojohn wants to merge 11 commits into
feature/podiumd-4.9.0from
feature/helm-release-secret-size-check
Open

feat: release-secret size estimator + /helm-render-all check#408
infojohn wants to merge 11 commits into
feature/podiumd-4.9.0from
feature/helm-release-secret-size-check

Conversation

@infojohn

Copy link
Copy Markdown
Collaborator

Why

Helm persists every release revision as a Kubernetes Secret whose payload
is base64(gzip(json.Marshal(release))), and Kubernetes hard-caps
Secret/ConfigMap objects at 1 MiB. This repo already hit that limit once
for podiumd — see the comment in charts/podiumd/.helmignore ("the docs
tree alone (~1.2M) pushed the release over that limit"). There was no
ongoing visibility into how close either chart is to that wall.

What

  • charts/podiumd/scripts/helm-release-secret-size.py — estimates the
    release-Secret payload for any chart. It reconstructs the same
    Chart/Config/Manifest JSON shape Helm stores:
    • Subchart trees are excluded, matching real Helm behavior
      (chart.Chart.dependencies is an unexported Go field, so
      json.Marshal never serializes nested charts — only the manifest,
      which already includes every subchart's rendered output, and the
      top-level chart's own files/templates/values count).
    • File inclusion respects .helmignore by running helm package and
      reading the resulting .tgz, rather than walking the raw directory
      (this is what makes the podiumd number realistic — a naive
      directory walk overcounts by ~2.5x because it ignores the
      docs/ci/scripts exclusions .helmignore already relies on).
    • Cross-checked against an independent reference implementation using
      Helm's own Go SDK (helm.sh/helm/v4, same encodeRelease logic) —
      within 0.5% on both charts.
  • --record appends/updates a per-version row in
    <chart>/docs/release-secret-size.md — a running history of this
    metric per release. Seeded here:
    • podiumd 4.8.3: 427,932 bytes (40.8% of 1 MiB)
    • monitoring-logging 1.0.15: 406,992 bytes (38.8% of 1 MiB)
  • Exits non-zero with a warning once the estimate reaches 90% of the
    1 MiB limit.
  • Wired into /helm-render-all (.claude/commands/helm-render-all.md)
    as a required step of the render-verify pass, with instructions to
    treat a 90%+ result as a release blocker, not a nitpick.

Test plan

  • Ran against charts/podiumd with ci/lint-values.yaml and
    charts/monitoring-logging with defaults — both render and compute
    cleanly, results recorded above.
  • Cross-validated against a from-scratch Go implementation using
    helm.sh/helm/v4's real chart loader + encodeRelease — agreed
    within 0.5%.
  • Verified the .helmignore-driven discrepancy directly: a naive
    directory walk reported podiumd at 106% of the limit; reading the
    packaged .tgz (which correctly excludes docs/, ci/, scripts/)
    gives the accurate 40.8%.

Requires helm and yq (mikefarah/yq) on PATH.

🤖 Generated with Claude Code

bas-info-nl and others added 11 commits August 6, 2026 16:30
Add CLAUDE.md with project context (conventions, branching strategy,
slash commands) and document branching strategy in README.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers ZAC 4.7.2->5.1.0 (breaking brpApi.apiKey restructure,
featureFlags.pabcIntegration removal, sidecar bumps) and ZGW Office
Add-in v0.9.313->v0.9.329 with ACR mirror rename. All three files
include a baseline-commit note for re-verification before release.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ZAC version: 4.7.2 -> 4.7.1 (actual 4.8.0 baseline version)
- zgw-office-addin chart: remove incorrect 0.0.87->0.0.88 claim (was already 0.0.88 on 4.8.0)
- zgw-office-addin header comment: v0.9.329 -> v0.9.352 (reflect final version)
- zgw-office-addin digests in values-changes: correct to v0.9.352 hashes
- Baseline ref: c68bfc1 -> 27a68aa (current 4.8.0 tip after our additions)
- UPGRADING.md: add 4.8.0 -> 4.9.0 hop to official path

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Update baseline hash 27a68aa -> c56fc33 (current tip of feature/podiumd-4.8.0)
- Remove "Required changes" that are already part of 4.8.0 (zac.brpApi.apiKey
  string->object and featureFlags.pabcIntegration removal both landed in
  ZAC 5.0.1 / podiumd 4.8.0, not 4.9.0)
- Remove stale image tag rows from cleanup table (nginx 1.31.1, gotenberg 8.33.0,
  OPA 1.17.1, busybox 1.38.0 are all 4.8.0 defaults; only ZAC 5.1.0 and
  zgw-office-addin v0.9.352 are genuine 4.9.0 changes)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ove 4.8.0 sidecar entries

- images-4.9.0.yaml: update baseline hash 27a68aa -> c56fc33, correct ZAC
  range from "4.7.2 -> 5.1.0 (chart 1.0.228)" to "5.0.1 -> 5.1.0 (chart
  1.0.251)"; remove nginx/gotenberg/opa/busybox entries that are already
  in 4.8.0 and present in images-baseline.yaml
- images-baseline.yaml: add ZAC 5.1.0, zgw-office-addin-frontend v0.9.352,
  zgw-office-addin-backend v0.9.352

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Main restructured the upgrade docs (_UPGRADING.md + _UPGRADE_PATHS/
<from>-to-<to>-{upgrade,values-deltas,gemeente-specific}.md) after the
4.9.0 branch was written. Port the 4.9.0 docs into the new layout, rebased
onto the 4.8.2 baseline:

- add _UPGRADE_PATHS/4.8.2-to-4.9.0-{upgrade,values-deltas,gemeente-specific}.md
- register the 4.8.2 -> 4.9.0 hop in _UPGRADING.md
- fix images-4.9.0.yaml: frontend/backend v0.9.329 -> v0.9.352, 4.8.2 baseline
- drop old-style upgrade-from-4.8.0-to-4.9.0.md / values-changes-4.9.0.md

The real 4.8.2 -> 4.9.0 delta is only ZAC 5.0.1 -> 5.1.0 and ZGW Office
Add-in v0.9.313 -> v0.9.352; the branch guide's brpApi.apiKey/PABC/sidecar
and office-addin-rename notes already shipped in 4.8.1/4.8.2.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Every Helm release revision is persisted as a Kubernetes Secret capped
at 1 MiB by the apiserver (base64(gzip(json.Marshal(release))) — see
encodeRelease() in helm.sh/helm/v4/pkg/storage/driver/util.go). This
repo already hit that limit once for podiumd (see the comment in
charts/podiumd/.helmignore); there was no visibility into how close a
chart is to it before a real cluster rejects the install.

- charts/podiumd/scripts/helm-release-secret-size.py — reconstructs the
  Chart/Config/Manifest JSON shape Helm actually persists (subchart
  trees are excluded, since chart.Chart.dependencies is an unexported
  Go field that json.Marshal never serializes; file inclusion respects
  .helmignore by packaging the chart and reading the resulting tgz
  rather than walking the raw directory) and gzip+base64 encodes it the
  same way. Cross-checked against a reference implementation using
  Helm's own Go SDK (helm.sh/helm/v4) — within 0.5% on both charts.
- --record appends/updates a per-version row in
  <chart>/docs/release-secret-size.md, seeded here for podiumd 4.8.3
  (40.8%) and monitoring-logging 1.0.15 (38.8%).
- Exits non-zero with a strong warning at >=90% of the 1 MiB limit.
- Wired into /helm-render-all as a required step of the render-verify
  pass, with instructions to surface a 90%+ result as a release
  blocker.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@infojohn
infojohn force-pushed the feature/helm-release-secret-size-check branch from a73ef39 to dcbb18a Compare August 10, 2026 13:23
@infojohn
infojohn changed the base branch from main to feature/podiumd-4.9.0 August 10, 2026 13:23
infojohn added a commit that referenced this pull request Aug 10, 2026
Mirrors charts/podiumd/.helmignore, which exists because podiumd
already hit the Kubernetes 1 MiB release-Secret limit once (everything
in the packaged chart is embedded in that Secret). monitoring-logging
had no .helmignore at all, so its docs/, scripts/, and leftover
.github/ (from when this chart lived in its own repo) were shipping in
every release Secret for no functional reason — dashboards/ is
deliberately kept, since templates load it via .Files.Get.

Drops the estimated release-Secret payload from 407,160 to 341,480
bytes (38.8% -> 32.6% of the 1 MiB limit; measured with the estimator
from #408). helm lint and helm template are unaffected (same 53,576
lines of rendered output).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@infojohn infojohn mentioned this pull request Aug 10, 2026
3 tasks
@bas-info-nl
bas-info-nl force-pushed the feature/podiumd-4.9.0 branch from 64bf4bf to 7c4eea0 Compare August 20, 2026 10: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.

2 participants