Helm Compatibility
HelmSharp is not trying to be a command-line emulator. It is trying to give .NET applications the Helm behavior they need when rendering charts and managing releases from inside a process.
Helm CLI v4.2.2 is the test oracle for new compatibility validation and is pinned in CI and release workflows. It is not required at runtime by consumers.
Validation scope
Focused fixture charts and selected public charts are compared with helm template in CI. They exercise helpers, nested values, .Files, capabilities, and formatting patterns that small examples miss. This is regression coverage for those behaviors, not a universal compatibility certification. Validate your own chart when it relies on an uncommon Helm behavior.
For the exact template-function surface, use the maintained template-function compatibility matrix. It records the upstream versions, every Helm-visible function, and the explicit disposition for gaps.
Compatibility contract
A behavior is treated as supported when it:
- is reachable through a documented managed API;
- has focused automated coverage;
- behaves consistently across
net8.0,net9.0, andnet10.0; - matches Helm where the rendered output, release state, or failure behavior is observable by users.
Exact CLI colors, progress text, terminal formatting, and plugin execution are not compatibility goals unless they affect chart output or automation.
Capability snapshot
| Area | Current level | What it means for users |
|---|---|---|
Chart loading from directories and .tgz archives | Supported | Safe starting point for render and packaging tools. Covered by fixture and public-chart tests. |
Values files and --set-style overrides | Partial | Common flows work; edge-case coercion and list syntax still tracked by golden tests. |
| Helm-style template rendering | Supported | Common parsing, control flow, named templates, built-in objects, whitespace/trim markers, and selected Sprig functions have focused coverage. An unimplemented function fails with a path-aware rendering diagnostic. |
Template control flow (if/else if/else/range/with) | Supported | All control-flow constructs render correctly against helm template output, validated by dedicated fixture charts and real-chart golden tests. |
| Named templates and helpers | Supported | Cross-template define/template/include calls are covered by dedicated fixtures and public charts with extensive helper usage. |
Built-in objects (.Release, .Chart, .Values, .Files, .Capabilities, .Template) | Supported | All built-in objects are populated and render consistently with Helm CLI output. |
| Chart packaging and repositories | Partial | Useful APIs exist; archive and repository edge cases remain. |
| Install, upgrade, rollback, uninstall | Supported | Managed lifecycle flows persist deployed, superseded, failed, and retained-uninstall revisions; support operation-wide timeouts, atomic recovery, rollback reservations, and deterministic hooks. Unsupported Helm options fail before mutation. |
| Kubernetes apply, delete, wait | Supported (selective readiness) | Typed endpoints and cluster discovery cover apply and delete; upgrades use three-way ownership merge; 12 resource kinds have explicit Helm-aligned readiness predicates while other kinds pass through after apply. Server-side apply and operator-specific CR readiness remain unsupported. |
| Release history in Kubernetes Secrets | Supported | Release records can be persisted without Helm CLI. |
| OCI registry | Planned | Registry authentication and chart push/pull parity are not complete. |
| Chart provenance | Partial | OpenPGP signing and trusted-key verification are available; see Chart provenance and signing for requirements and limits. |
Kubernetes apply and cleanup contract
This matrix describes current behavior. #258 was delivered by PR #270; the ownership behavior below is available subject to its baseline and list limits. See the Action API and Kube API for the referenced options and methods.
| Area | Current behavior and boundary | Evidence |
|---|---|---|
| Namespace and scope | An explicit manifest namespace wins over the default; cluster-scoped resources have no namespace. CreateNamespace defaults to true and creates a missing target namespace. | Identity and namespace tests |
| Discovery | Common kinds use typed endpoints; other kinds use cluster discovery and its scope. Apply uses the declared API version and briefly retries registration lag. Delete can use another served version in the same group; unsupported core kinds and exhausted direct-delete discovery fail. | Discovery tests, delete tests |
| Create and update | The applier creates absent objects and replaces existing ones. Direct ApplyAsync has no prior release baseline. Upgrades with a prior manifest use the three-way behavior below; new resources and reinstall after uninstall have no such baseline. | Applier tests, merge tests, lifecycle tests |
| Apply modes | Lifecycle operations reject HelmExecutionOptions.ServerSideApply = true before mutation; a nonempty request ServerSideApply, Force, and TakeOwnership are also rejected. Field manager is sent for discovered create/replace paths, not typed resources; it does not enable server-side apply. | Lifecycle validation test, applier tests |
| Delete and propagation | Direct deletion and release cleanup process manifests in reverse order. Direct deletion defaults to Background; uninstall's DeletionPropagation also supports Foreground and Orphan. Rollback and hook cleanup use background. An object 404 is success; other API errors stop deletion with resource identity. | Delete tests, lifecycle tests |
| Keep policy | Uninstall and rollback cleanup filter helm.sh/resource-policy: keep; direct DeleteAsync does not interpret it. The annotation cannot prevent Kubernetes cascading deletion when an owner or namespace is removed. | Lifecycle tests, uninstall test |
| Hook cleanup | Policies are before-hook-creation (default), hook-succeeded, and hook-failed; cleanup waits for absence and uses background propagation. Successful hooks are cleaned in reverse after the batch; failures and cancellation trigger bounded finalization. CRD hooks are never deleted by policy. DisableHooks skips execution and cleanup. | Hook tests, failure tests, disable test |
For cleanup failure handling and lifecycle options, see release workflows; for direct calls and discovery errors, see Kubernetes operations; for a compiled end-to-end configuration, see configure waits, Jobs, and cleanup.
Kubernetes readiness, wait, timeout, and cancellation contract
KubernetesResourceWaiter implements deterministic polling aligned with Helm's ReadyChecker (#148, #233, #234, and #259). As delivered in #259, a Pod in CrashLoopBackOff remains pending rather than failing immediately.
Waited resource kinds
| API version and kind | Ready condition | Pending / terminal failure boundary | Evidence |
|---|---|---|---|
apps/v1 Deployment | spec.paused == true, or observedGeneration == generation, a controller-owned ReplicaSet matching spec.template (ignoring pod-template-hash) has observed its generation, and readyReplicas >= desired - maxUnavailable (Recreate requires all replicas; RollingUpdate defaults to 25% surge up / 25% unavailable down, forcing 1 unavailable if both resolve to 0). | Stale generation, missing ReplicaSet, insufficient ready replicas, and ProgressDeadlineExceeded stay pending until timeout; no immediate terminal failure. | Deployment parity tests, kind readiness test |
apps/v1 StatefulSet | observedGeneration == generation and either updateStrategy.type != "RollingUpdate" (for example OnDelete), or updatedReplicas >= max(0, desired - partition), readyReplicas == desired, and (when partition == 0) currentRevision == updateRevision. | Stale generation, incomplete partition rollout, unready replicas, or mismatched revisions stay pending until timeout. | StatefulSet parity tests |
apps/v1 DaemonSet | observedGeneration == generation and either updateStrategy.type != "RollingUpdate", or updatedNumberScheduled == desiredNumberScheduled and numberReady >= desired - maxUnavailable (default 1 when desired > 0, percentages rounded up, unparseable value falls back to desired). | Stale generation, unscheduled updates, or insufficient ready pods stay pending until timeout. | DaemonSet parity tests |
apps/v1 ReplicaSet | observedGeneration == generation and every Pod matching spec.selector reports Ready=True. | Stale generation or any unready selected Pod stays pending until timeout. | ReplicaSet parity tests |
v1 ReplicationController | observedGeneration == generation and every Pod matching spec.selector reports Ready=True. | Stale generation or any unready selected Pod stays pending until timeout. | ReplicationController parity tests |
v1 Pod | Condition Ready=True. | Terminal failure: status.phase == "Failed". Pending (#259): CrashLoopBackOff and other non-Ready states keep polling until Ready=True or timeout; timeout diagnostics preserve Pod in CrashLoopBackOff. | Pod parity tests, CrashLoopBackOff tests |
batch/v1 Job | Skipped immediately (without querying the API) when WaitForJobs is false. When WaitForJobs is true: ready on Complete=True, unset spec.completions, or status.succeeded >= spec.completions. | Terminal failure (when WaitForJobs is true): status.failed > spec.backoffLimit (default 6) or condition Failed=True. Otherwise pending until completions are met. | Job parity tests, WaitForJobs tests |
v1 PersistentVolumeClaim | status.phase == "Bound". | Terminal failure: status.phase == "Lost". Other phases stay pending until timeout. | PVC parity tests |
v1 Service | ExternalName is ready immediately; other types require non-empty spec.clusterIP; LoadBalancer also requires spec.externalIPs or status.loadBalancer.ingress. | Missing clusterIP or pending LoadBalancer ingress stays pending until timeout. | Service parity tests, waiter Service test |
v1 Endpoints | At least one subset contains one or more ready addresses. | Empty subsets or only notReadyAddresses stays pending until timeout. | Endpoints parity tests |
apiextensions.k8s.io/v1 & v1beta1 CustomResourceDefinition | Read through its declared API version; ready on Established=True or NamesAccepted=False (matching Helm so naming conflicts do not hang install). | Other conditions or absent conditions stay pending until timeout. | CRD parity tests, beta CRD test |
autoscaling/v2 HorizontalPodAutoscaler | Condition ScalingActive=True. | Terminal failure: ScalingActive=False. Missing conditions stay pending. autoscaling/v1 HPA is not polled and passes through as ready immediately. | HPA parity tests |
All other kinds (ConfigMap, Secret, ServiceAccount, Ingress, CronJob, autoscaling/v1 HPA, PodDisruptionBudget, EndpointSlice, RBAC, custom resource instances, unknown kinds) | Accepted as ready immediately once applied; never queried by WaitForReadyAsync. | No readiness signal is inferred for operator-managed custom resources; add application-level health checks where needed. | Non-waitable skip tests |
Wait controls, hooks, timeout, cancellation, and cleanup boundaries
| Area | Current behavior and limitation | Evidence |
|---|---|---|
| Wait strategy and API retries | WaitForReadyAsync polls every 3s; WaitForDeletedAsync and Pod hook completion poll every 1s. Helm's legacy status-watcher strategy is not implemented or exposed. A 404 during readiness waiting resets error counts and stays pending (Resource not found yet). Other read errors back off linearly (min(30s, 3s * consecutiveErrors)) and throw KubernetesResourceOperationException after more than 10 consecutive failures; WaitForDeletedAsync throws immediately on non-404/non-missing-kind API errors. | Waiter polling and retry tests, deletion wait tests |
| Job and Pod hook waits | Hooks run sequentially by weight, then name/kind/path. Job hooks always wait for completion (waitForJobs: true). Pod hooks poll every 1s until status.phase == "Succeeded" or "Failed" (completion, not Ready=True). Other hook kinds are applied without a completion observer. DisableHooks = true skips hook execution and cleanup. | Hook Job and Pod tests, Pod hook completion test, kind hook tests |
| Timeout controls | TimeoutSeconds must be > 0 on KubernetesResourceWaiter, HelmUpgradeInstallRequest, and HelmRollbackRequest (zero/negative throws ArgumentOutOfRangeException); omitted uses HelmExecutionOptions.TimeoutSeconds (default 300s). WaitForJobs = true requires Wait or Atomic on install/upgrade (Wait on rollback). In HelmClient, one linked operation timeout covers apply, hooks, and waiting, so expiration throws TimeoutException (with last observed status) or OperationCanceledException (with caller token not canceled). On UninstallAsync, omitting TimeoutSeconds (null) skips the operation-wide token while hooks and Wait = true fall back to HelmExecutionOptions.TimeoutSeconds; a non-positive TimeoutSeconds also skips the operation-wide token and falls back for hooks, but throws ArgumentOutOfRangeException during Wait = true after resource deletion (before release-history persistence). On TestAsync, timeout marks the stalled hook FAILED and stops remaining hooks. | Timeout validation and diagnostics tests, uninstall timeout test, rollback timeout test, test-hook timeout test, kind wait-timeout test |
| Caller cancellation | The caller CancellationToken flows into every Kubernetes read and polling delay and propagates as OperationCanceledException rather than succeeding. On install/upgrade and rollback, cancellation before final persistence records a failed revision (and install/upgrade runs Atomic/CleanupOnFail recovery with CancellationToken.None). Once rollback finishes applying resources, its final deployed revision save completes independently of the operation token so history cannot retain two deployed revisions. | Waiter cancellation tests, deletion cancellation test, rollback cancellation tests |
| Hook and deletion cleanup limits | Hook failure/cancellation finalization shares one bounded window clamped to 2–10s across the cleanup batch and continues past individual delete failures, attaching cleanup errors to Exception.Data["HelmSharp.HookCleanupError"] without replacing the root failure. CRD hooks are never deleted by policy. WaitForDeletedAsync treats 404, removed discovered CRDs/APIs, and unsupported core kinds as absent; helm.sh/resource-policy: keep cannot stop Kubernetes namespace or owner cascading deletion. | Hook finalization tests, uninstall wait test, removed-API deletion wait tests |
Upgrade resource ownership
For resources present in the previously deployed release manifest, HelmClient upgrades compare that recorded manifest, the newly rendered chart manifest, and the live Kubernetes object. Live-only fields, live deletions, and live edits to fields unchanged by the chart are preserved. Chart changes take effect, and a chart-removed field is removed even when its live value was edited. Kubernetes-managed fields such as resourceVersion, uid, and status remain cluster-authoritative. Lists at known Kubernetes map-list paths and CRD paths declared with list-map keys merge item by item; other lists are atomic and follow chart output. Resources without a prior manifest entry, reinstall-after-uninstall, and direct KubernetesManifestApplier.ApplyAsync calls use the desired manifest for replacement and do not have a three-way ownership baseline. This behavior is covered through the install/upgrade lifecycle path; see the focused merge and lifecycle tests.
Known boundaries
These are the areas to check before betting a production workflow on exact Helm behavior:
- obscure values coercion and edge-case list syntax;
- OCI authentication and registry flows;
- provenance interoperability outside the documented signing and verification workflows;
- Sprig functions or Go-template behaviors outside the implemented surface;
- readiness for uncommon Kubernetes resource kinds;
- safe replacement for Helm plugin execution.
Golden tests demonstrate only the behavior they exercise. New charts can surface unimplemented functions, parsing edge cases, or manifest differences, so compatibility reports should include a minimal chart and the equivalent Helm CLI command.
How to report a gap
Open a compatibility issue with:
- Helm CLI and HelmSharp versions;
- a minimal chart and values input;
- the exact Helm command and output;
- the equivalent HelmSharp API call and output;
- whether the difference affects rendering, release state, or cluster mutation.
Small reproducible charts are more useful than screenshots or large private charts.
Continuous validation
Golden test results are validated on every push and pull request through the CI workflow. The CI runner installs Helm CLI (v4.2.2) alongside the .NET SDKs and executes the full golden test suite, including both fixture-chart and real-chart comparisons. JSON reports are published as workflow artifacts for each run.
Kubernetes apply, wait, hook, rollback, uninstall, and release-Secret behavior is additionally proven against a disposable kind cluster. See the kind lifecycle test lane for coverage, how to trigger it, and how to interpret failure artifacts.