Skip to content

Latest commit

 

History

History
137 lines (112 loc) · 3.89 KB

uninstall_ocs.adoc

File metadata and controls

137 lines (112 loc) · 3.89 KB

Uninstall OCS/ODF

Delete the StorageCluster object.

oc annotate storagecluster -n openshift-storage ocs-storagecluster uninstall.ocs.openshift.io/cleanup-policy="delete" --overwrite
oc annotate storagecluster -n openshift-storage ocs-storagecluster uninstall.ocs.openshift.io/mode="forced" --overwrite
oc delete -n openshift-storage storagesystem --all --wait=true


oc delete -n openshift-storage storagecluster --all --wait=true
oc project default
oc delete project openshift-storage --wait=true --timeout=5m

Unlabel nodes, and remove storage taints

oc label nodes  --all cluster.ocs.openshift.io/openshift-storage-
oc label nodes  --all topology.rook.io/rack-
oc adm taint nodes --all node.ocs.openshift.io/storage-

Delete ODF PVs

oc get pv | grep ocs | awk '{ print $1 }' | xargs oc delete pv

Delete noobaa storageClass

oc delete storageclass openshift-storage.noobaa.io --wait=true --timeout=5m

Remove CustomResourceDefinitions

oc delete crd \
  backingstores.noobaa.io \
  bucketclasses.noobaa.io \
  cephblockpools.ceph.rook.io \
  cephclusters.ceph.rook.io \
  cephfilesystems.ceph.rook.io \
  cephnfses.ceph.rook.io \
  cephobjectstores.ceph.rook.io \
  cephobjectstoreusers.ceph.rook.io \
  noobaas.noobaa.io \
  ocsinitializations.ocs.openshift.io \
  storageclusters.ocs.openshift.io \
  cephclients.ceph.rook.io \
  cephobjectrealms.ceph.rook.io \
  cephobjectzonegroups.ceph.rook.io \
  cephobjectzones.ceph.rook.io \
  cephrbdmirrors.ceph.rook.io \
  storagesystems.odf.openshift.io \
  --wait=true --timeout=5m

Delete remaining pods, deamonsets, replicasets, deployment.apps, and services

oc delete pods,jobs,ds,rs,statefulset,hpa,deployment.apps,jobs,service,route,cm,secrets --all -n openshift-storage

Delete openshift-storage namespace

oc patch ns openshift-storage --type=merge -p '{"spec": {"finalizers":null}}'
oc patch ns openshift-storage --type json --patch='[ { "op": "remove", "path": "/spec/finalizers" } ]'
oc delete ns openshift-storage

If the namespace is stuck in terminating status, then list the remaining resources in the namespace

oc api-resources --verbs=list --namespaced -o name | sort | grep -Ev 'events|packagemanifest' | xargs -t -n 1 oc get --show-kind --ignore-not-found -n openshift-storage

Delete localVolumeSets

oc delete localvolumesets --all -n openshift-local-storage

Delete storage classes

oc delete storageclasses local-storage

Remove Symlinks from nodes

[[ ! -z $SC ]] && for i in 1 2 3 4; do oc debug node/ocs${i}.rch2s5mensrsocp.vzbi.com -- chroot /host rm -rfv /mnt/local-storage/${SC}/; done
oc delete localvolumediscoveries --all -n openshift-local-storage

Delete openshift-local-storage project

oc project default
oc delete project openshift-local-storage --wait=true --timeout=5m

Reinstalling ODF

When reinstalling OCS/ODF…​ Enable rook-ceph-tools

oc patch OCSInitialization ocsinit -n openshift-storage --type json --patch '[{ "op": "replace", "path": "/spec/enableCephTools", "value": true }]'

If you need to disable noobaa - need to fix this, it doesnt work

oc patch storagecluster ocs-storagecluster -n openshift-storage --type json --patch '[{ "op": "add", "path": "/spec/multiCloudGateway/reconcileStrategy", "value": ignore }]'

Apply infrastructure tolerations, if needed