简体中文版经机器翻译而成,仅供参考。如与英语版出现任何冲突,应以英语版为准。

使用自动化脚本卸载Astra Data Store

要卸载Astra数据存储和控制平台、您需要删除工作负载、绑定、卷、导出策略、Astra数据存储集群、许可证、部署环境和Astra数据存储命名空间。

卸载可使用不同的方法完成:

使用自动化脚本卸载Astra Data Store

此过程使用自动脚本卸载Astra数据存储。

您需要什么? #8217 ;将需要什么
  • root 管理权限

Astra数据存储卸载过程将指导您完成以下高级步骤:

删除现有工作负载和绑定

卸载Astra数据存储之前、必须先删除以下内容

  • 使用Astra Data Store作为存储后端的所有应用程序工作负载

  • 使用Astra数据存储作为后端的Trident绑定

这样可以确保 Kubernetes 环境保持干净,这在重新安装时非常重要。

卸载 Astra Data Store 集群

要卸载Astra Data Store、您可以使用从NetApp支持站点下载的Astra Data Store tar文件中的`uninstall.sh`脚本。

  1. manifests 目录中找到 uninstall.sh

  2. 运行以下 sed 命令:

    sed -i -e 's~netappsdsoperator.yaml~astradsoperator.yaml~' uninstall.sh
  3. 运行以下脚本以指示要卸载的内容:

    ./uninstall.sh
    
    You must run this script with an argument specifying what should be uninstalled
    To uninstall the ADS cluster run ./uninstall.sh cluster
    To uninstall everything run ./uninstall all
  4. 如果您只想卸载集群,请输入 uninstall.sh <cluster>

    否则,如果要卸载所有内容,请输入 uninstall.sh

    注 大多数情况下,您将卸载所有内容。如果您稍后要重新部署集群,则可能只需要卸载集群。
  5. 在提示符处,确认要继续并输入 erasedata

    响应:

    ./uninstall.sh all
    
    Enter 'erasedata' to confirm you want proceed with the uninstall: erasedata
    +----------------------------------------------------+
    | Wed Feb  2 10:14:01 EST 2022                       |
    | ADS cluster uninstall started                      |
    +----------------------------------------------------+
    Deleting astradsvolumes
    Deleted astradsvolumes
    Deleting astradsexportpolicies
    Deleted astradsexportpolicies
    Deleting astradsvolumesnapshots
    Deleted astradsvolumesnapshots
    Deleting astradsclusters
    Deleting astradsclusters
    Deleting astradslicenses
    Deleted astradslicenses
    
    +----------------------------------------------------+
    | Wed Feb  2 10:15:18 EST 2022                       |
    | ADS cluster uninstall done                         |
    +----------------------------------------------------+
    
    +----------------------------------------------------+
    | Wed Feb  2 10:15:18 EST 2022                       |
    | ADS system uninstall started                       |
    +----------------------------------------------------+
    Removing astradsversion
    astradsversion.astrads.netapp.io "astradsversion" deleted
    Removed astradsversion
    Removing daemonsets
    daemonset.apps "astrads-ds-nodeinfo-astradsversion" deleted
    Removed daemonsets
    Removing deployments
    deployment.apps "astrads-cluster-controller" deleted
    deployment.apps "astrads-license-controller" deleted
    deployment.apps "astrads-operator" deleted
    Removed deployments
    Removing all other AstraDS resources
    namespace "astrads-system" deleted
    customresourcedefinition.apiextensions.k8s.io "astradsautosupports.astrads.netapp.io" deleted
    customresourcedefinition.apiextensions.k8s.io "astradscloudsnapshots.astrads.netapp.io" deleted
    customresourcedefinition.apiextensions.k8s.io "astradsclusters.astrads.netapp.io" deleted
    customresourcedefinition.apiextensions.k8s.io "astradsexportpolicies.astrads.netapp.io" deleted
    customresourcedefinition.apiextensions.k8s.io "astradsfaileddrives.astrads.netapp.io" deleted
    customresourcedefinition.apiextensions.k8s.io "astradslicenses.astrads.netapp.io" deleted
    customresourcedefinition.apiextensions.k8s.io "astradsnfsoptions.astrads.netapp.io" deleted
    customresourcedefinition.apiextensions.k8s.io "astradsnodeinfoes.astrads.netapp.io" deleted
    customresourcedefinition.apiextensions.k8s.io "astradsnodemanagements.astrads.netapp.io" deleted
    customresourcedefinition.apiextensions.k8s.io "astradsqospolicies.astrads.netapp.io" deleted
    customresourcedefinition.apiextensions.k8s.io "astradsversions.astrads.netapp.io" deleted
    customresourcedefinition.apiextensions.k8s.io "astradsvolumefiles.astrads.netapp.io" deleted
    customresourcedefinition.apiextensions.k8s.io "astradsvolumes.astrads.netapp.io" deleted
    customresourcedefinition.apiextensions.k8s.io "astradsvolumesnapshots.astrads.netapp.io" deleted
    role.rbac.authorization.k8s.io "astrads-astrads-system-admin-role" deleted
    role.rbac.authorization.k8s.io "astrads-astrads-system-reader-role" deleted
    role.rbac.authorization.k8s.io "astrads-astrads-system-writer-role" deleted
    role.rbac.authorization.k8s.io "astrads-leader-election-role" deleted
    role.rbac.authorization.k8s.io "astrads-manager-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astrads-admin-clusterrole" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astrads-reader-clusterrole" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astrads-writer-clusterrole" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsautosupport-editor-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsautosupport-viewer-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradscloudsnapshot-editor-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradscloudsnapshot-viewer-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradscluster-editor-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradscluster-viewer-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsexportpolicy-editor-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsexportpolicy-viewer-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsfaileddrive-editor-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsfaileddrive-viewer-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradslicense-editor-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradslicense-viewer-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsnfsoption-editor-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsnfsoption-viewer-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsnodeinfo-editor-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsnodeinfo-viewer-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsnodemanagement-editor-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsnodemanagement-viewer-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsqospolicy-viewer-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsversion-editor-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsversion-viewer-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsvolume-editor-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsvolume-viewer-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsvolumefile-editor-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsvolumefile-viewer-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsvolumesnapshot-editor-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-astradsvolumesnapshot-viewer-role" deleted
    clusterrole.rbac.authorization.k8s.io "astrads-manager-role" deleted
    rolebinding.rbac.authorization.k8s.io "astrads-astrads-admin-rolebinding" deleted
    rolebinding.rbac.authorization.k8s.io "astrads-astrads-reader-rolebinding" deleted
    rolebinding.rbac.authorization.k8s.io "astrads-astrads-writer-rolebinding" deleted
    rolebinding.rbac.authorization.k8s.io "astrads-leader-election-rolebinding" deleted
    rolebinding.rbac.authorization.k8s.io "astrads-manager-rolebinding" deleted
    clusterrolebinding.rbac.authorization.k8s.io "astrads-astrads-admin-rolebinding" deleted
    clusterrolebinding.rbac.authorization.k8s.io "astrads-astrads-reader-rolebinding" deleted
    clusterrolebinding.rbac.authorization.k8s.io "astrads-astrads-writer-rolebinding" deleted
    clusterrolebinding.rbac.authorization.k8s.io "astrads-manager-rolebinding" deleted
    configmap "astrads-autosupport-cm" deleted
    configmap "astrads-firetap-cm" deleted
    configmap "astrads-kevents-asup" deleted
    configmap "astrads-metrics-cm" deleted
    secret "astrads-autosupport-certs" deleted
    +----------------------------------------------------+
    | Wed Feb  2 10:16:36 EST 2022                       |
    | ADS system uninstall done                          |
    +----------------------------------------------------+

