Skip to content

Conversation

@AustinAbro321
Copy link
Member

@AustinAbro321 AustinAbro321 commented Nov 7, 2025

Description

User facing changes:

  • Helm 4 brings Server Side Apply. If it is a first time chart install then server side apply will be used by default. Upgrades default to the apply method that was used in the latest release. To control the apply method for a specific packaged chart, a new field .Charts[x].ServerSideApply has been introduced with possible values true, false, auto . Auto will follow the default Helm behavior.
    • A good example of how this could effect some charts can be seen in the init package registry deployment. Server side apply caught that replicas were set before even when they were controlled bythe autoscaler, which led to a conflict error. To solve this we conditionally set replicas when the autoscaler is not enabled.
  • Helm now uses slog style logging.
  • zarf tools helm is now a true copy of the Helm CLI. Previously, this command was a quasi fork of a subset of the Helm CLI and was not updated automatically. This functionality was made possible through a Zarf maintainer contribution #13617
  • Helm's now uses kstatus as a backend for it's wait logic, since Zarf already used kstatus the wait logic will be near identical to earlier Zarf versions. Zarf maintainers contributed this functionality to Helm in #13604
  • zarf dev find-images no longer includes images from Helm tests

We will have to be very careful about merging this as there may be impacts to charts that we do not test for in the migration from Helm 3 to Helm 4. We want the experience to be seamless for users. I intend to make a R.C. release from this branch before merging into main.

Note that vendoring in the entirety of Helm instead of the current quasi fork bring binary size up about 5MB from 173M on main to 178M on this branch

Something interesting is that server side apply default to true during new installs, but "auto" during upgrades and rollbacks meaning that existing charts will use the existing strategy. I decided to add a new addition to the schema, serverSideApply, which accepts the field "true", "false", and "auto".

