卸载 Alauda Build of OpenTelemetry v2

您可以从 Alauda Container Platform 中卸载 Alauda Build of OpenTelemetry v2 Operator 及其资源。您可以通过 Alauda Container Platform Web 控制台或命令行界面(CLI)执行此操作。此外,您还可以选择删除 OpenTelemetry 自定义资源定义(CRD)。

通过 Web 控制台卸载

从 Alauda Container Platform 卸载 Alauda Build of OpenTelemetry v2 Operator 需要删除以下组件:

  • Instrumentation 资源
  • OpenTelemetryCollector 资源
  • Alauda Build of OpenTelemetry v2 Operator

您也可以选择删除 OpenTelemetry 自定义资源定义(CRD)。

可以使用 Alauda Container Platform Web 控制台卸载 Alauda Build of OpenTelemetry v2 Operator。

操作步骤

删除 Instrumentation 资源

  1. 在 Alauda Container Platform Web 控制台中,导航到 Administrator。
  2. 选择 Marketplace > OperatorHub。
  3. 搜索 Alauda Container Platform Application Observability 插件(对于重命名之前发布的软件包,该插件显示为 Alauda Build of OpenTelemetry v2)。
  4. 找到 Alauda Container Platform Application Observability 插件(或 Alauda Build of OpenTelemetry v2),并单击以选中它。
  5. 单击 All Instances 选项卡。
  6. 在 Filter by instance type 下拉列表中,选择 Instrumentation。
  7. 单击每个 Instrumentation 资源对应的“⋮”按钮,然后在菜单中单击 Delete。
  8. 出现提示时,单击 Delete 确认操作。

删除 OpenTelemetryCollector 资源

在 OperatorHub 的 Alauda Container Platform Application Observability 视图中(对于重命名之前发布的软件包,该视图显示为 Alauda Build of OpenTelemetry v2):

  1. 单击 All Instances 选项卡。
  2. 在 Filter by instance type 下拉列表中,选择 OpenTelemetryCollector。
  3. 单击每个 OpenTelemetryCollector 资源对应的“⋮”按钮,然后在菜单中单击 Delete。
  4. 出现提示时,单击 Delete 确认操作。

卸载 Alauda Build of OpenTelemetry v2 Operator

在 OperatorHub 的 Alauda Container Platform Application Observability 视图中(对于重命名之前发布的软件包,该视图显示为 Alauda Build of OpenTelemetry v2):

  1. 单击右上角的 Uninstall 按钮。
  2. 在确认提示中,阅读卸载通知:删除 operator 不会删除其任何自定义资源定义或托管资源。如果您已创建资源实例,则需要手动删除它。
  3. 单击 Uninstall。

通过 CLI 卸载

要从 Alauda Container Platform 卸载 Alauda Build of OpenTelemetry v2 Operator,必须删除以下内容:

  • Instrumentation 资源
  • OpenTelemetryCollector 资源
  • Alauda Build of OpenTelemetry v2 Operator

此外,您还可以选择删除 OpenTelemetry 自定义资源定义(CRD)。

可以使用 Alauda Container Platform 命令行界面(CLI)卸载 Alauda Build of OpenTelemetry v2 Operator。

操作步骤

删除 Instrumentation 资源

  1. 执行以下命令获取 Instrumentation 资源:

    kubectl get instrumentation --all-namespaces

    示例输出

    NAMESPACE      NAME      AGE    ENDPOINT   SAMPLER                    SAMPLER ARG
    <namespace>   <name>     1d                parentbased_traceidratio   1
  2. 使用上一条命令输出中的命名空间和名称替换 <namespace> 和 <name>,然后运行以下命令删除每个资源:

    kubectl delete instrumentation/<name> -n <namespace>

    示例输出

    instrumentation.opentelemetry.io "<name>" deleted

删除 OpenTelemetryCollector 资源

  1. 执行以下命令获取 OpenTelemetryCollector 资源:

    kubectl get opentelemetrycollector --all-namespaces

    示例输出

    NAMESPACE      NAME     MODE         VERSION   READY   AGE     IMAGE     MANAGEMENT
    <namespace>    <name>   deployment   0.146.0   1/1     3h38m   <image>   managed
  2. 使用上一条命令输出中的命名空间和名称替换 <namespace> 和 <name>,然后运行以下命令删除每个资源:

    kubectl delete opentelemetrycollector/<name> -n <namespace>

    示例输出

    opentelemetrycollector.opentelemetry.io "<name>" deleted

卸载 Alauda Build of OpenTelemetry v2 Operator

  1. 删除 opentelemetry-operator2 订阅:

    kubectl delete subscription opentelemetry-operator2 -n opentelemetry-operator2

    示例输出

    subscription.operators.coreos.com "opentelemetry-operator2" deleted

删除 OpenTelemetry 自定义资源定义

删除 OpenTelemetry 自定义资源定义(CRD)是可选操作。

操作步骤

  1. 要删除 OpenTelemetry CRD,请执行以下命令:

    kubectl get crds -oname | grep opentelemetry.io | xargs kubectl delete