验证是否删除了 astrads-system 命名空间

确保以下命令不返回任何结果:

kubectl get ns | grep astrads-system

确保工作节点上未运行容器

验证 fireapnetwd 等容器是否未在工作节点上运行。在每个节点上运行以下命令。

ssh <mynode1>
# runc list

删除 OpenShift 容器平台资源

如果您在Red Hat OpenShift容器平台(OCP)上安装了Astra数据存储、则可以卸载OCP安全上下文约束(SCC)和绑定资源。

OpenShift 使用安全上下文约束( SCC )来控制 Pod 可以执行的操作。

完成标准卸载过程后,请完成以下步骤。

  1. 删除 SCC 资源:

    oc delete -f ads_privileged_scc.yaml
  2. 删除 rolebindings 资源:

    oc delete -f oc_role_bindings.yaml
    注 忽略这些步骤中的 " 未找到资源 " 错误。 

手动卸载Astra数据存储、而不使用脚本

此过程无需脚本即可手动卸载Astra数据存储。

要在不使用自动脚本的情况下手动卸载Astra数据存储、您需要删除工作负载、绑定、卷、导出策略、集群、 许可证、部署环境和Astra Data Store命名空间。

您需要什么? #8217 ;将需要什么
  • root 管理权限

Astra数据存储卸载过程将指导您完成以下高级步骤:

删除现有工作负载和绑定

卸载Astra数据存储之前、必须先删除以下内容

  • 使用Astra Data Store作为存储后端的所有应用程序工作负载

  • 使用Astra数据存储作为后端的Trident绑定

这样可以确保 Kubernetes 环境保持干净,这在重新安装时非常重要。

卸载Astra数据存储集群和控制平面

按照以下步骤手动卸载Astra数据存储。

删除卷和导出策略

在删除集群之前、您应删除Astra Data Store卷和导出策略。

提示 如果不先删除卷和导出策略、则集群删除过程将暂停、直到删除Astra Data Store volumes对象为止。在开始删除集群之前删除这些项会更高效。
步骤
  1. 删除卷:

    ~% kubectl delete astradsvolumes --all -A
    ~% kubectl get astradsvolumes -A
  2. 删除导出策略:

    ~% kubectl delete astradsexportpolicies --all -A
    ~% kubectl get astradsexportpolicies -A

删除Astra数据存储集群

删除集群时、只会删除Astra Data Store集群对象自定义资源(CR)以及集群范围的资源。

注 即使在删除集群后,操作符, nodeinfo Pod 和集群控制器(即 Kubernetes 范围的资源)仍会保持不变。

删除集群还会从节点卸载底层操作系统,从而停止 fireapnetwd 服务。

卸载程序大约需要一分钟才能完成。然后、开始删除Astra Data Store集群范围的资源。

  1. 删除集群:

    ~% kubectl delete astradsclusters --all -A
    ~% kubectl get astradsclusters -A

删除许可证

  1. 通过 SSH 连接到集群中的每个工作节点,并验证` fireap` 或 `netwd `未在工作节点中运行。

  2. 删除Astra Data Store许可证:

    ~% kubectl delete astradslicenses --all -A
    ~% kubectl get astradslicenses -A

删除Astra Data Store安装

删除集群中的控制器,操作员,命名空间和支持 Pod 。

  1. 删除Astra Data Store安装对象:

    ~% kubectl delete astradsversion astradsversion -n astrads-system
    ~% kubectl get astradsversion -n astrads-system
  2. 删除数据存储DemonSets和所有Astra Data Store控制器资源:

    ~% kubectl delete ds --all -n astrads-system
    ~% kubectl get ds -n astrads-system
    
    ~% kubectl delete deployments --all -n astrads-system
    ~% kubectl get deployments -n astrads-system
  3. 删除其余项目和操作符 YAML 文件:

    ~% kubectl delete -f ./manifests/astradsoperator.yaml
    ~% kubectl get pods -n astrads-system

验证是否删除了 astrads-system 命名空间

确保以下命令不返回任何结果:

~% kubectl get ns | grep astrads-system

确保工作节点上未运行容器

验证 fireapnetwd 等容器是否未在工作节点上运行。在每个节点上运行以下命令。

ssh <mynode1>
# runc list

删除 OpenShift 容器平台资源

如果您在Red Hat OpenShift容器平台(OCP)上安装了Astra数据存储、则可以卸载OCP安全上下文约束(SCC)和绑定资源。

OpenShift 使用安全上下文约束( SCC )来控制 Pod 可以执行的操作。

完成标准卸载过程后,请完成以下步骤。

  1. 删除 SCC 资源:

    oc delete -f ads_privileged_scc.yaml
  2. 删除 rolebindings 资源:

    oc delete -f oc_role_bindings.yaml
    注 忽略这些步骤中的 " 未找到资源错误 " 。 

手动删除示例

下面显示了执行手动卸载脚本的示例。

$ kubectl delete astradsvolumes --all -A
No resources found
$ kubectl delete astradsexportpolicies --all -A
No resources found
$ kubectl delete astradsclusters --all -A
astradscluster.astrads.netapp.io "astrads-sti-c6220-09-10-11-12" deleted