zarf dev find-images and zarf dev inspect manifests no longer include files helm tests (from the chart/templates/test directory).`. I believe this is a good, since Zarf doesn't have a way to run these tests anyway so we now exclude unnecessary images. Would look to understand the reasoning

Related Issue

Fixes #2818
Fixes #2756
Fixes #4437

Checklist before merging

Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
@netlify
Copy link

netlify bot commented Nov 7, 2025

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit 9b452c1
🔍 Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/696548a05516bc00083c335b

Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

❌ Patch coverage is 28.05430% with 159 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/internal/packager/helm/chart.go 1.17% 84 Missing ⚠️
src/internal/packager/helm/repo.go 40.00% 15 Missing ⚠️
src/internal/packager/helm/zarf.go 0.00% 11 Missing ⚠️
src/internal/packager/helm/template.go 33.33% 8 Missing and 2 partials ⚠️
src/internal/packager/helm/destroy.go 0.00% 9 Missing ⚠️
src/internal/packager/helm/common.go 52.94% 7 Missing and 1 partial ⚠️
src/pkg/packager/inspect.go 22.22% 6 Missing and 1 partial ⚠️
src/pkg/packager/deploy.go 0.00% 4 Missing ⚠️
src/internal/packager/helm/images.go 71.42% 2 Missing ⚠️
src/pkg/cluster/zarf.go 90.47% 2 Missing ⚠️
... and 6 more
Files with missing lines Coverage Δ
src/api/v1alpha1/component.go 19.14% <ø> (ø)
src/internal/packager/helm/post-render.go 0.00% <ø> (ø)
src/pkg/packager/find_images.go 55.00% <100.00%> (-0.94%) ⬇️
src/cmd/helm.go 76.92% <75.00%> (-5.43%) ⬇️
src/cmd/initialize.go 26.81% <50.00%> (+0.17%) ⬆️
src/cmd/package.go 37.38% <50.00%> (+0.01%) ⬆️
src/cmd/zarf_tools.go 33.40% <50.00%> (+0.06%) ⬆️
src/pkg/packager/layout/assemble.go 42.98% <80.00%> (ø)
src/internal/packager/helm/images.go 79.16% <71.42%> (ø)
src/pkg/cluster/zarf.go 20.15% <90.47%> (+2.94%) ⬆️
... and 9 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
@AustinAbro321 AustinAbro321 changed the title Helm 4 feat: upgrade to Helm 4 Nov 12, 2025
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
@AustinAbro321 AustinAbro321 mentioned this pull request Dec 2, 2025
2 tasks
AustinAbro321 and others added 13 commits January 7, 2026 13:18
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Comment on lines +16 to +18
{{ if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{ end }}
Copy link
Member Author

Choose a reason for hiding this comment

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

The reason this was added is because with server side apply if autoscaling is enabled then it owns the replicas field, so we will run into an error if we re-apply the chart with a set amount of replicas and auto-scaling.

Copy link
Member

Choose a reason for hiding this comment

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

While not a zarf issue directly (more k8s migration to SSA issue) - this will be exposed to through zarf to consumers.

Are there other known instances of this ownership issue and do we need to document any of them for users to discover?

Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
@AustinAbro321 AustinAbro321 changed the title feat: upgrade to Helm 4 feat!: upgrade to Helm 4 Jan 9, 2026
@AustinAbro321 AustinAbro321 marked this pull request as ready for review January 9, 2026 19:58
@AustinAbro321 AustinAbro321 requested review from a team as code owners January 9, 2026 19:58
Copy link
Member

@brandtkeller brandtkeller left a comment

Choose a reason for hiding this comment

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

Looking over helm generically in this pass - continuing to dig into the integration. Couple minor questions for helm is isolation.

Excited to see helm vendored fully.

@github-project-automation github-project-automation bot moved this to In progress in Zarf Jan 12, 2026
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Copy link
Member

@brandtkeller brandtkeller left a comment

Choose a reason for hiding this comment

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

Review nearly complete - working through a few permutations of local testing. Otherwise I think you nailed this. My comments are largely either questions for my education or reinforcing improvements.

useSSA := zarfChart.ServerSideApply != "false"
client.ServerSideApply = useSSA
// Only force conflicts if SSA is enabled and the option is set
client.ForceConflicts = useSSA && opts.ForceConflicts
Copy link
Member

Choose a reason for hiding this comment

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

I like this distinction for compatibility - given backwards CSA potential.

}
client.ServerSideApply = zarfChart.ServerSideApply
// Only force conflicts if SSA is enabled and the option is set
useSSA := zarfChart.ServerSideApply != "false" && zarfChart.ServerSideApply != ""
Copy link
Member

Choose a reason for hiding this comment

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

Is the latter conditional possible given the preceding lines?

Suggested change
useSSA := zarfChart.ServerSideApply != "false" && zarfChart.ServerSideApply != ""
useSSA := zarfChart.ServerSideApply != "false"

}

func rollbackChart(name string, version int, actionConfig *action.Configuration, timeout time.Duration) error {
func rollbackChart(zarfChart v1alpha1.ZarfChart, version int, actionConfig *action.Configuration, timeout time.Duration) error {
Copy link
Member

Choose a reason for hiding this comment

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

Is there a permutation of scenarios where we need to set client.ForceConflicts on rollback?

func migrateDeprecatedAPIs(ctx context.Context, c *cluster.Cluster, actionConfig *action.Configuration, latestRelease *release.Release) error {
func migrateDeprecatedAPIs(ctx context.Context, c *cluster.Cluster, actionConfig *action.Configuration, latestReleaser release.Releaser) error {
// We can re-evaluate handling this functionality for chart v3 / release v2 when available.
// Potentially we stop doing this functionality for future chart APIs, as it could be outside of the intended scope of Zarf.
Copy link
Member

Choose a reason for hiding this comment

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

I would agree - I believe this workflow also incurs a decent dependency footprint if I recall correctly.

}(l)

saved, _, err := chartDownloader.DownloadTo(chartURL, pull.Version, temp)
saved, _, err := chartDownloader.DownloadToCache(chartURL, pull.Version)
Copy link
Member

Choose a reason for hiding this comment

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

neat improvement under-the-hood for zarf (caching).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Upgrade to Helm 4 Refactor helm embedding when Helm 4 is available Helm tool ignores errors

3 participants