Feedback

Chat Icon

Helm in Practice

Designing, Deploying, and Operating Kubernetes Applications at Scale

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

Handling Custom Resource Definitions (CRDs) in Helm

Custom Resource Definitions are cluster-wide extensions of the Kubernetes API. Helm treats them specially because CRDs must be installed before any custom resources that depend on them can be created.

Charts can include a top-level crds/ directory to hold CRD YAML files. When you run a helm install for such a chart, Helm will automatically install the CRD objects first, before rendering or installing the rest of the templates. These CRD files are not templated (no {{ }} expressions are allowed in crds/).

If a CRD already exists in the cluster, Helm skips installing it and prints a warning instead.

For example, the kube-prometheus-stack chart includes several CRDs for Prometheus and Alertmanager.

# Add the repository
helm repo add prometheus-community \
  https://prometheus-community.github.io/helm-charts

# Pull the chart
cd $HOME/
helm pull prometheus-community/kube-prometheus-stack --untar --version 79.12.0

# Inspect the crds/ directory
ls kube-prometheus-stack/charts/crds/

You can use --skip-crds if you want to prevent Helm from installing CRDs. This is useful if you want to manage CRDs separately or if they are already installed in the cluster.

# Dry run if you want to see what would happen

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