$ kubectl delete astradslicenses --all -A
astradslicense.astrads.netapp.io "e900000005" deleted

$ kubectl delete astradsdeployment astradsdeployment -n astrads-system
astradsdeployment.astrads.netapp.io "astradsdeployment" deleted

$ kubectl delete ds --all -n astrads-system
daemonset.apps "astrads-ds-astrads-sti-c6220-09-10-11-12" deleted
daemonset.apps "astrads-ds-nodeinfo-astradsdeployment" deleted
daemonset.apps "astrads-ds-support" deleted

$ kubectl delete deployments --all -n astrads-system
deployment.apps "astrads-cluster-controller" deleted
deployment.apps "astrads-deployment-support" deleted
deployment.apps "astrads-license-controller" deleted
deployment.apps "astrads-operator" deleted

$ kubectl delete -f /.../firetap/sds/manifests/netappsdsoperator.yaml
namespace "astrads-system" deleted
customresourcedefinition.apiextensions.k8s.io "astradsautosupports.astrads.netapp.io" deleted
customresourcedefinition.apiextensions.k8s.io "astradscloudsnapshots.astrads.netapp.io" deleted
customresourcedefinition.apiextensions.k8s.io "astradsclusters.astrads.netapp.io" deleted
customresourcedefinition.apiextensions.k8s.io "astradsdeployments.astrads.netapp.io" deleted
customresourcedefinition.apiextensions.k8s.io "astradsexportpolicies.astrads.netapp.io" deleted
customresourcedefinition.apiextensions.k8s.io "astradsfaileddrives.astrads.netapp.io" deleted
customresourcedefinition.apiextensions.k8s.io "astradslicenses.astrads.netapp.io" deleted
customresourcedefinition.apiextensions.k8s.io "astradsnfsoptions.astrads.netapp.io" deleted
customresourcedefinition.apiextensions.k8s.io "astradsnodeinfoes.astrads.netapp.io" deleted
customresourcedefinition.apiextensions.k8s.io "astradsqospolicies.astrads.netapp.io" deleted
customresourcedefinition.apiextensions.k8s.io "astradsvolumefiles.astrads.netapp.io" deleted
customresourcedefinition.apiextensions.k8s.io "astradsvolumes.astrads.netapp.io" deleted
customresourcedefinition.apiextensions.k8s.io "astradsvolumesnapshots.astrads.netapp.io" deleted
role.rbac.authorization.k8s.io "astrads-leader-election-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-astradscloudsnapshot-editor-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-astradscloudsnapshot-viewer-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-astradscluster-editor-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-astradscluster-viewer-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-astradslicense-editor-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-astradslicense-viewer-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-astradsvolume-editor-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-astradsvolume-viewer-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-autosupport-editor-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-autosupport-viewer-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-manager-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-metrics-reader" deleted
clusterrole.rbac.authorization.k8s.io "astrads-netappexportpolicy-editor-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-netappexportpolicy-viewer-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-netappsdsdeployment-editor-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-netappsdsdeployment-viewer-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-netappsdsnfsoption-editor-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-netappsdsnfsoption-viewer-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-netappsdsnodeinfo-editor-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-netappsdsnodeinfo-viewer-role" deleted
clusterrole.rbac.authorization.k8s.io "astrads-proxy-role" deleted
rolebinding.rbac.authorization.k8s.io "astrads-leader-election-rolebinding" deleted
clusterrolebinding.rbac.authorization.k8s.io "astrads-manager-rolebinding" deleted
clusterrolebinding.rbac.authorization.k8s.io "astrads-proxy-rolebinding" deleted
configmap "astrads-autosupport-cm" deleted
configmap "astrads-firetap-cm" deleted
configmap "astrads-fluent-bit-cm" deleted
configmap "astrads-kevents-asup" deleted
configmap "astrads-metrics-cm" deleted
service "astrads-operator-metrics-service" deleted
 Error from server (NotFound): error when deleting "/.../export/firetap/sds/manifests/netappsdsoperator.yaml": deployments.apps "astrads-operator" not found

$ kubectl get ns | grep astrads-system

[root@sti-rx2540-535c ~]# runc list
ID      PID     STATUS    BUNDLE       CREATED    OWNER

