Helm Developer Guide translated. (#975)

* Helm Developer Guide translated.

Signed-off-by: Felixnoo <felixliu@yunify.com>

* EN update

Signed-off-by: Felixnoo <felixliu@yunify.com>
This commit is contained in:
Felixnoo 2021-01-19 15:13:49 +08:00 committed by GitHub
parent 2e4a96cb2e
commit f7293130e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 29 deletions

View File

@ -6,7 +6,7 @@ linkTitle: "Helm Developer Guide"
weight: 14410
---
You can upload the Helm chart of an app to KubeSphere so that tenants with necessary permissions can deploy it. This tutorial demonstrates how prepare Helm charts using NGINX as an example.
You can upload the Helm chart of an app to KubeSphere so that tenants with necessary permissions can deploy it. This tutorial demonstrates how to prepare Helm charts using NGINX as an example.
## Install Helm

View File

@ -1,5 +1,5 @@
---
linkTitle: "Application Developer Guide"
linkTitle: "应用开发者指南"
weight: 14400
_build:

View File

@ -1,20 +1,20 @@
---
title: "Helm Developer Guide"
keywords: 'Kubernetes, KubeSphere, helm, development'
description: 'Helm developer guide'
linkTitle: "Helm Developer Guide"
title: "Helm 开发者指南"
keywords: 'Kubernetes, KubeSphere, Helm, 开发'
description: 'Helm 开发者指南'
linkTitle: "Helm 开发者指南"
weight: 14410
---
You can upload the Helm chart of an app to KubeSphere so that tenants with necessary permissions can deploy it. This tutorial demonstrates how prepare Helm charts using NGINX as an example.
您可以上传应用的 Helm Chart 至 KubeSphere以便具有必要权限的租户能够进行部署。本教程以 NGINX 为示例演示如何准备 Helm Chart。
## Install Helm
## 安装 Helm
If you have already installed KubeSphere, then Helm is deployed in your environment. Otherwise, refer to the [Helm documentation](https://helm.sh/docs/intro/install/) to install Helm first.
如果您已经安装 KubeSphere那么您的环境中已部署 Helm。如果未安装请先参考 [Helm 文档](https://helm.sh/docs/intro/install/)安装 Helm。
## Create a Local Repository
## 创建本地仓库
Execute the following commands to create a repository on your machine.
执行以下命令在您的机器上创建仓库。
```bash
mkdir helm-repo
@ -24,9 +24,9 @@ mkdir helm-repo
cd helm-repo
```
## Create an App
## 创建应用
Use `helm create` to create a folder named `nginx`, which automatically creates YAML templates and directories for your app. Generally, it is not recommended to change the name of files and directories in the top level directory.
使用 `helm create` 创建一个名为 `nginx` 的文件夹,它会自动为您的应用创建 YAML 模板和目录。一般情况下,不建议修改顶层目录中的文件名和目录名。
```bash
$ helm create nginx
@ -43,9 +43,9 @@ nginx/
└── values.yaml
```
`Chart.yaml` is used to define the basic information of the chart, including name, API, and app version. For more information, see [Chart.yaml File](../helm-specification/#chartyaml-file).
`Chart.yaml` 用于定义 Chart 的基本信息包括名称、API 和应用版本。有关更多信息,请参见 [Chart.yaml 文件](../helm-specification/#chartyaml-文件)。
An example of the `Chart.yaml` file:
`Chart.yaml` 文件的示例:
```yaml
apiVersion: v1
@ -55,9 +55,9 @@ name: nginx
version: 0.1.0
```
When you deploy Helm-based apps to Kubernetes, you can edit the `values.yaml` file on the KubeSphere console directly.
当您向 Kubernetes 部署基于 Helm 的应用时,可以直接在 KubeSphere 控制台上编辑 `values.yaml` 文件。
An example of the `values.yaml` file:
`values.yaml` 文件的示例:
```yaml
# Default values for test.
@ -110,11 +110,11 @@ tolerations: []
affinity: {}
```
Refer to [Helm Specifications](../helm-specification/) to edit files in the `nginx` folder and save them when you finish editing.
请参考 [Helm 规范](../helm-specification/)对 `nginx` 文件夹中的文件进行编辑,完成编辑后进行保存。
## Create an Index File (Optional)
## 创建索引文件(可选)
To add a repository with an HTTP or HTTPS URL in KubeSphere, you need to upload an `index.yaml` file to the object storage in advance. Use Helm to create the index file by executing the following command in the previous directory of `nginx`.
要在 KubeSphere 中使用 HTTP 或 HTTPS URL 添加仓库,您需要事先向对象存储上传一个 `index.yaml` 文件。在 `nginx` 的上一个目录中使用 Helm 执行以下命令,创建索引文件。
```bash
helm repo index .
@ -127,15 +127,15 @@ index.yaml nginx
{{< notice note >}}
- If the repository URL is S3-styled, an index file will be created automatically in the object storage when you add apps to the repository.
- 如果仓库 URL 是 S3 格式,您向仓库添加应用时会自动在对象存储中创建索引文件。
- For more information about how to add repositories to KubeSphere, see [Import an Helm Repository](../../../workspace-administration/app-repository/import-helm-repository/).
- 有关何如向 KubeSphere 添加仓库的更多信息,请参见[导入 Helm 仓库](../../../workspace-administration/app-repository/import-helm-repository/)。
{{</ notice >}}
## Package the Chart
## 打包 Chart
Go to the previous directory of `nginx` and execute the following command to package your chart which creates a .tgz package.
前往 `nginx` 的上一个目录,执行以下命令打包您的 Chart这会创建一个 .tgz 包。
```bash
helm package nginx
@ -146,12 +146,13 @@ $ ls
nginx nginx-0.1.0.tgz
```
## Upload Your App
## 上传您的应用
Now that you have your Helm-based app ready, you can load it to KubeSphere and test it on the platform.
现在您已经准备好了基于 Helm 的应用,您可以将它上传至 KubeSphere 并在平台上进行测试。
## See Also
## 另请参见
[Helm Specifications](../helm-specification/)
[Helm 规范](../helm-specification/)
[导入 Helm 仓库](../../../workspace-administration/app-repository/import-helm-repository/)
[Import an Helm Repository](../../../workspace-administration/app-repository/import-helm-repository/)