2.12. 删除 Service Mesh

警告

查看不再支持的 Red Hat OpenShift Service Mesh 发行版本的文档。

Service Mesh 版本 1.0 和 1.1 control plane 不再被支持。有关升级服务网格 control plane 的详情,请参阅 升级 Service Mesh

有关特定 Red Hat OpenShift Service Mesh 发行版本的支持状态的信息,请参阅产品生命周期页面

要从现有的 OpenShift Container Platform 实例中删除 Red Hat OpenShift Service Mesh,请在删除 Operator 前删除 control plane。

2.12.1. 删除 Red Hat OpenShift Service Mesh control plane

要从现有的 OpenShift Container Platform 实例卸载 Service Mesh,首先删除 Service Mesh control plane 和 Operator。然后,您将运行命令来删除剩余的资源。

2.12.1.1. 使用 Web 控制台删除 Service Mesh control plane

您可以使用 Web 控制台删除 Red Hat OpenShift Service Mesh control plane。

流程

  1. 登陆到 OpenShift Container Platform Web 控制台。
  2. Project 菜单,选择安装 Service Mesh control plane 的项目,如 istio-system
  3. 导航到 OperatorsInstalled Operators
  4. Provided APIs 下的 Service Mesh Control Plane
  5. ServiceMeshControlPlane 菜单 kebab .
  6. Delete Service Mesh Control Plane
  7. 在确认窗口中点 Delete 删除 ServiceMeshControlPlane

2.12.1.2. 使用 CLI 删除 Service Mesh control plane

您可以使用 CLI 删除 Red Hat OpenShift Service Mesh control plane。在本例中,istio-system 是 control plane 项目的名称。

流程

  1. 登录 OpenShift Container Platform CLI。
  2. 运行以下命令以删除 ServiceMeshMemberRoll 资源。

    $ oc delete smmr -n istio-system default
  3. 运行这个命令来获得安装的 ServiceMeshControlPlane 的名称:

    $ oc get smcp -n istio-system
  4. 使用以上命令中的输出替换 <name_of_custom_resource>,运行这个命令来删除自定义资源:

    $ oc delete smcp -n istio-system <name_of_custom_resource>

2.12.2. 删除安装的 Operator

您必须删除 Operator 才可以成功删除 Red Hat OpenShift Service Mesh。删除 Red Hat OpenShift Service Mesh Operator 后,您必须删除 Kiali Operator、Red Hat OpenShift distributed tracing Platform Operator 和 OpenShift Elasticsearch Operator。

2.12.2.1. 删除 Operator

按照以下步骤删除组成 Red Hat OpenShift Service Mesh 的 Operator。对以下每个 Operator 重复上述步骤。

  • Red Hat OpenShift Service Mesh
  • Kiali
  • Red Hat OpenShift distributed tracing Platform
  • OpenShift Elasticsearch

流程

  1. 登陆到 OpenShift Container Platform Web 控制台。
  2. OperatorsInstalled Operators 页面中,滚动页面或在 Filter by name 中输入关键字以查找每个 Operator。然后点击 Operator 名称。
  3. Operator Details 页面中,从 Actions 菜单中选择 Uninstall Operator。按照提示卸载每个 Operator。

2.12.2.2. 清理 Operator 资源

在使用 OpenShift Container Platform Web 控制台删除 Red Hat OpenShift Service Mesh Operator 后,按照以下步骤手动删除遗留的资源。

先决条件

  • 具有集群管理访问权限的帐户。
  • 访问 OpenShift CLI(oc)。

流程

  1. 以集群管理员身份登录到 OpenShift Container Platform CLI。
  2. 在卸载 Operators 后运行以下命令清理资源。如果您希望继续使用 Jaeger 作为没有 service mesh 的独立服务,请不要删除 Jaeger 资源。

    注意

    默认情况下,Operator 安装在 openshift-operators 命名空间中。如果在另一个命名空间中安装了 Operator,将 openshift-operators 替换为安装了 Red Hat OpenShift Service Mesh Operator 的项目的名称。

    $ oc delete validatingwebhookconfiguration/openshift-operators.servicemesh-resources.maistra.io
    $ oc delete mutatingwebhookconfiguration/openshift-operators.servicemesh-resources.maistra.io
    $ oc delete -n openshift-operators daemonset/istio-node
    $ oc delete clusterrole/istio-admin clusterrole/istio-cni clusterrolebinding/istio-cni
    $ oc delete clusterrole istio-view istio-edit
    $ oc delete clusterrole jaegers.jaegertracing.io-v1-admin jaegers.jaegertracing.io-v1-crdview jaegers.jaegertracing.io-v1-edit jaegers.jaegertracing.io-v1-view
    $ oc get crds -o name | grep '.*\.istio\.io' | xargs -r -n 1 oc delete
    $ oc get crds -o name | grep '.*\.maistra\.io' | xargs -r -n 1 oc delete
    $ oc get crds -o name | grep '.*\.kiali\.io' | xargs -r -n 1 oc delete
    $ oc delete crds jaegers.jaegertracing.io
    $ oc delete svc admission-controller -n <operator-project>
    $ oc delete project <istio-system-project>