对Astra数据存储卸载过程进行故障排除

如果需要对卸载过程进行故障排除、请查看以下建议。

Pod处于终止状态

Astra数据存储卸载过程有时可能会使发生原因 Pod在Kubernetes中保持终止状态。

如果发生此问题描述 ,请运行以下命令强制删除 astrads-system 命名空间中的所有 Pod :

kubectl delete pods --all  -n astrads-system   --force --grace-period 0

服务质量策略指向旧集群

如果您仅删除Astra数据存储集群并对其进行重新部署、则可能无法创建永久性卷声明(PVC)或卷、因为服务质量(QoS)策略指向旧集群且找不到。

  1. 要避免这种情况、请在删除Astra Data Store集群后手动删除QoS策略:

    kubectl delete AstraDSQosPolicy --all -A
  2. 删除整个Astra Data Store部署(而不仅仅是集群):

    uninstall.sh all

删除或卸载Astra数据存储后未删除密钥提供程序CRS

如果为要删除或卸载的Astra Data Store集群配置了外部密钥提供程序、则可能需要手动清理未删除的任何密钥提供程序CR。

示例 1. 详细信息

按照以下临时解决策 说明进行操作:

步骤
  1. 确认未删除密钥提供程序CRS:

    kubectl get astradskeyprovider --selector astrads.netapp.io/cluster=astrads-cluster-example -n astrads-system

    响应:

    NAME                   AGE
    externalkeyprovider1   94s
  2. 删除密钥提供程序CRS:

    1. 删除此查找器:

      kubectl edit astradskeyprovider -n astrads-system
    2. 删除下面突出显示的查找器行:

      kubectl edit astradskeyprovider externalkeyprovider1 -n astrads-system
      apiVersion: astrads.netapp.io/v1beta1
      kind: AstraDSKeyProvider
      metadata:
        creationTimestamp: "2022-05-24T16:38:27Z"
        finalizers:
        - astrads.netapp.io/astradskeyprovider-finalizer
        generation: 1
        labels:
          astrads.netapp.io/cluster: astrads-cluster-example
          astrads.netapp.io/rsid: "1"
        name: externalkeyprovider1
        namespace: astrads-system
        resourceVersion: "1134699"
        uid: a11111b2-31c0-4575-b7f3-97f9abla1bla
      spec:
        cluster: astrads-cluster-example
        kmipServer:
          hostnames:
          - 10.xxx.xxx.xxx
          port: 5696
          secretRef: externalkeyprovider1
      status:
        keyProviderUUID: a1b2cd34-4fc6-5bae-9184-2288c673181d
        kmipServerStatus:
          capabilities: '{ KMIP_library_version()=17367809, KMIP_library_version_str()="KMIP
            1.9.3a  8-Apr-2019", KMIP_library_version_tag()="KMIP part of KMIP 1.9.3a  8-Apr-2019",
            KMIP_library_is_eval()=false, KMIP_library_fips_capable()=true(FIPS140), KMIP_SSL_provider_build_version()=268444095,
            KMIP_SSL_provider_version()=268444095, KMIP_SSL_provider_version_str()="OpenSSL
            1.0.2zb-fips  23 Sep 2021" }'
          keyServerUUID: 8422bdd0-74ad-579d-81bd-6d544ac4224a
    3. 删除此查找器后、删除密钥提供程序CR:

      kubectl delete astradskeyprovider <key-provider-cr-name> -n astrads-system

无法从Astra控制中心Web UI卸载Astra数据存储

如果您从Astra控制中心Web UI启动了Astra数据存储卸载过程、则此过程有时可能会失败。

如果发生此问题描述 、请执行以下步骤。

步骤
  1. 登录到 "NetApp 支持站点" 并将Astra数据存储捆绑包(Astra_Data_Store_2022.05.01.tar)下载到可以访问Astra数据存储所在的Kubernetes集群的计算机上。

  2. 登录到已下载Astra数据存储捆绑包的计算机。

  3. 提取捆绑包的内容:

    tar -xvf <path to tar file>/Astra_Data_Store_2022.05.01.tar
  4. 更改为存储卸载脚本的清单目录:

    cd astrads/manifests/
  5. 手动删除Astra数据存储:

    ./uninstall all