This is a cache of https://docs.openshift.com/container-platform/4.3/cli_reference/helm_cli/getting-started-with-helm-on-openshift-container-platform.html. It is a snapshot of the page at 2024-11-23T02:16:26.455+0000.
Getting started with <strong>helm</strong> on OpenShift Container Platform - <strong>helm</strong> CLI | CLI tools | OpenShift Container Platform 4.3
×

helm 3 for OpenShift Container Platform is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

For more information about the support scope of Red Hat Technology Preview features, see https://access.redhat.com/support/offerings/techpreview/.

Understanding helm

helm is a command-line interface (CLI) tool that simplifies deployment of applications and services to OpenShift Container Platform clusters. helm uses a packaging format called charts. A helm chart is a collection of files that describes OpenShift Container Platform resources.

Key features

helm provides the ability to:

  • Search through a large collection of charts stored in the chart repository.

  • Modify existing charts.

  • Create your own charts with OpenShift Container Platform or Kubernetes resources.

  • Package and share your applications as charts.

Installing helm

Prerequisites
  • You have installed Go, version 1.13 or higher.

On Linux

  1. Download the helm binary and add it to your path:

    # curl -L https://mirror.openshift.com/pub/openshift-v4/clients/helm/latest/helm-linux-amd64 -o /usr/local/bin/helm
  2. Make the binary file executable:

    # chmod +x /usr/local/bin/helm
  3. Check the installed version:

    $ helm version
    version.BuildInfo{Version:"v3.0", GitCommit:"b31719aab7963acf4887a1c1e6d5e53378e34d93", GitTreeState:"clean", GoVersion:"go1.13.4"}

On Windows 7/8

  1. Download the latest .exe file and put in a directory of your preference.

  2. Right click Start and click Control Panel.

  3. Select System and Security and then click System.

  4. From the menu on the left, select Advanced systems settings and click Environment Variables at the bottom.

  5. Select Path from the Variable section and click Edit.

  6. Click New and type the path to the folder with the .exe file into the field or click Browse and select the directory, and click OK.

On Windows 10

  1. Download the latest .exe file and put in a directory of your preference.

  2. Click Search and type env or environment.

  3. Select Edit environment variables for your account.

  4. Select Path from the Variable section and click Edit.

  5. Click New and type the path to the directory with the exe file into the field or click Browse and select the directory, and click OK.

On MacOS

  1. Download the helm binary and add it to your path:

    # curl -L https://mirror.openshift.com/pub/openshift-v4/clients/helm/latest/helm-darwin-amd64 -o /usr/local/bin/helm
  2. Make the binary file executable:

    # chmod +x /usr/local/bin/helm
  3. Check the installed version:

    $ helm version
    version.BuildInfo{Version:"v3.0", GitCommit:"b31719aab7963acf4887a1c1e6d5e53378e34d93", GitTreeState:"clean", GoVersion:"go1.13.4"}

Installing a helm chart on an OpenShift Container Platform cluster

Prerequisites
  • You have a running OpenShift Container Platform cluster and you have logged into it.

  • You have installed helm.

Procedure
  1. Create a new project:

    $ oc new-project mysql
  2. Add a repository of helm charts to your local helm client:

    $ helm repo add stable https://kubernetes-charts.storage.googleapis.com/
    "stable" has been added to your repositories
  3. Update the repository:

    $ helm repo update
  4. Install an example MySQL chart:

    $ helm install example-mysql stable/mysql
  5. Verify that the chart has installed successfully:

    $ helm list
    NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
    example-mysql mysql 1 2019-12-05 15:06:51.379134163 -0500 EST deployed mysql-1.5.0 5.7.27

Creating a custom helm chart on OpenShift Container Platform

Procedure
  1. Create a new project:

    $ oc new-project nodejs-ex-k
  2. Download an example Node.js chart that contains OpenShift Container Platform objects:

    $ git clone https://github.com/redhat-developer/redhat-helm-charts
  3. Go to the directory with the sample chart:

    $ cd redhat-helm-charts/alpha/nodejs-ex-k/
  4. Edit the Chart.yaml file and add a description of your chart:

    apiVersion: v2 (1)
    name: nodejs-ex-k (2)
    description: A helm chart for OpenShift (3)
    icon: https://static.redhat.com/libs/redhat/brand-assets/latest/corp/logo.svg (4)
    1 The chart API version. It should be v2 for helm charts that require at least helm 3.
    2 The name of your chart.
    3 The description of your chart.
    4 The URL to an image to be used as an icon.
  5. Verify that the chart is formatted properly:

    $ helm lint
    [INFO] Chart.yaml: icon is recommended
    
    1 chart(s) linted, 0 chart(s) failed
  6. Install the chart:

    $ cd ..
    $ helm install nodejs-chart nodejs-ex-k
  7. Verify that the chart has installed successfully:

    $ helm list
    NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
    nodejs-chart nodejs-ex-k 1 2019-12-05 15:06:51.379134163 -0500 EST deployed nodejs-0.1.0  1.16.0