zh-translation: /docs/setup/install/helm/index.md (#5381)

* zh-translation: /docs/setup/install/helm/index.md

* update

* update
This commit is contained in:
wuzishu 2019-11-07 22:06:52 +08:00 committed by Istio Automation
parent e5e54b9b9e
commit fc9d73b608
1 changed files with 68 additions and 87 deletions

View File

@ -1,13 +1,13 @@
---
title: Customizable Install with Helm
description: Install and configure Istio for in-depth evaluation or production use.
title: 使用 Helm 自定义安装
description: 安装和配置 Istio 以进行深入评估或用于生产。
weight: 20
keywords: [kubernetes,helm]
aliases:
- /docs/setup/kubernetes/helm.html
- /docs/tasks/integrating-services-into-istio.html
- /docs/setup/kubernetes/helm-install/
- /docs/setup/kubernetes/install/helm/
- /zh/docs/setup/kubernetes/helm.html
- /zh/docs/tasks/integrating-services-into-istio.html
- /zh/docs/setup/kubernetes/helm-install/
- /zh/docs/setup/kubernetes/install/helm/
icon: helm
---
@ -20,72 +20,63 @@ window.onload = function(){
</script>
{{< warning >}}
The Helm installation approach has been deprecated.
Please use [Installing with {{< istioctl >}}](/docs/setup/install/istioctl/), instead.
Helm 的安装方法已被弃用。
请改用 [使用 {{< istioctl >}} 安装](/zh/docs/setup/install/operator/)。
{{< /warning >}}
Follow this guide to install and configure an Istio mesh for in-depth evaluation or production use.
请按照本指南安装和配置 Istio 网格,以进行深入评估或用于生产。
This installation guide uses [Helm](https://github.com/helm/helm) charts that provide rich
customization of the Istio control plane and of the sidecars for the Istio data plane.
You can simply use `helm template` to generate the configuration and then install it
using `kubectl apply`, or you can choose to use `helm install` and let
这种安装方式使用 [Helm](https://github.com/helm/helm) charts 自定义 Istio 控制平面和 Istio 数据平面的 sidecar。
你只需使用 `helm template` 生成配置并使用 `kubectl apply` 命令安装它, 或者你可以选择使用 `helm install`
[Tiller](https://helm.sh/docs/architecture/#components)
completely manage the installation.
来完全管理安装。
Using these instructions, you can select any one of Istio's built-in
[configuration profiles](/docs/setup/additional-setup/config-profiles/)
and then further customize the configuration for your specific needs.
通过这些说明, 您可以选择 Istio 内置的任何一个
[配置文件](/zh/docs/setup/additional-setup/config-profiles/)
并根据的特定的需求进行进一步的自定义配置。
## Prerequisites
## 先决条件
1. [Download the Istio release](/docs/setup/#downloading-the-release).
1. [下载 Istio 发行版](/zh/docs/setup/#downloading-the-release)。
1. 完成必要的 [Kubernetes 平台设置](/zh/docs/setup/platform-setup/)。
1. 检查 [Pod 和服务的要求](/zh/docs/setup/additional-setup/requirements/)。
1. [安装高于 2.10 版本的 Helm 客户端](https://github.com/helm/helm#install)。
1. Perform any necessary [platform-specific setup](/docs/setup/platform-setup/).
## 添加 Helm chart 仓库
1. Check the [Requirements for Pods and Services](/docs/setup/additional-setup/requirements/).
1. [Install a Helm client](https://github.com/helm/helm#install) with a version higher than 2.10.
## Helm chart release repositories
The commands in this guide use the Helm charts that are included in the Istio release image.
If you want to use the Istio release Helm chart repository instead, adjust the commands accordingly and
add the Istio release repository as follows:
本指南的以下命令使用了包含 Istio 发行版镜像的 Helm charts。
如果要使用 Istio 发行版 Helm chart ,建议使用下面的命令添加 Istio 发行版仓库:
{{< text bash >}}
$ helm repo add istio.io https://storage.googleapis.com/istio-release/releases/{{< istio_full_version >}}/charts/
{{< /text >}}
## Installation steps
## 安装步骤
Change directory to the root of the release and then
choose one of the following two **mutually exclusive** options:
将目录切换到 Istio 发行版的根目录,然后在以下两个**互斥**选项选择一种安装:
1. To deploy Istio without using Tiller, follow the instructions for [option 1](/docs/setup/install/helm/#option-1-install-with-helm-via-helm-template).
1. To use [Helm's Tiller pod](https://helm.sh/) to manage your Istio release, follow the instructions for [option 2](/docs/setup/install/helm/#option-2-install-with-helm-and-tiller-via-helm-install).
1. 如果您不使用 Tiller 部署 Istio请查看 [方案 1](/zh/docs/setup/install/helm/#方案-1-使用-helm-template-命令安装)。
1. 如果您使用 [Helm 的 Tiller pod](https://helm.sh/) 来管理 Istio 发行版, 请查看 [方案 2](/zh/docs/setup/install/helm/#方案-2-在-helm-和-tiller-的环境中使用-helm-install-命令安装)。
{{< tip >}}
Istio, by default, uses `LoadBalancer` service object types. Some platforms do not support `LoadBalancer`
service objects. For platforms lacking `LoadBalancer` support, install Istio with `NodePort` support
instead with the flags `--set gateways.istio-ingressgateway.type=NodePort`
appended to the end of the Helm instructions in the installation steps below.
默认情况下Istio 使用 `LoadBalancer` 服务类型。 而有些平台是不支持 `LoadBalancer`
服务的。 对于不支持 `LoadBalancer` 服务类型的平台, 执行下面的步骤时,可以在 Helm 命令中加入 `--set gateways.istio-ingressgateway.type=NodePort` 选项,使用 `NodePort` 来替代 `LoadBalancer` 服务类型。
{{< /tip >}}
### Option 1: Install with Helm via `helm template`
### 方案 1: 使用 `helm template` 命令安装
Choose this option if your cluster doesn't have [Tiller](https://helm.sh/docs/architecture/#components)
deployed and you don't want to install it.
在您的集群没有按照 [Tiller](https://helm.sh/docs/architecture/#components)
而且您也不想安装它的情况下,选择此方案安装。
1. Create a namespace for the `istio-system` components:
1. 为 Istio 组件创建命名空间 `istio-system`
{{< text bash >}}
$ kubectl create namespace istio-system
{{< /text >}}
1. Install all the Istio
[Custom Resource Definitions](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions)
(CRDs) using `kubectl apply`:
1. 使用 `kubectl apply` 安装所有 Istio 的
[自定义资源](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions)
(CRDs)
{{< text bash >}}
$ helm template install/kubernetes/helm/istio-init --name istio-init --namespace istio-system | kubectl apply -f -
@ -93,13 +84,12 @@ deployed and you don't want to install it.
1. {{< boilerplate verify-crds >}}
1. Select a [configuration profile](/docs/setup/additional-setup/config-profiles/)
and then render and apply Istio's core components corresponding to your chosen profile.
The **default** profile is recommended for production deployments:
1. 选择一个 [配置文件](/zh/docs/setup/additional-setup/config-profiles/)
接着部署与您选择的配置文件相对应的 Istio 核心组件。
我们建议在生产环境使用**默认**的配置文件:
{{< tip >}}
You can further customize the configuration by adding one or more `--set <key>=<value>`
[Installation Options](/docs/reference/config/installation-options/) to the helm command.
您可以添加一个或多个 `--set <key>=<value>` 来进一步自定义 helm 命令的 [安装选项](/zh/docs/reference/config/installation-options/) 。
{{< /tip >}}
{{< tabset cookie-name="helm_profile" >}}
@ -141,14 +131,14 @@ $ helm template install/kubernetes/helm/istio --name istio --namespace istio-sys
{{< tab name="Istio CNI enabled" cookie-value="cni" >}}
Install the [Istio CNI](/docs/setup/additional-setup/cni/) components:
安装 [Istio CNI](/zh/docs/setup/additional-setup/cni/) 组件:
{{< text bash >}}
$ helm template install/kubernetes/helm/istio-cni --name=istio-cni --namespace=kube-system | kubectl apply -f -
{{< /text >}}
Enable CNI in Istio by setting `--set istio_cni.enabled=true` in addition to the settings for your chosen profile.
For example, to configure the **default** profile:
`--set istio_cni.enabled=true` 设置追加到 helm 命令上,来启用 Istio CNI 插件。
以 Istio **默认**配置文件为例:
{{< text bash >}}
$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system \
@ -159,28 +149,26 @@ $ helm template install/kubernetes/helm/istio --name istio --namespace istio-sys
{{< /tabset >}}
### Option 2: Install with Helm and Tiller via `helm install`
### 方案 2: 在 Helm 和 Tiller 的环境中使用 `helm install` 命令安装
This option allows Helm and
[Tiller](https://helm.sh/docs/architecture/#components)
to manage the lifecycle of Istio.
这个方案使用 Helm 和 [Tiller](https://helm.sh/docs/architecture/#components) 来对 Istio 的生命周期进行管理。
{{< boilerplate helm-security-warning >}}
1. Make sure you have a service account with the `cluster-admin` role defined for Tiller.
If not already defined, create one using following command:
1. 请确保您的集群的 Tiller 设置了 `cluster-admin` 角色的 Service Account。
如果还没有定义,请执行下面命令创建:
{{< text bash >}}
$ kubectl apply -f @install/kubernetes/helm/helm-service-account.yaml@
{{< /text >}}
1. Install Tiller on your cluster with the service account:
1. 使用 Service Account 在集群上安装 Tiller
{{< text bash >}}
$ helm init --service-account tiller
{{< /text >}}
1. Install the `istio-init` chart to bootstrap all the Istio's CRDs:
1. 安装 `istio-init` chart来启动 Istio CRD 的安装过程:
{{< text bash >}}
$ helm install install/kubernetes/helm/istio-init --name istio-init --namespace istio-system
@ -188,13 +176,13 @@ to manage the lifecycle of Istio.
1. {{< boilerplate verify-crds >}}
1. Select a [configuration profile](/docs/setup/additional-setup/config-profiles/)
and then install the `istio` chart corresponding to your chosen profile.
The **default** profile is recommended for production deployments:
1. 选择一个 [配置文件](/zh/docs/setup/additional-setup/config-profiles/)
接着部署与您选择的配置文件相对应的 `istio` 的核心组件。
我们建议在生成环境部署中使用**默认**配置文件:
{{< tip >}}
You can further customize the configuration by adding one or more `--set <key>=<value>`
[Installation Options](/docs/reference/config/installation-options/) to the helm command.
您可以添加一个或多个 `--set <key>=<value>` 来进一步定义 Helm 命令的
[安装选项](/zh/docs/reference/config/installation-options/)。
{{< /tip >}}
{{< tabset cookie-name="helm_profile" >}}
@ -236,14 +224,14 @@ $ helm install install/kubernetes/helm/istio --name istio --namespace istio-syst
{{< tab name="Istio CNI enabled" cookie-value="cni" >}}
Install the [Istio CNI](/docs/setup/additional-setup/cni/) chart:
安装 [Istio CNI](/zh/docs/setup/additional-setup/cni/) chart
{{< text bash >}}
$ helm install install/kubernetes/helm/istio-cni --name istio-cni --namespace kube-system
{{< /text >}}
Enable CNI in Istio by setting `--set istio_cni.enabled=true` in addition to the settings for your chosen profile.
For example, to configure the **default** profile:
`--set istio_cni.enabled=true` 设置追加到 helm 命令上,来启用 Istio CNI 插件。
以 Istio **默认**配置文件为例:
{{< text bash >}}
$ helm install install/kubernetes/helm/istio --name istio --namespace istio-system --set istio_cni.enabled=true
@ -253,25 +241,23 @@ $ helm install install/kubernetes/helm/istio --name istio --namespace istio-syst
{{< /tabset >}}
## Verifying the installation
## 验证安装
1. Referring to components table in
[configuration profiles](/docs/setup/additional-setup/config-profiles/),
verify that the Kubernetes services corresponding to your selected profile have been deployed.
1. 查询 [配置文件](/zh/docs/setup/additional-setup/config-profiles/) 的组件表,验证是否已部署了与您选择的配置文件相对应的 Kubernetes 服务
{{< text bash >}}
$ kubectl get svc -n istio-system
{{< /text >}}
1. Ensure the corresponding Kubernetes pods are deployed and have a `STATUS` of `Running`:
1. 确保相应的 Kubernetes Pod 已部署并且 `STATUS``Running`
{{< text bash >}}
$ kubectl get pods -n istio-system
{{< /text >}}
## Uninstall
## 卸载
- If you installed Istio using the `helm template` command, uninstall with these commands:
- 如果你使用 `helm template` 命令安装的 Istio使用如下命令卸载
{{< tabset cookie-name="helm_profile" >}}
@ -329,7 +315,7 @@ $ helm template install/kubernetes/helm/istio-cni --name=istio-cni --namespace=k
{{< /tabset >}}
- If you installed Istio using Helm and Tiller, uninstall with these commands:
- 如果您使用的Helm 和 Tiller 安装的 Istio,使用如下命令卸载:
{{< text bash >}}
$ helm delete --purge istio
@ -338,21 +324,16 @@ $ helm template install/kubernetes/helm/istio-cni --name=istio-cni --namespace=k
$ kubectl delete namespace istio-system
{{< /text >}}
## Deleting CRDs and Istio Configuration
## 删除 CRD 和 Istio 配置
Istio, by design, expects Istio's Custom Resources contained within CRDs to leak into the
Kubernetes environment. CRDs contain the runtime configuration set by the operator.
Because of this, we consider it better for operators to explicitly delete the runtime
configuration data rather than unexpectedly lose it.
Istio 的设计中,其自定义资源以 CRD 的形式存在于 Kubernetes 环境之中。CRD 中包含了运维过程中产生的运行时配置。正因如此,我们建议运维人员应该显式的对其进行删除,从而避免意外操作。
{{< warning >}}
Deleting CRDs permanently deletes any configuration changes that you have made to Istio.
CRD 的删除,意味着删掉所有的用户配置。
{{< /warning >}}
The `istio-init` chart contains all raw CRDs in the `istio-init/files` directory.
You can simply delete the CRDs using `kubectl`.
To permanently delete Istio's CRDs and the entire Istio configuration, run:
`istio-init` Chart 包含了 `istio-init/files` 目录中的所有原始 CRD。下载该 Chart 之后,可以简单的使用 `kubectl` 删除 CRD。要永久删除 Istio 的 CRD 以及所有 Istio 配置,请运行如下命令
{{< text bash >}}
$ kubectl delete -f install/kubernetes/helm/istio-init/files
{{< /text >}}
{{< /text >}}