Feedback

Chat Icon

Helm in Practice

Designing, Deploying, and Operating Kubernetes Applications at Scale

Understanding Complex Helm Charts: Dependencies, CRDs, Lifecycle, Ordering, and Hooks
65%

The Overall Installation Workflow

To summarize and put everything together, we can outline the complete workflow that occurs when you run helm install to create a new release. These are the steps:

Chart Retrieval and Preparation: Helm finds the chart, either locally or by fetching it from a repository. It loads the chart's templates and default values, then merges in any user-provided values (from --set or --values files). At this stage, Helm also ensures any dependencies are in place (downloading subcharts listed in Chart.yaml if they're not already in the charts/ directory).

CRD Installation: Before rendering normal templates, Helm installs any CRDs packaged in the chart's crds/ directory. It sends each CRD YAML to the Kubernetes API server (skipping those that exist).

This is done only on the initial install, since upgrades don't reapply CRDs, as discussed.

Template Rendering: Helm now renders all the templates in the chart (and its dependencies) using the combined values. This produces the final Kubernetes manifest YAMLs for all resources.

Pre-Install Hooks: Before creating the regular resources, Helm checks for any templates annotated with pre-install. If present, these hook resources are sorted by weight and then created one by one.

All pre-install hooks must succeed (and their jobs reach completion) for the install to continue. If a hook resource fails, Helm will report the install as failed. (You can optionally specify hook deletion policies to clean up these resources, as seen earlier.)

Main Resource Installation: After hooks, Helm installs the chart's main Kubernetes resources (those defined in the non-hook templates). Importantly, Helm does not simply create resources in an arbitrary order; it sorts all manifests by resource kind/type to ensure a proper creation order. For example, Namespace and CRD resources are applied before Deployments or Pods. The general install order was outlined earlier.

Once all resources are successfully created via the Kubernetes API, Helm can optionally wait for them to become ready (--wait).

Waiting (optional)

Helm in Practice

Designing, Deploying, and Operating Kubernetes Applications at Scale

Enroll now to unlock current content and receive all future updates for free. Your purchase supports the author and fuels the creation of more exciting content. Act fast, as the price will rise as the course nears completion!

Unlock now  $15.99$11.99

Hurry! This limited time offer ends in:

To redeem this offer, copy the coupon code below and apply it at checkout:

Learn More