This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 3. Helm CLI
3.1. Getting started with Helm 3 on OpenShift Container Platform 링크 복사링크가 클립보드에 복사되었습니다!
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/.
3.1.1. 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.
3.1.1.1. 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.
3.1.2. Installing Helm 링크 복사링크가 클립보드에 복사되었습니다!
Prerequisites
- You have installed Go, version 1.13 or higher.
3.1.2.1. On Linux 링크 복사링크가 클립보드에 복사되었습니다!
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
# curl -L https://mirror.openshift.com/pub/openshift-v4/clients/helm/latest/helm-linux-amd64 -o /usr/local/bin/helm
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Make the binary file executable:
chmod +x /usr/local/bin/helm
# chmod +x /usr/local/bin/helm
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check the installed version:
helm version
$ helm version version.BuildInfo{Version:"v3.0", GitCommit:"b31719aab7963acf4887a1c1e6d5e53378e34d93", GitTreeState:"clean", GoVersion:"go1.13.4"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1.2.2. On Windows 7/8 링크 복사링크가 클립보드에 복사되었습니다!
-
Download the latest
.exe
file and put in a directory of your preference. - Right click Start and click Control Panel.
- Select System and Security and then click System.
- From the menu on the left, select Advanced systems settings and click Environment Variables at the bottom.
- Select Path from the Variable section and click Edit.
-
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.
3.1.2.3. On Windows 10 링크 복사링크가 클립보드에 복사되었습니다!
-
Download the latest
.exe
file and put in a directory of your preference. -
Click Search and type
env
orenvironment
. - Select Edit environment variables for your account.
- Select Path from the Variable section and click Edit.
- 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.
3.1.2.4. On MacOS 링크 복사링크가 클립보드에 복사되었습니다!
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
# curl -L https://mirror.openshift.com/pub/openshift-v4/clients/helm/latest/helm-darwin-amd64 -o /usr/local/bin/helm
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Make the binary file executable:
chmod +x /usr/local/bin/helm
# chmod +x /usr/local/bin/helm
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check the installed version:
helm version
$ helm version version.BuildInfo{Version:"v3.0", GitCommit:"b31719aab7963acf4887a1c1e6d5e53378e34d93", GitTreeState:"clean", GoVersion:"go1.13.4"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1.3. 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
Create a new project:
oc new-project mysql
$ oc new-project mysql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add a repository of Helm charts to your local Helm client:
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
$ helm repo add stable https://kubernetes-charts.storage.googleapis.com/ "stable" has been added to your repositories
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Update the repository:
helm repo update
$ helm repo update
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install an example MySQL chart:
helm install example-mysql stable/mysql
$ helm install example-mysql stable/mysql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the chart has installed successfully:
helm list
$ 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
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1.4. Creating a custom Helm chart on OpenShift Container Platform 링크 복사링크가 클립보드에 복사되었습니다!
Procedure
Create a new project:
oc new-project nodejs-ex-k
$ oc new-project nodejs-ex-k
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Download an example Node.js chart that contains OpenShift Container Platform objects:
git clone https://github.com/redhat-developer/redhat-helm-charts
$ git clone https://github.com/redhat-developer/redhat-helm-charts
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Go to the directory with the sample chart:
cd redhat-helm-charts/alpha/nodejs-ex-k/
$ cd redhat-helm-charts/alpha/nodejs-ex-k/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
Chart.yaml
file and add a description of your chart:apiVersion: v2 name: nodejs-ex-k description: A Helm chart for OpenShift icon: https://static.redhat.com/libs/redhat/brand-assets/latest/corp/logo.svg
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 Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the chart is formatted properly:
helm lint
$ helm lint [INFO] Chart.yaml: icon is recommended 1 chart(s) linted, 0 chart(s) failed
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the chart:
cd .. helm install nodejs-chart nodejs-ex-k
$ cd .. $ helm install nodejs-chart nodejs-ex-k
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the chart has installed successfully:
helm list
$ 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
Copy to Clipboard Copied! Toggle word wrap Toggle overflow