Setting up the Helm CLI

You can use the Helm command line interface (CLI) to manage releases in your cluster.

For more information about Helm, see https://github.com/kubernetes/helm/tree/master/docs Opens in a new tab.

Because IBM Cloud Private offers role-based access control, you must install a specific version of the Helm CLI client and provide certificates that contain the IBM Cloud Private access token for a specific account.

Important: After you configure a connection, you must add the --tls option to Helm commands that access the server through Tiller.

Before you set up the Helm CLI, you must complete the following steps:

Installing the Helm CLI

You can install the Helm CLI by downloading it from the Helm GitHub site. Complete the following steps to install the Helm CLI:

  1. Download the Helm v2.9.1 binary. For more details to download the Helm v2.9.1 binary from the Helm GitHub site, see Helm 2.9.1 Opens in a new tab.

  2. Make a helm-unpacked directory and unpack the installation file into that directory with the following commands:

    mkdir helm-unpacked
    
    tar -xvzf ./<path_to_installer> -C helm-unpacked
    
  3. Change the file to an executable, then move the file to your directory:

    • For Linux and MacOS, run the following commands to change and move the file:

      chmod 755 ./helm-unpacked/<unpacked_dir>/helm
      
      sudo mv ./helm-unpacked/<unpacked_dir>/helm /usr/local/bin/helm
      
    • For Windows, rename the downloaded file to helm and place the file in a directory that is listed in the PATH environment variable.

  4. Delete the installer and extra unpacked archives:

     rm -rf ./helm-unpacked ./<path_to_installer>
    

See github.com/helm Opens in a new tab for additional information about the installation procedure.

Verifying the installation

  1. If you are using Helm 2.9.1, you must set HELM_HOME:

     export HELM_HOME=~/.helm
    
  2. Initialize your Helm CLI. Important: Do not use the --upgrade flag with the helm init command. Adding the --upgrade flag replaces the server version of Helm Tiller that is installed with IBM Cloud Private.

    • For environments with Internet access, run the following command:

      helm init --client-only
      
    • For environments that do not have Internet access, run the following command:

      helm init --client-only --skip-refresh
      
  3. Verify that the Helm CLI is initialized. Run the following command:

     helm version --tls
    

    The output resembles the following content:

     Client: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}
    
     Server: &version.Version{SemVer:"v2.9.1+icp", GitCommit:"843201eceab24e7102ebb87cb00d82bc973d84a7", GitTreeState:"clean"}
    
  4. Follow the steps to review a list of available or installed packages:

    1. Add a Helm repository. To add the Kubernetes Incubator repository, run the following command:

       helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
      
    2. View the available charts by running the following command:

       helm search -l
      
    3. Install a chart. Run the following command:

       helm install --name=release_name stable/chart_in_repo --tls
      

      In this command, release_name is the name for the release to be created from the chart, and chart_in_repo is the name of the available chart to install. For example, to install the WordPress chart, run the following command:

       helm install --name=my-wordpress stable/wordpress --tls
      
    4. List releases by running the following command:

       helm list --tls
      

      The output resembles the following content:

       NAME                REVISION    UPDATED                     STATUS      CHART                  NAMESPACE
       my-wordpress        1           Wed Jun 28 22:15:13 2017    DEPLOYED    wordpress-0.6.5        default
      
    5. To remove a release, run the following command:

       helm delete release_name --purge --tls
      

      In this command, release_name is the name of the release to remove. For example, to remove the WordPress release, run the following command:

       helm delete my-wordpress --purge --tls