Search⌘ K
AI Features

Add Dependencies to a Helm Chart

Explore how to add dependencies to your Helm charts by integrating a PostgreSQL database chart into an app chart. Learn to modify Chart.yaml and values.yaml files, manage repository versions, and install Helm releases with dependent charts. This lesson helps you streamline complex Kubernetes deployments by bundling necessary components efficiently.

We'll cover the following...

Add dependencies to a Helm chart

In this lesson, we’ll refactor the generic app chart and see the pros and cons each approach has. We’ll start from something simple: We define the postgres chart as a dependency to the app chart, so instead of running a separate command to install the PostgreSQL database we can specify it in values.yaml.

To add such a dependency we need to modify the Chart.yaml file by adding the dependencies property:

YAML
apiVersion: v2
name: app
description: A Helm chart for Kubernetes
type: application
version: 0.1.0
appVersion: "1.16.0"
dependencies:
- name: postgresql
version: 12.1.6
repository: "https://charts.bitnami.com/bitnami"
condition: database.enabled

It’s a list of objects for which we need to specify the following:

  • name: This is the original name of the chart.
  • version: This is the version of the chart (it’s version, not appVersion, the field from Chart.yaml).
...