// Module included in the following assemblies:
//
// * nodes/scheduling/secondary_scheduler/nodes-secondary-scheduler-configuring.adoc

:_mod-docs-content-type: PROCEDURE
[id="nodes-secondary-scheduler-pod-console_{context}"]
= Scheduling a pod using the secondary scheduler

[role="_abstract"]
To schedule a pod by using the secondary scheduler, set the `schedulerName` field in the pod definition.

.Prerequisites

ifndef::openshift-rosa,openshift-dedicated[]
* You are logged in to {product-title} as a user with the `cluster-admin` role.
endif::openshift-rosa,openshift-dedicated[]
ifdef::openshift-rosa,openshift-dedicated[]
* You are logged in to {product-title} as a user with the `dedicated-admin` role.
endif::openshift-rosa,openshift-dedicated[]
* You have access to the {product-title} web console.
* The {secondary-scheduler-operator-full} is installed.
* A secondary scheduler is configured.

.Procedure

. Log in to the {product-title} web console.
. Navigate to *Workloads* -> *Pods*.
. Click *Create Pod*.
. In the YAML editor, enter the desired pod configuration and add the `schedulerName` field:
+
[source,yaml]
----
apiVersion: v1
kind: Pod
metadata:
  name: nginx
  namespace: default
spec:
  securityContext:
    runAsNonRoot: true
    seccompProfile:
      type: RuntimeDefault
  containers:
    - name: nginx
      image: nginx:1.14.2
      ports:
        - containerPort: 80
      securityContext:
        allowPrivilegeEscalation: false
        capabilities:
          drop: [ALL]
  schedulerName: secondary-scheduler
----
+
The `spec.schedulerName` field must match the name that is defined in the config map when you configured the secondary scheduler.

. Click *Create*.

.Verification

. Log in to the OpenShift CLI.
. Describe the pod using the following command:
+
[source,terminal]
----
$ oc describe pod nginx -n default
----
+
.Example output
[source,text]
----
Name:         nginx
Namespace:    default
Priority:     0
Node:         ci-ln-t0w4r1k-72292-xkqs4-worker-b-xqkxp/10.0.128.3
...
Events:
  Type    Reason          Age   From                 Message
  ----    ------          ----  ----                 -------
  Normal  Scheduled       12s   secondary-scheduler  Successfully assigned default/nginx to ci-ln-t0w4r1k-72292-xkqs4-worker-b-xqkxp
...
----

. In the events table, find the event with a message similar to `Successfully assigned <namespace>/<pod_name> to <node_name>`.
. In the "From" column, verify that the event was generated from the secondary scheduler and not the default scheduler.
+
[NOTE]
====
You can also check the `secondary-scheduler-*` pod logs in the `openshift-secondary-scheduler-namespace` to verify that the pod was scheduled by the secondary scheduler.
====

////
Due to a UI bug, can't verify via console. Bug should be fixed in 4.11 hopefully, and if so, update to use the console steps:

.Verification
. Navigate to the *Events* tab for the pod.
. Find the event with a message similar to `Successfully assigned <namespace>/<pod_name> to <node_name>`.
. Verify that the event was generated from the secondary scheduler and not the default scheduler.
////
