Skip to content

Latest commit

 

History

History
341 lines (217 loc) · 10.4 KB

helm.md

File metadata and controls

341 lines (217 loc) · 10.4 KB

Helm

Description

Helm helps you manage Kubernetes applications — Helm Charts help you define, install, and upgrade even the most complex Kubernetes application.

Directory

References


Installation

Description

This details how to install Helm on your system.

References

Steps

  1. Helm should be available in your software repository by default. Install the helm package using your package manager (i.e. apt).

  2. Alternatively, you can install Helm through source:

    • Clone the Helm repository to your home directory:

      git clone https://github.com/helm/helm.git ~/.helm
    • Enter the local Helm repository (i.e. ~/.helm):

      cd ~/.helm
    • Build the Helm binary:

      make

Helm Chart Repository

Description

This details how to add, update, or remove a Helm chart repository on your system and query available Helm charts to install.

References

Adding Chart Repository

This details how to add a Helm chart repository to your system:

  1. Use the following command to add a public Helm chart repository to your system:

    helm repo add <repo> <repo-source>

    Replace <repo> and <repo-source> with the (arbitrary) name of the chart repository (i.e. examples) and the source of the repository (i.e. https://helm.github.io/examples) respectively. For example:

    helm repo add examples https://helm.github.io/examples
  2. Alternatively, if the Helm chart repository is private, you can use the following command to add it to your system:

    helm repo add <repo> <repo-source> --username <repo-user> --password <repo-password>

    Replace <repo-user> and <repo-password> with the right user credentials which has access to the Helm chart repository.

  3. Update the chart repository to ensure it is up-to-date.

Update Chart Repository

This details how to update a Helm chart repository on your system:

  1. Use the following command to update a Helm chart repository on your system:

    helm repo update <repo>

    Replace <repo> with the name of the chart repository (i.e. examples). For example:

    helm repo update examples
  2. Alternatively, remove the chart repository name from the same command to update all Helm chart repositories on your system:

    helm repo update

Remove Chart Repository

This details how to remove a Helm chart repository from your system:

  1. Use the following command to remove a Helm chart repository from your system:

    helm repo remove <repo>

    Replace <repo> with the name of the chart repository (i.e. examples). For example:

    helm repo remove examples
  2. (Optional) To remove more than one chart repository, simply add their names each separated by a space:

    helm repo remove <repo1> <repo2>
  3. Verify the Helm chart repository has been removed by listing available Helm chart repositories on your system:

    helm repo list

Helm Charts

Description

This details how to search or deploy a Helm chart.

References

Get Helm Charts

This details how to show available Helm charts from a Helm chart repository:

  1. Use the following command to show available Helm charts from a Helm chart repository on your system:

    helm search repo <repo>

    Replace <repo> with the name of the chart repository (i.e. examples). For example:

    helm search repo examples
  2. Alternatively, remove the chart repository name from the same command to show available Helm charts from all Helm chart repositories on your system:

    helm search repo

Install or Upgrade a Helm Chart

Note

This section of the guide assumes that you have added a Helm chart repository to your system.

This details how to install a Helm chart or upgrade an existing Helm release:

  1. Prepare the values file (i.e. values.yaml) for the Helm chart or release you wish to install or upgrade.

  2. Use the following command to install or upgrade a Helm chart:

    helm upgrade --install --wait --kube-context <cluster> --namespace <namespace> <release> <chart-repo>/<chart> --values values.yaml

    Replace <cluster>, <namespace>, <release>, <chart-repo>, and <chart> with the name of the cluster (i.e. my-cluster), namespace (i.e. default), release (i.e. hello-world-app), chart repository (i.e. examples), and chart itself (i.e. hello-world) respectively. For example:

    helm upgrade --install --wait --kube-context my-cluster --namespace default hello-world-app examples/hello-world --values values.yaml
  3. (Optional) If you wish to deploy the Helm chart to a specific namespace you have not created, simply include the following flag to the same command:

    --create-namespace
  4. (Optional) If you wish to deploy the Helm chart of a specific version, simply include the following flag to the same command:

    --version <chart-version>

    Replace <chart-version> with the version number (i.e. 0.1.0) of the Helm chart to deploy.

Uninstall a Helm Release

Caution

Uninstalling a Helm release will irreversibly delete all the resources associated with it, including any persistent data.

This details how to remove or uninstall a Helm release you have deployed:

  1. Uninstall the Helm release from the cluster by using the following command:

    helm uninstall --wait --kube-context <cluster> --namespace <namespace> <release>

    Replace the <cluster>, <namespace>, and <release> placeholders with the same values you had used to deploy it. For example:

    helm uninstall --wait --kube-context my-cluster --namespace default hello-world-app
  2. Verify that the Helm release has been removed by listing all Helm releases on the namespace:

    helm ls --kube-context <cluster> --namespace <namespace> | grep "<release>"

    If this command returns nothing, the Helm release has been removed successfully.


Helm Values

Description

This details how to get Helm values from a Helm chart or deployment (release).

References

Get Helm Chart Values

This details how to get the default Helm values from a Helm chart:

  1. Use the following command to get the default values of a Helm chart:

    helm show values <chart-repo>/<chart>

    Replace <chart-repo> and <chart> with the name of the chart repository (i.e. examples) and chart itself (i.e. hello-world) respectively. For example:

    helm show values examples/hello-world

    If you need the values of a specific chart version, simply include the version number (i.e. 0.1.0) to the command like so:

    helm show values <chart-repo>/<chart> --version <chart-version>
  2. (Optional) If you wish to save the values to a file, simply send it to the desired location (i.e. values.yaml):

    helm show values <chart-repo>/<chart> > values.yaml

Get Helm Release Values

This details how to get the values of a Helm release:

  1. Use the following command to get the values of a Helm release:

    helm --kube-context <cluster> --namespace <namespace> get values <release>

    Replace <cluster>, <namespace>, and <release> with the name of the cluster (i.e. my-cluster), namespace (i.e. default), and release (i.e. hello-world-app) respectively. For example:

    helm --kube-context my-cluster --namespace default get values hello-world-app
  2. (Optional) If you wish to save the values to a file, simply send it to the desired location (i.e. values.yaml):

    helm --kube-context <cluster> --namespace <namespace> get values <release> > values.yaml

Update Helm Values

This details how to update a Helm values file before installing or upgrading a release:

  1. If you are installing a Helm chart for the first time, get the Helm chart values (latest or of a specific version) as a values.yaml file.

    Alternatively, if you are upgrading an existing Helm release, get its Helm release values as a values.yaml file.

  2. Update the Helm values.yaml file with the intended configurations for your deployment:

    nano values.yaml

    Refer to the official documentations when possible and pay extra attention to the descriptions and sample values provided.

  3. Save changes made to the values file. Install or upgrade the intended Helm chart or release using the file to apply it.