Este contenido no está disponible en el idioma seleccionado.
Chapter 4. Uninstalling Red Hat Advanced Cluster Security for Kubernetes
When you install Red Hat Advanced Cluster Security for Kubernetes, it creates:
-
A namespace called
rhacs-operatorwhere the Operator is installed, if you chose the Operator method of installation -
A namespace called
stackrox, or another namespace where you created the Central and SecuredCluster custom resources -
PodSecurityPolicyand Kubernetes role-based access control (RBAC) objects for all components - Additional labels on namespaces, for use in generated network policies
- An application custom resource definition (CRD), if it does not exist
Uninstalling Red Hat Advanced Cluster Security for Kubernetes involves deleting all of these items.
4.1. Deleting namespace Copiar enlaceEnlace copiado en el portapapeles!
You can delete the namespace that Red Hat Advanced Cluster Security for Kubernetes creates by using the OpenShift Container Platform or Kubernetes command-line interface.
Procedure
Delete the
stackroxnamespace:On OpenShift Container Platform:
oc delete namespace stackrox
$ oc delete namespace stackroxCopy to Clipboard Copied! Toggle word wrap Toggle overflow On Kubernetes:
kubectl delete namespace stackrox
$ kubectl delete namespace stackroxCopy to Clipboard Copied! Toggle word wrap Toggle overflow
If you installed RHACS in a different namespace, use the name of that namespace in the delete command.
4.2. Deleting global resources Copiar enlaceEnlace copiado en el portapapeles!
You can delete the global resources that Red Hat Advanced Cluster Security for Kubernetes creates, by using the OpenShift Container Platform or Kubernetes command-line interface.
Procedure
Delete global resources:
On OpenShift Container Platform:
oc get clusterrole,clusterrolebinding,role,rolebinding,psp -o name | grep stackrox | xargs oc delete --wait
$ oc get clusterrole,clusterrolebinding,role,rolebinding,psp -o name | grep stackrox | xargs oc delete --waitCopy to Clipboard Copied! Toggle word wrap Toggle overflow oc delete scc -l "app.kubernetes.io/name=stackrox"
$ oc delete scc -l "app.kubernetes.io/name=stackrox"Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc delete ValidatingWebhookConfiguration stackrox
$ oc delete ValidatingWebhookConfiguration stackroxCopy to Clipboard Copied! Toggle word wrap Toggle overflow On Kubernetes:
kubectl get clusterrole,clusterrolebinding,role,rolebinding,psp -o name | grep stackrox | xargs kubectl delete --wait
$ kubectl get clusterrole,clusterrolebinding,role,rolebinding,psp -o name | grep stackrox | xargs kubectl delete --waitCopy to Clipboard Copied! Toggle word wrap Toggle overflow kubectl delete ValidatingWebhookConfiguration stackrox
$ kubectl delete ValidatingWebhookConfiguration stackroxCopy to Clipboard Copied! Toggle word wrap Toggle overflow
4.3. Deleting labels and annotations Copiar enlaceEnlace copiado en el portapapeles!
You can delete the labels and annotations that Red Hat Advanced Cluster Security for Kubernetes creates, by using the OpenShift Container Platform or Kubernetes command-line interface.
Procedure
Delete labels and annotations:
On OpenShift Container Platform:
for namespace in $(oc get ns | tail -n +2 | awk '{print $1}'); do oc label namespace $namespace namespace.metadata.stackrox.io/id-; oc label namespace $namespace namespace.metadata.stackrox.io/name-; oc annotate namespace $namespace modified-by.stackrox.io/namespace-label-patcher-; done$ for namespace in $(oc get ns | tail -n +2 | awk '{print $1}'); do oc label namespace $namespace namespace.metadata.stackrox.io/id-; oc label namespace $namespace namespace.metadata.stackrox.io/name-; oc annotate namespace $namespace modified-by.stackrox.io/namespace-label-patcher-; doneCopy to Clipboard Copied! Toggle word wrap Toggle overflow On Kubernetes:
for namespace in $(kubectl get ns | tail -n +2 | awk '{print $1}'); do kubectl label namespace $namespace namespace.metadata.stackrox.io/id-; kubectl label namespace $namespace namespace.metadata.stackrox.io/name-; kubectl annotate namespace $namespace modified-by.stackrox.io/namespace-label-patcher-; done$ for namespace in $(kubectl get ns | tail -n +2 | awk '{print $1}'); do kubectl label namespace $namespace namespace.metadata.stackrox.io/id-; kubectl label namespace $namespace namespace.metadata.stackrox.io/name-; kubectl annotate namespace $namespace modified-by.stackrox.io/namespace-label-patcher-; doneCopy to Clipboard Copied! Toggle word wrap Toggle overflow