Uninstalling the scheduling service
A cluster administrator can uninstall the scheduling service.
- Permissions you need for this task
- You must be a cluster administrator.
Procedure
Complete the following tasks to uninstall scheduling service:
- Uninstalling dependent services
- Uninstalling the service
- Restarting pending pods
- Uninstalling the operatorNote: Complete this step only if you want to completely remove the scheduling service software from your cluster.
Uninstalling dependent services
Ensure that you uninstall this service before you uninstall the scheduling service.
Uninstalling the service
- When you need to complete this task
- Complete this task when you want to remove the scheduling service and revert your cluster to the default scheduler.
When you delete the Scheduling
custom resource, the Scheduling
operand is uninstalled. (The operand is the running instance of the scheduling service.)
Uninstalling the scheduling service will remove all of the data that is associated with this instance of the scheduling service.
To uninstall the service:
-
Log in to Red Hat® OpenShift® Container Platform as a user with sufficient permissions to complete the task:
oc login OpenShift_URL:port
- Delete the scheduling service custom
resource.
The following command assumes that the scheduling service is installed in the default
ibm-common-services
project:oc delete Scheduling ibm-cpd-scheduler \ --namespace ibm-common-services
- Run the following command to verify that the pods that are associated with the scheduling service operand have been
stopped.
oc get po -n ibm-common-services | grep ^ibm-cpd-sched
The command should return only the operator pod (
ibm-cpd-scheduling-operator-*
). If the command returns multiple pods, wait several minutes before running the command again.
Restarting pending pods
After you uninstall the scheduling service, you must delete any pending pods that are waiting to be scheduled by the scheduling service. When the pods restart, they will be scheduled by the default scheduler.
To restart the pending pods:
- Run the following command to see which projects have pods that are under the control of the
scheduling service:
oc get po -A --no-headers | while read namespace name ready status misc; do schedulerName=`oc get po -n$namespace $name -o=jsonpath="{.spec.schedulerName}"` if [ "$schedulerName" == "ibm-cpd-scheduler" -a "$status" == "Pending" ]; then echo "$namespace" fi done | sort -u
The command returns a list of projects.
- For each project returned by the preceding command, complete the following steps:
- Change to the
project:
oc project project-name
- Run the command to list the pending pods in the project that are still under the control of the
scheduling service:
oc get po --no-headers | while read name ready status misc; do schedulerName=`oc get po $name -o=jsonpath='{.spec.schedulerName}'` if [ "$schedulerName" == "ibm-cpd-scheduler" -a $status == "Pending" ]; then echo "Pod $name is pending, and schedulerName is set to ibm-cpd-scheduler" fi done
The command returns a list of pods. If the command does not return any pods, there are no pending pods that need to be restarted in this project.
- Run the following command to delete the
pods:
oc get po --no-headers | while read name ready status misc; do schedulerName=`oc get po $name -o=jsonpath='{.spec.schedulerName}'` if [ "$schedulerName" == "ibm-cpd-scheduler" -a $status == "Pending" ]; then oc delete po $name fi done
- Repeat the preceding steps for each project that was returned in the output for step 1.
- Change to the
project:
Uninstalling the operator
- When you need to complete this task
- Complete this task only if you want to completely remove the scheduling service from your cluster.
Complete this task after you uninstall the service.
To uninstall the operator:
- Delete the scheduling service operator
subscription.
The following command assumes that the scheduling service is installed in the default
ibm-common-services
project:oc delete sub ibm-cpd-scheduling-catalog-subscription \ --namespace ibm-common-services
- Delete the scheduling service cluster service
version (CSV).
The following command assumes that the scheduling service is installed in the default
ibm-common-services
project:oc delete -n ibm-common-services csv \ -l operators.coreos.com/ibm-cpd-scheduling-operator.ibm-common-services=""