Skip to main content

Installing Charts

1. Installing Chart from Repository

Command Description Example
helm repo add Adds a chart repository to your local Helm client helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update Updates the list of charts from all repositories helm repo update
helm install Installs a chart from a repository helm install my-release bitnami/nginx

Example: Installing a Chart from Bitnami Repository

helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm install my-release bitnami/nginx
Note: The helm install command will create a new release with the name my-release using the bitnami/nginx chart.

2. Installing from Local Path

Option Values Description
--set key=value Set values on the command line (can be used multiple times)
--values values.yaml Specify values in a YAML file or URL
--namespace my-namespace Namespace to install the release into
--create-namespace true Create the namespace if it does not exist

Example: Installing a local chart

helm install my-release ./my-chart

Example: Installing with custom values

helm install my-release ./my-chart --set image.tag=v1.2.3

3. Installing from URL

Option Values Description
--url string URL to the chart archive (.tgz)
--namespace string Kubernetes namespace to install the chart into
--set key=value Set values on the command line (can be used multiple times)
--values file Path to a values file to override default settings

Example: Installing a Chart from URL

helm install my-release https://example.com/charts/my-chart-1.0.0.tgz --namespace default

Example: Installing with Custom Values

helm install my-release https://example.com/charts/my-chart-1.0.0.tgz --set image.tag=v2.0 --values ./custom-values.yaml
Note: Helm must be installed and configured to communicate with your Kubernetes cluster.

4. Installing from Archive

Option Values Notes
helm install helm install [RELEASE_NAME] [CHART_PATH] Install a chart from local archive or directory
--dry-run true Simulate installation without applying changes
--debug true Enable verbose logging during installation
--namespace default Namespace to install the release into
--values values.yaml Specify custom values file for chart configuration

Example: Installing a Chart Archive

helm install my-release ./my-chart-1.0.0.tgz

Example: Installing with Custom Values

helm install my-release ./my-chart-1.0.0.tgz --values custom-values.yaml
Note: The chart archive must be a valid .tgz file created using helm package.
Warning: Installing from local archives does not support automatic dependency resolution. Ensure all dependencies are already installed or included in the archive.

5. Generating Release Name

Property Description Default Value Notes
--generate-name Generates a name for the release false When set to true, Helm will generate a unique release name based on the chart's name
--name-template Template for generating the release name "" Allows customizing the release name using Go template syntax

Example: Using --generate-name

helm install --generate-name my-chart

Example: Using --name-template

helm install --name-template="{{ .Chart.Name }}-{{ randAlpha 5 }}" my-chart

6. Setting Custom Release Name

Option Values Description
--name release-name Sets the release name for the chart
--set key=value Set values on the command line (can be used multiple times)

Example: Setting a Custom Release Name

helm install my-release nginx
Note: If no release name is provided, Helm will auto-generate one based on the chart's name.

7. Installing in Specific Namespace

Option Values Description
--namespace string Install the chart into a specific namespace
--create-namespace bool Create the namespace if it does not exist

Example: Install Chart in Specific Namespace

helm install my-app ./my-chart --namespace production --create-namespace
Note: If --create-namespace is not used and the namespace does not exist, Helm will fail with an error.

8. Creating Namespace

Example: Create a Namespace

apiVersion: v1
kind: Namespace
metadata:
  name: production
  labels:
    environment: prod
Property Description Default
apiVersion API version of the resource v1
kind Type of the Kubernetes resource Namespace
metadata.name Name of the namespace Required
metadata.labels Labels to apply to the namespace {}
Note: Namespaces are used to organize and isolate resources in a Kubernetes cluster.

Workflow: Creating and Using a Namespace

  1. Create a namespace manifest file (e.g., namespace.yaml)
  2. Apply the manifest using kubectl apply -f namespace.yaml
  3. Verify the namespace was created with kubectl get namespaces
  4. Use the namespace in Helm chart values or via --namespace flag

9. Using Dry Run Mode

Dry run mode allows you to test the rendering of a Helm chart without actually installing or upgrading it. This is useful for validating your configuration before applying changes.

Flag Description Usage
--dry-run Simulates the installation or upgrade without making any changes helm install --dry-run my-release ./my-chart
--debug Enables debug output, useful in combination with --dry-run helm install --dry-run --debug my-release ./my-chart

Example: Dry run with debug output

helm install --dry-run --debug my-release ./my-chart
Note: The --dry-run flag does not interact with the Kubernetes API server, so it will not validate resource limits or other constraints that would be enforced during a real installation.

10. Waiting for Resources

Option Values Description
wait true Waits for all resources to be in a ready state before marking the release as successful
timeout 300s Timeout for waiting operations (default is 5 minutes)
wait.for all Specifies which resources to wait for (e.g., all, deployment, service)

Example: Waiting for Deployment

helm install my-release stable/nginx --wait --timeout 600s
Note: The --wait flag ensures that the command waits until all resources are ready before returning.
Warning: If resources fail to become ready within the timeout, Helm will mark the release as failed.

11. Setting Wait Timeout

Property Values Description
wait.timeout 300s Timeout for waiting for resources to be ready
wait.timeoutSeconds 300 Timeout in seconds for waiting for resources to be ready

Example: Setting Wait Timeout

helm install my-release stable/nginx --wait --timeout 600s
Note: The --timeout flag sets the maximum time to wait for any individual resource to become ready. If resources do not become ready within this timeout, the installation will fail.

12. Installing with Values

Field Description Example
--set Set values on the command line (can be used multiple times) --set name=John,age=30
--set-string Set string values on the command line (useful for strings that look like numbers) --set-string version=1.2.3
--values Specify a YAML file with values to override --values config.yaml
--file Specify a file containing values to override (alias for --values) --file overrides.yaml

Example: Setting Values via Command Line

helm install my-app stable/nginx --set image.tag=v1.2.3 --set service.port=8080

Example: Using a Values File

image:
  tag: v1.2.3
service:
  port: 8080
helm install my-app stable/nginx --values config.yaml
Note: Values provided via --set take precedence over values in --values files.

Was this article helpful?