Helm charts

Deploy a Helm chart from a git directory, give each deployment its own values, and know exactly how Wardn renders a chart and which Helm features apply.

A Helm app renders a chart the way helm template would, on the Wardn server, and stores the objects as a snapshot. Wardn never runs helm install in your cluster and keeps no Helm release there: the operator applies the rendered objects itself, so there is no release history, no Helm hooks run as hooks and no helm upgrade to fight. You keep the chart in git, set the differences between staging and production as values on the deployments, and Wardn does the rest.

Read Apps first for how apps, values and renders fit together. If you used Argo CD or Flux for Helm, the short version is: the chart is rendered once per commit and values, the result is stored, and what you promote from staging to production is that stored result, not the chart.

A chart in your repository

Point an app's Path at the directory that holds Chart.yaml.

Chart.yaml
values.yaml
deployment.yaml
service.yaml

Create the source and the app

In the web app, open /apps/new, choose A new repository, Git repository, paste the URL and set Path to deploy/web. Under App, name it web and choose Helm for Rendered with (the form starts there). With the API:

api() { curl -fsS -H "Authorization: Bearer $WARDN_TOKEN" -H 'Content-Type: application/json' "$@"; }

SOURCE_ID=$(api -X POST "$WARDN_API_URL/api/v1/sources" \
  -d '{"name": "shop-web", "kind": "git", "url": "https://github.com/example/shop", "path": "deploy/web"}' | jq -r .id)

APP_ID=$(api -X POST "$WARDN_API_URL/api/v1/apps" -d '{
  "name": "web",
  "sourceId": "'"$SOURCE_ID"'",
  "renderType": "helm",
  "defaultValues": {"replicaCount": 2, "image": {"repository": "registry.example.com/shop/web", "tag": "1.4.2"}}
}' | jq -r .id)

Give each deployment its own values

The chart's values.yaml and the app's defaultValues apply everywhere. What differs per deployment goes on the deployment, next to the app it overrides:

# Staging: the defaults, with one replica.
api -X POST "$WARDN_API_URL/api/v1/deployments" -d '{
  "name": "web-staging",
  "apps": [{"appId": "'"$APP_ID"'", "values": {"replicaCount": 1}}],
  "targetKind": "cluster", "clusterId": "'"$STAGING_CLUSTER_ID"'",
  "namespace": "shop", "arrival": "branch", "branch": "main"
}'

# Production: more replicas and a pinned tag.
api -X POST "$WARDN_API_URL/api/v1/deployments" -d '{
  "name": "web-production",
  "apps": [{"appId": "'"$APP_ID"'", "values": {"replicaCount": 6, "image": {"tag": "1.4.2"}}}],
  "targetKind": "cluster", "clusterId": "'"$PROD_CLUSTER_ID"'",
  "namespace": "shop", "arrival": "branch", "branch": "release"
}'

To change values later, replace them on the app in the deployment. The next render uses them:

api -X PUT "$WARDN_API_URL/api/v1/deployments/$DEPLOYMENT_ID/apps/$APP_ID" \
  -d '{"branch": "", "values": {"replicaCount": 8}}'

The call replaces both fields, so repeat the branch you want to keep. Needs deployment:manage.

Push, and read the snapshot

A push to the tracked branch renders the chart with the merged values and makes a snapshot. The snapshot records the values that were used and a digest of them, so you can see in Compare snapshots that a change came from values rather than from the chart.

The web app shows how many values a deployment overrides (N overrides here on the app's Settings tab) but does not edit them yet. Set app defaults and per-deployment values with the API, as above.

How a chart is rendered

DetailBehaviour
CommandThe equivalent of helm template --include-crds with Helm 3. Nothing is installed anywhere.
Release nameThe app's name. {{ .Release.Name }} is web for the app above, in every deployment.
NamespaceThe deployment's namespace. {{ .Release.Namespace }} is shop. Namespaced objects that name no namespace are put there when applied.
ValuesChart values.yaml, then the app's default values, then the deployment's values for the app. Maps merge, lists and scalars replace.
Cluster capabilitiesHelm's default API versions at the oldest Kubernetes version Wardn supports (v1.30, the minimum in Requirements), never your cluster's. The snapshot is promoted unchanged to every cluster, so a chart that branches on the version gets the branch every supported cluster can use. .Capabilities.APIVersions and the Kubernetes version do not depend on where the deployment runs, and lookup finds nothing. This is what makes one render valid for many clusters.
DeterminismThe chart is rendered twice and the results compared. A chart whose output changes between runs, for example through randAlphaNum or now, is refused with The chart renders differently each time.
Library chartsRefused: they have nothing to install.
SubchartsRendered, as long as they are in the chart's charts/ directory.

Dependencies must be in the chart

Wardn does not fetch anything while it renders. If Chart.yaml lists dependencies, run helm dependency build and commit the resulting charts/ directory (or publish the chart with them). A missing dependency fails the render with The chart's dependencies are not in its charts/ directory.

Hooks, tests and CRDs

  • Hooks are not run as hooks. The manifests of pre-install, post-install, pre-upgrade and similar hooks are rendered like any other object and applied with the rest. A hook Job therefore runs once and stays, instead of running at the right moment. For work before or after an apply, use Wardn's own jobs, which also support undo and failure policies.
  • Test hooks are dropped. Objects whose hook events include a test, as helm test runs them, are not part of the snapshot.
  • CRDs in crds/ are rendered, as --include-crds does. A CustomResourceDefinition is cluster-scoped, and the operator refuses a snapshot that holds a cluster-scoped object. The same happens to a custom resource whose CRD is not in the cluster yet, because its scope is unknown. Install a chart's CRDs once, outside Wardn, and keep them out of the chart Wardn renders (for example by splitting them into a chart of their own that you install with Helm or kubectl). See Connect a cluster.

A chart that creates a Namespace, a ClusterRole or a ClusterRoleBinding cannot be applied by Wardn. The operator applies as a namespaced service account and refuses the whole snapshot with nothing applied. Create those objects yourself, once, or change the chart to make them optional.

Charts from an OCI registry

An OCI source (oci://registry.example.com/charts/web) holds a packaged chart, and an app on it must render as Helm. The code to pull a chart exists, but this release has nothing that starts a render of an OCI source: pushes and the one-minute check watch git only, so a deployment on a chart source never receives a snapshot. Use a git directory for charts you want Wardn to deploy. OCI sources will become usable when chart versions can trigger renders.

Secrets in values

Values are stored in the snapshot, in clear text, with everything else the render used. Do not put a password or token in values.yaml, in an app's default values or in a deployment's values. Keep secrets in the cluster, or in a store that External Secrets Operator reads, and have the chart refer to the Secret by name.

Troubleshooting

SymptomCheck
The deployment stays on its last snapshot after a push.The render failed. GET /deployments/{id} shows the app's renderStatus as pending. Run helm template on the same commit and values locally to find the error.
The chart does not render: ...Helm's own error, for example a missing required value. Set it in the app's default values.
The snapshot is Held for review with no objects.Path does not point at the chart directory, or every template is conditional on a value that is off. See Held snapshots.
Production differs from staging in more than the values.They track different branches or commits. Compare the two snapshots, or promote staging's snapshot so production runs exactly what staging ran.

Next

Related: Apps, Jobs and waves, Compare snapshots.

On this page