卸载 WebSphere Automation

您可以使用 Red Hat® OpenShift® CLI (oc) 命令卸载 WebSphere Automation 实例和操作程序。

准备工作

设置 WebSphere Automation 操作程序名称空间,实例名称空间和实例名称的环境变量。 这些值可能相同,也可能不同。 例如,使用 Red Hat OpenShift 控制台进行安装的缺省步骤使用以下名称空间和实例名称:

WSA_OPERATOR_NAMESPACE=openshift-operators
WSA_INSTANCE_NAMESPACE=websphere-automation
WSA_INSTANCE_NAME=wsa
  1. 以集群管理员身份登录到 Red Hat OpenShift 集群。
  2. 卸载 WebSphere Automation 实例
  3. 卸载 WebSphere Automation 操作符

卸载 WebSphere Automation 实例

要卸载 WebSphere Automation 实例,请运行用于删除资源的 oc 命令。 请确保设置了 WSA_INSTANCE_NAMESPACE 环境变量。

  1. 删除 WebSphereHealthWebSphereSecureWebSphereAutomation 定制资源。
    oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found webspherehealth --all
    oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found webspheresecure --all
    oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found websphereautomation --all

    这些 delete 命令将除去所有 WebSphere Automation 容器,但保留一些持久存储资源。

  2. 删除与持久存储器相关的 WebSphere Automation 资源。
    提示: 如果您计划在同一名称空间中重新安装 WebSphere Automation 并且希望在新实例中使用相同的数据,那么不需要除去持久卷声明 (PVC) 和其他相关资源。
    WSA_PVCS=$(oc -n $WSA_INSTANCE_NAMESPACE get pvc -o name | grep mongo | cut -d/ -f2)
    oc -n $WSA_INSTANCE_NAMESPACE delete pvc $WSA_PVCS
  3. 对于 1.6.0之前的版本,请删除 IBM Automation foundation 和 IBM Cloud Pak foundational services 资源。

    如果群集中未安装其他云 Pak ,且您想完全删除 IBM Automation foundation ,包括 IBM Cloud Pak foundational services ,请参阅卸载 IBM Automation foundation。

  4. 对于 1.6.0 及更高版本,删除 IBM Cloud Pak 基础服务资源。
    运行以下命令删除 IBM Cloud Pak 基础服务资源:
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found zenservice iaf-zen-cpdservice 
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found kafkatopics --selector ibmevents.ibm.com/cluster=iaf-system
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found serviceaccount ibm-common-service-operator
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found secret metastore-secret
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found secret external-tls-secret
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found secret wsa-external-tls-secret
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found secret iaf-system-automationui-aui-zen-ca
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found secret iaf-system-automationui-aui-zen-cert
    
    如果没有安装其他云软件包 ,并且想要完全删除 IBM Cloud Pak 基础服务,请参阅卸载基础服务

卸载 WebSphere Automation 操作程序

要卸载 WebSphere Automation 操作程序,请运行 oc 命令以删除 WebSphere Automation 预订、ClusterServiceVersion (CSV) 和 CustomResourceDefinition (CRD) 资源。 请务必设置 WSA_OPERATOR_NAMESPACE 环境变量。

  1. 删除 WebSphere Automation 预订。
    WSA_SUBSCRIPTION_NAME=$(oc -n $WSA_OPERATOR_NAMESPACE get subscription -o name | grep websphere-automation | cut -d/ -f2)
    oc -n $WSA_OPERATOR_NAMESPACE delete subscription $WSA_SUBSCRIPTION_NAME
  2. 除去 WebSphere Automation ClusterServiceVersion (CSV)。
    WSA_CSV_NAME=$(oc -n $WSA_OPERATOR_NAMESPACE get csv -o name | grep websphere-automation | cut -d/ -f2)
    oc -n $WSA_OPERATOR_NAMESPACE delete csv $WSA_CSV_NAME
  3. 删除 WebSphere Automation CustomResourceDefinition (CRD) 资源。
    WSA_CRD_NAMES=$(oc get crd -o name | grep automation.websphere | cut -d/ -f2)
    oc delete crd $WSA_CRD_NAMES
  4. 通过删除 OpenShift 项目或手动除去 WebSphere Automation 操作程序资源来除去 WebSphere Automation ServiceAccounts and Secrets
    • 删除 OpenShift 项目。
      oc delete project $WSA_INSTANCE_NAMESPACE

      如果命名空间删除失败或挂起,请按照 " 卸载基础服务 "步骤 9 修补剩余的终结器。

    • 通过运行以下命令来除去 WebSphere Automation 操作程序资源。
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found serviceaccount websphere-automation-operator-sa
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found serviceaccount $WSA_INSTANCE_NAME-health-webhooks-apis-sa
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found serviceaccount $WSA_INSTANCE_NAME-secure-metering-apis-sa
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found secret $WSA_INSTANCE_NAME-health-mongo-creds
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found secret $WSA_INSTANCE_NAME-mongo-admin-creds
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found secret $WSA_INSTANCE_NAME-secure-mongo-creds
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found secret $WSA_INSTANCE_NAME-mongo-ca-cert
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found secret $WSA_INSTANCE_NAME-secure-crypto
      oc -n $WSA_INSTANCE_NAMESPACE delete --ignore-not-found secret $WSA_INSTANCE_NAME-secure-encrypt