8.4. cleanup
删除工作负载:
$ oc delete ns hello-world
如果不再需要,从集群中删除备份和恢复资源:
$ oc delete backup hello-world $ oc delete restore hello-world
删除 s3 中的备份/恢复和远程对象:
$ velero backup delete hello-world $ velero restore delete hello-world
删除数据保护应用程序:
$ oc -n openshift-adp delete dpa ${CLUSTER_NAME}-dpa
删除云存储:
$ oc -n openshift-adp delete cloudstorage ${CLUSTER_NAME}-oadp
警告如果这个命令挂起,您可能需要删除终结器:
$ oc -n openshift-adp patch cloudstorage ${CLUSTER_NAME}-oadp -p '{"metadata":{"finalizers":null}}' --type=merge
如果不再需要,删除 Operator:
$ oc -n openshift-adp delete subscription oadp-operator
删除 Operator 的命名空间:
$ oc delete ns redhat-openshift-adp
如果不再有它们,请从集群中删除自定义资源定义:
$ for CRD in `oc get crds | grep velero | awk '{print $1}'`; do oc delete crd $CRD; done $ for CRD in `oc get crds | grep -i oadp | awk '{print $1}'`; do oc delete crd $CRD; done
删除 AWS S3 Bucket:
$ aws s3 rm s3://${CLUSTER_NAME}-oadp --recursive $ aws s3api delete-bucket --bucket ${CLUSTER_NAME}-oadp
将 Policy 从角色分离:
$ aws iam detach-role-policy --role-name "${ROLE_NAME}" \ --policy-arn "${POLICY_ARN}"
删除角色:
$ aws iam delete-role --role-name "${ROLE_NAME}"