Uninstalling the scheduling service
A cluster administrator can uninstall the scheduling service.
- Who needs to complete this task?
-
Cluster administrator To complete this task, you must be a cluster administrator.
- When do you need to complete this task?
- Complete this task if either of the following statements is true:
- You want to uninstall the scheduling service but leave your IBM® Software
Hub installation
running.
If you uninstall the scheduling service, the quota enforcement feature will not be available in IBM Software Hub.
- You want to completely uninstall IBM Software
Hub and your environment includes the scheduling service.
If this scenario applies to you, complete Uninstalling an instance of IBM Software Hub before you uninstall the scheduling service to streamline the uninstall process.
- You want to uninstall the scheduling service but leave your IBM® Software
Hub installation
running.
Procedure
Complete the following tasks to uninstall scheduling service.
Uninstalling dependent services
- Watson
Machine LearningImportant: Deep learning requires the scheduling service. If you plan to uninstall the scheduling service, you must either stop using deep learning or uninstall Watson Machine Learning.
Uninstalling the service
- When do 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}Remember:OC_LOGINis an alias for theoc logincommand. - Delete the scheduling service custom
resource:
oc delete Scheduling ibm-cpd-scheduler \ --namespace ${PROJECT_SCHEDULING_SERVICE} - Run the following command to verify that the pods that are associated with the scheduling service operand have been
stopped.
oc get pods -n ${PROJECT_SCHEDULING_SERVICE} | grep ^ibm-cpd-schedThe command should return only the following pod:ibm-cpd-scheduling-operator
If the command returns other pods, wait several minutes before running the command again.
Restarting pending pods
- When do you need to complete this task?
- Complete this task only if you still have IBM Software Hub installed on your environment. This task does not apply if you uninstalled IBM Software Hub.
After you uninstall the scheduling service, 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 OpenShift 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 pods -A --no-headers | while read namespace name ready status misc; do schedulerName=`oc get pods -n$namespace $name -o=jsonpath="{.spec.schedulerName}"` if [ "$schedulerName" == "ibm-cpd-scheduler" -a "$status" == "Pending" ]; then echo "$namespace" fi done | sort -uThe command returns a list of projects.
Tip: If the command returns Error from server (NotFound): pods "..." not found errors, you can ignore the errors and continue to the next step. - 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 pods --no-headers | while read name ready status misc; do schedulerName=`oc get pods $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 doneThe 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.
Tip: You can ignore any Error from server (NotFound): pods "..." not found errors. - Run the following command to delete the
pods:
oc get pods --no-headers | while read name ready status misc; do schedulerName=`oc get pods $name -o=jsonpath='{.spec.schedulerName}'` if [ "$schedulerName" == "ibm-cpd-scheduler" -a $status == "Pending" ]; then oc delete pods $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 do 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 cluster role and cluster role binding for the scheduling service:
oc delete clusterrole -l=icpdsupport/addOnId=scheduling oc delete clusterrolebinding -l=icpdsupport/addOnId=scheduling - Delete the project where the scheduling service was
installed:
oc delete project ${PROJECT_SCHEDULING_SERVICE} - Delete the scheduling service custom
resource definition
(CRD):
oc delete crd scheduling.scheduler.spectrumcomputing.ibm.com