Setting up the Helm CLI

Use the Helm command line interface (CLI) to manage packages 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

  1. Download the Helm executable binary file. You can obtain the helm binary file from the IBM Cloud Private package or download the binary from the Helm GitHub site.

    To download the Helm binary from the IBM Cloud Private package, run the command that matches your client node architecture.

    • For Linux® 64-bit, run the following command:

      docker run -e LICENSE=accept --net=host -v /usr/local/bin:/data ibmcom/icp-helm-api:1.0.0 cp /usr/src/app/public/cli/linux-amd64/helm /data
      
    • For Linux® on Power® 64-bit LE, run the following command:

      docker run -e LICENSE=accept --net=host -v /usr/local/bin:/data ibmcom/icp-helm-api:1.0.0 cp /usr/src/app/public/cli/linux-ppc64le/helm /data
      
    • For MacOS, run the following command:

      docker run -e LICENSE=accept --net=host -v /usr/local/bin:/data ibmcom/icp-helm-api:1.0.0 cp /usr/src/app/public/cli/darwin-amd64/helm /data
      
    • For Windows, run the following command:

      docker run -e LICENSE=accept --net=host -v /usr/local/bin:/data ibmcom/icp-helm-api:1.0.0 cp /usr/src/app/public/cli/windows-amd64/helm.exe /data
      

    To download the Helm v2.7.2 binary from the Helm GitHub site, see Helm 2.7.2 Opens in a new tab.

  2. Add the Helm executable binary file to your PATH.

    • For Linux and MacOS, set the HELM_HOME and move the file to the /usr/local/bin folder.
      export HELM_HOME=/root/.helm
      mv helm /usr/local/bin
      
    • For Windows, add the folder path where you have the helm binary to the system variable path.
  3. Provide the certificate. You can either provide the certificate for the cluster administrator or a certificate for a specific user that is assigned the operator or administrator role for a team and can access the kube-system namespace. Any user that has a role of operator, administrator, or cluster administrator, can complete these steps to generate a certificate.

    To provide the certificate, take the following actions:

    1. Install the IBM Cloud Private CLI. See Installing the IBM Cloud Private CLI.
    2. Log in to your cluster:

      bx pr login -a https://<master_ip_address>:8443 --skip-ssl-validation
      

      Where master_ip_address is the external IP address for your master or leading master node.

    3. Find the name of your cluster.

      bx pr clusters
      
    4. Configure your cluster.

      bx pr cluster-config <clustername>
      

      When you configure your cluster, cert.pem and key.pem certificates are added to the ~/.helm directory.

Verifying the installation

  1. Initialize your Helm CLI.

    • 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
      
  2. Verify that the Helm CLI is initialized. Run the following command:

     helm version --tls
    

    The output resembles the following code:

     Client: &version.Version{SemVer:"v2.7.2", GitCommit:"5bc7c619f85d74702e810a8325e0a24f729aa11a", GitTreeState:"dirty"}
    
     Server: &version.Version{SemVer:"v2.7.2", GitCommit:"5bc7c619f85d74702e810a8325e0a24f729aa11a", GitTreeState:"clean"}
    
  3. 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 packages:

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

       helm install --name=package_name stable/package_in_repo --tls
      

      In this command, package_name is the name for the package, and package_in_repo is the name of the available package to install. For example, to install the WordPress package, run the following command:

       helm install --name=my-wordpress stable/wordpress --tls
      
    4. List installed packages:

       helm list --tls
      

      The output resembles the following code:

       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 package, run the following command:

       helm delete package_name --purge --tls
      

      In this command, package_name is the name of the package to remove. For example, to remove the WordPress package, run this command:

       helm delete my-wordpress --purge --tls