istio.io/content/zh/docs/setup/install/helm/index.md

5.6 KiB
Raw Blame History

title linktitle description weight keywords owner test
使用 Helm 安装 使用 Helm 安装 安装、配置并深入评估 Istio。 30
kubernetes
helm
istio/wg-environments-maintainers yes

请遵循本指南使用 Helm 安装和配置 Istio 网格。

安装步骤

  1. 为 Istio 组件,创建命名空间 istio-system :

    {{< text syntax=bash snip_id=create_istio_system_namespace >}} $ kubectl create namespace istio-system {{< /text >}}

  2. 安装 Istio base chart它包含了 Istio 控制平面用到的集群范围的资源:

    {{< warning >}} 执行修订版安装时base chart 需要设置 --defaultRevision 值以使资源验证起作用。 有关 --defaultRevision 选项的更多信息可以在 Helm 升级文档中找到。 {{< /warning >}}

    {{< text syntax=bash snip_id=install_base >}} $ helm install istio-base istio/base -n istio-system {{< /text >}}

  3. 安装 Istio discovery chart它用于部署 istiod 服务:

    {{< text syntax=bash snip_id=install_discovery >}} $ helm install istiod istio/istiod -n istio-system --wait {{< /text >}}

  4. (可选)安装 Istio 的入站网关:

    {{< text syntax=bash snip_id=install_ingressgateway >}} $ kubectl create namespace istio-ingress $ kubectl label namespace istio-ingress istio-injection=enabled $ helm install istio-ingress istio/gateway -n istio-ingress --wait {{< /text >}}

    请参阅安装网关以获得关于网关安装的详细文档。

    {{< warning >}} 网关被部署的命名空间不得具有 istio-injection=disabled 标签。 有关更多信息,请参见控制注入策略。 {{< /warning >}}

    {{< tip >}} 有关如何使用 Helm 后期渲染器自定义 Helm chart 的详细文档, 请参见高级 Helm Chart 自定义。 {{< /tip >}}

验证安装

安装状态可以通过 Helm 进行验证:

{{< text syntax=bash snip_id=none >}} $ helm status istiod -n istio-system {{< /text >}}

更新 Istio 配置

你可以用自己的安装参数,覆盖掉前面用到的 Istio Helm chart 的默认行为, 然后按照 Helm 升级流程来定制安装你的 Istio 网格系统。 至于可用的配置项,你可以通过使用 helm show values istio/<chart> 来找到配置。 例如:helm show values istio/gateway

从非 Helm 安装迁移

如果你需要将使用 istioctl 或 Operator 安装的 Istio 迁移到 Helm 那要删除当前 Istio 控制平面资源,并根据上面的说明,使用 Helm 重新安装 Istio。 在删除当前 Istio 时,前外不能删掉 Istio 的客户资源定义CRDs以免丢掉你的定制 Istio 资源。

{{< warning >}} 建议:从集群中删除 Istio 前,使用上面的说明备份你的 Istio 资源。 {{< /warning >}}

依据你的安装方式,选择 Istioctl 卸载指南Operator 卸载指南

卸载

您可以通过卸载上述安装的 chart以便卸载 Istio 和及其组件。

  1. 列出在命名空间 istio-system 中安装的所有 Istio chart

    {{< text syntax=bash snip_id=helm_ls >}} $ helm ls -n istio-system NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION istio-base istio-system 1 ... ... ... ... deployed base-1.0.0 1.0.0 istiod istio-system 1 ... ... ... ... deployed istiod-1.0.0 1.0.0 {{< /text >}}

  2. (可选)删除 Istio 的所有网关 chart

    {{< text syntax=bash snip_id=delete_delete_gateway_charts >}} $ helm delete istio-ingress -n istio-ingress $ kubectl delete namespace istio-ingress {{< /text >}}

  3. 删除 Istio discovery chart

    {{< text syntax=bash snip_id=helm_delete_discovery_chart >}} $ helm delete istiod -n istio-system {{< /text >}}

  4. 删除 Istio base chart

    {{< tip >}} 从设计角度而言,通过 Helm 删除 chart 并不会删除通过该 chart 安装的 CRD。 {{< /tip >}}

    {{< text syntax=bash snip_id=helm_delete_base_chart >}} $ helm delete istio-base -n istio-system {{< /text >}}

  5. 删除命名空间 istio-system

    {{< text syntax=bash snip_id=delete_istio_system_namespace >}} $ kubectl delete namespace istio-system {{< /text >}}

卸载稳定的修订版标签资源

如果你决定继续使用旧的控制平面不更新,您可以通过第一次发布来卸载较新的版本及其标记 helm template istiod istio/istiod -s templates/revision-tags.yaml --set revisionTags={prod-canary} --set revision=canary -n istio-system | kubectl delete -f -。 您必须按照上述卸载步骤卸载 Istio 的修订版。

如果您使用就地升级安装了此版本的网关,则还必须手动重新安装上一个版本的网关,移除以前的版本及其标记不会自动恢复以前就地升级的网关。

(可选)删除 Istio 安装的 CRD

永久删除 CRD 会移除您在集群中已创建的所有 Istio 资源。 用下面命令永久删除集群中安装的 Istio CRD

{{< text syntax=bash snip_id=delete_crds >}} $ kubectl get crd -oname | grep --color=never 'istio.io' | xargs kubectl delete {{< /text >}}