Skip to main content

Installing and Configuring Helm

1. Installing Helm CLI

Platform Installation Method Command Notes
macOS Homebrew brew install helm Installs latest stable version
Linux (x86_64) Script curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && chmod 700 get_helm.sh && ./get_helm.sh Downloads and installs Helm binary
Windows Chocolatey choco install kubernetes-helm Installs latest stable version
Windows Manual Download https://github.com/helm/helm/releases/latest Download and extract helm.exe

Example: Verify Installation

helm version

2. Verifying Helm Installation

Check Description Command Expected Output
Helm version Verify Helm is installed and check version helm version Helm semantic version (e.g., v3.12.0)
Kubernetes context Ensure Helm can communicate with Kubernetes cluster kubectl cluster-info Kubernetes API server URL and status
Tiller (if used) Check for Tiller pod in kube-system namespace (deprecated in v3+) kubectl get pods -n kube-system | grep tiller Pod name and status (if Tiller is present)

Example: Helm version check

$ helm version
© v3.12.0
Note: Helm v3+ does not require Tiller, so this check is only relevant for older versions.

3. Configuring Repository Settings

Repository URL Notes
stable https://charts.helm.sh/stable Official stable charts repository
incubator https://charts.helm.sh/incubator Community incubated charts
bitnami https://charts.bitnami.com/bitnami Bitnami charts repository

Example: Adding a repository

helm repo add my-repo https://my-chart-repo.example.com

Example: Listing repositories

helm repo list

Example: Updating repositories

helm repo update
Note: Helm repositories are used to store and share charts. You can add, list, and update repositories using the helm repo command.

4. Setting Up Kubeconfig Context

Example: Configure kubeconfig for a cluster

helm repo add stable https://charts.helm.sh/stable
helm repo update
kubectl config view
kubectl config use-context my-cluster
Command Description Notes
kubectl config view Displays current kubeconfig settings Shows all contexts, users, and clusters
kubectl config use-context <context-name> Sets the current context to the specified one Used to switch between different Kubernetes clusters
kubectl config get-contexts Lists all available contexts Helps identify which cluster you are currently targeting
Note: Ensure that the kubeconfig file has proper permissions (e.g., chmod 600 ~/.kube/config) to prevent unauthorized access.
Warning: Switching contexts without verifying the target cluster can lead to unintended deployments or deletions.

5. Configuring Helm Environment Variables

Environment Variable Description Default Value Notes
HELM_HOME Path to the Helm configuration directory $HOME/.helm Deprecated in Helm 3, use HELM_CONFIG_HOME
HELM_CONFIG_HOME Path to the Helm config directory $HOME/.helm Replaces HELM_HOME in Helm 3+
HELM_CACHE_HOME Path to the Helm cache directory $HOME/.cache/helm Used for caching chart dependencies and repositories
HELM_DATA_HOME Path to the Helm data directory $HOME/.local/share/helm Used for storing Helm data like plugin binaries
HELM_DEBUG Enable debug logging false Set to true for verbose logging
HELM_PLUGINS Path to the Helm plugins directory $HOME/.helm/plugins Used to find Helm plugins
HELM_REGISTRY_CONFIG Path to the registry config file $HELM_CONFIG_HOME/registry.json Used for OCI registry authentication
HELM_REPOSITORY_CONFIG Path to the repositories file $HELM_CONFIG_HOME/repositories.yaml Stores Helm repository configurations
HELM_REPOSITORY_CACHE Path to the repositories cache directory $HELM_CACHE_HOME/repository Stores cached repository index files
HELM_MAX_HISTORY Maximum number of release history entries to keep 10 Set to 0 to keep all history

Example: Setting Environment Variables

export HELM_CONFIG_HOME="/etc/helm"
export HELM_CACHE_HOME="/var/cache/helm"
export HELM_DEBUG=true
Note: Helm 3+ uses the XDG Base Directory specification for configuration and cache directories by default. These environment variables can override those defaults.

6. Setting Default Namespace

Option Values Description
--namespace string Sets the default namespace for all Helm operations
--kube-context string Specifies the kubeconfig context to use for setting namespace

Example: Setting Default Namespace

helm install my-app ./my-chart --namespace production
Note: The default namespace can also be set in the helm configuration file or via environment variables.

7. Configuring Helm Cache Directory

Configuration Option Default Value Description
helm home $HOME/.helm Root directory for Helm configuration and cache
helm cache directory $HELM_HOME/cache Directory where Helm stores cached chart data

Example: Setting Helm Cache Directory

export HELM_CACHE_HOME=/custom/cache/path
helm repo update
Note: The HELM_CACHE_HOME environment variable overrides the default cache directory. This is useful for managing multiple Helm installations or customizing cache locations for performance.

8. Setting Up Helm Plugins Directory

Helm plugins are extensions that add new commands or functionality to the Helm CLI. To manage and organize these plugins effectively, you should configure a dedicated directory for them.

Configuration Description Default Value Notes
HELM_PLUGINS Environment variable to set the plugins directory path $HOME/.helm/plugins Can be overridden to any custom path

Example: Setting Plugins Directory via Environment Variable

export HELM_PLUGINS=/opt/helm/plugins
helm plugin install https://github.com/example/plugin.git
Note: Ensure the directory specified by HELM_PLUGINS has appropriate permissions for Helm to read and write plugin files.
Warning: If HELM_PLUGINS is not set, Helm will use the default directory under $HOME/.helm/plugins. Changing this path may affect plugin discovery and execution.

9. Configuring Helm Data Directory

Configuration Option Default Value Description
dataDir /var/lib/helm Directory where Helm stores its data, including charts and releases.

Example: Setting Helm Data Directory

helm init --data-dir /custom/helm/data
Note: Ensure the specified directory has appropriate permissions for Helm to read and write data.

10. Configuring Helm Config Directory

Helm uses a configuration directory to store its settings and cache. By default, this directory is located at ~/.helm on Unix-like systems and %APPDATA%\helm on Windows.

Configuration Default Path Description
config ~/.helm Root directory for Helm configuration files
cache ~/.helm/cache Cache directory for downloaded chart archives
repository ~/.helm/repository Repository cache directory

Example: Setting Helm Config Directory

helm --config-dir /custom/helm/config init
Note: The --config-dir flag can be used to override the default configuration directory for all Helm commands in a session.

Was this article helpful?