mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
OSDOCS-3367: Removing the customer scheduler docs in favor of the secondary scheduler docs
This commit is contained in:
committed by
openshift-cherrypick-robot
parent
5295ad1419
commit
e8c9bff817
@@ -1903,8 +1903,6 @@ Topics:
|
||||
# File: nodes-scheduler-node-projects
|
||||
# - Name: Keeping your cluster balanced using the descheduler
|
||||
# File: nodes-scheduler-descheduler
|
||||
- Name: Running a custom scheduler
|
||||
File: nodes-custom-scheduler
|
||||
- Name: Evicting pods using the descheduler
|
||||
File: nodes-descheduler
|
||||
- Name: Secondary scheduler
|
||||
|
||||
@@ -1,136 +0,0 @@
|
||||
// Module included in the following assemblies:
|
||||
//
|
||||
// * nodes/scheduling/nodes-custom-scheduler.adoc
|
||||
|
||||
:_content-type: PROCEDURE
|
||||
[id="nodes-custom-scheduler-deploying_{context}"]
|
||||
= Deploying a custom scheduler
|
||||
|
||||
To include a custom scheduler in your cluster, include the image for a custom scheduler in a deployment.
|
||||
|
||||
.Prerequisites
|
||||
|
||||
* You have access to the cluster as a user with the `cluster-admin` role.
|
||||
* You have a scheduler binary.
|
||||
+
|
||||
[NOTE]
|
||||
====
|
||||
Information on how to create a scheduler binary is outside the scope of this document. For an example, see link:https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers[Configure Multiple Schedulers] in the Kubernetes documentation. Note that the actual functionality of your custom scheduler is not supported by Red Hat.
|
||||
====
|
||||
* You have created an image containing the scheduler binary and pushed it to a registry.
|
||||
|
||||
.Procedure
|
||||
|
||||
. Create a file that contains the deployment resources for the custom scheduler:
|
||||
+
|
||||
.Example `custom-scheduler.yaml` file
|
||||
[source,yaml]
|
||||
----
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: custom-scheduler
|
||||
namespace: kube-system <1>
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: custom-scheduler-as-kube-scheduler
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: custom-scheduler
|
||||
namespace: kube-system <1>
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: system:kube-scheduler
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: custom-scheduler-as-volume-scheduler
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: custom-scheduler
|
||||
namespace: kube-system <1>
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: system:volume-scheduler
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
component: scheduler
|
||||
tier: control-plane
|
||||
name: custom-scheduler
|
||||
namespace: kube-system <1>
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
component: scheduler
|
||||
tier: control-plane
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
component: scheduler
|
||||
tier: control-plane
|
||||
version: second
|
||||
spec:
|
||||
serviceAccountName: custom-scheduler
|
||||
containers:
|
||||
- command:
|
||||
- /usr/local/bin/kube-scheduler
|
||||
- --address=0.0.0.0
|
||||
- --leader-elect=false
|
||||
- --scheduler-name=custom-scheduler <2>
|
||||
image: "<namespace>/<image_name>:<tag>" <3>
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 10251
|
||||
initialDelaySeconds: 15
|
||||
name: kube-second-scheduler
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 10251
|
||||
resources:
|
||||
requests:
|
||||
cpu: '0.1'
|
||||
securityContext:
|
||||
privileged: false
|
||||
volumeMounts: []
|
||||
hostNetwork: false
|
||||
hostPID: false
|
||||
volumes: []
|
||||
----
|
||||
<1> This procedure uses the `kube-system` namespace, but you can use the namespace of your choosing.
|
||||
<2> The command for your custom scheduler might require different arguments. For example, you can pass configuration as a mounted volume using the `--config` argument.
|
||||
<3> Specify the container image that you created for the custom scheduler.
|
||||
|
||||
. Create the deployment resources in the cluster:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc create -f custom-scheduler.yaml
|
||||
----
|
||||
|
||||
.Verification
|
||||
|
||||
* Verify that the scheduler pod is running:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc get pods -n kube-system
|
||||
----
|
||||
+
|
||||
The custom scheduler pod is listed as `Running`:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
custom-scheduler-6cd7c4b8bc-854zb 1/1 Running 0 2m
|
||||
----
|
||||
@@ -1,145 +0,0 @@
|
||||
// Module included in the following assemblies:
|
||||
//
|
||||
// * nodes/scheduling/nodes-custom-scheduler.adoc
|
||||
|
||||
:_content-type: PROCEDURE
|
||||
[id="nodes-custom-scheduler-deploying-pods_{context}"]
|
||||
= Deploying pods using a custom scheduler
|
||||
|
||||
After the custom scheduler is deployed in your cluster, you can configure pods to use that scheduler instead of the default scheduler.
|
||||
|
||||
[NOTE]
|
||||
====
|
||||
Each scheduler has a separate view of resources in a cluster. For that reason, each scheduler should operate over its own set of nodes.
|
||||
|
||||
If two or more schedulers operate on the same node, they might intervene with each other and schedule more pods on the same node than there are available resources for. Pods might get rejected due to insufficient resources in this case.
|
||||
====
|
||||
|
||||
.Prerequisites
|
||||
|
||||
* You have access to the cluster as a user with the `cluster-admin` role.
|
||||
* The custom scheduler has been deployed in the cluster.
|
||||
|
||||
.Procedure
|
||||
|
||||
. If your cluster uses role-based access control (RBAC), add the custom scheduler name to the `system:kube-scheduler` cluster role.
|
||||
|
||||
.. Edit the `system:kube-scheduler` cluster role:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc edit clusterrole system:kube-scheduler
|
||||
----
|
||||
|
||||
.. Add the name of the custom scheduler to the `resourceNames` lists for the `leases` and `endpoints` resources:
|
||||
+
|
||||
[source,yaml]
|
||||
----
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
annotations:
|
||||
rbac.authorization.kubernetes.io/autoupdate: "true"
|
||||
creationTimestamp: "2021-07-07T10:19:14Z"
|
||||
labels:
|
||||
kubernetes.io/bootstrapping: rbac-defaults
|
||||
name: system:kube-scheduler
|
||||
resourceVersion: "125"
|
||||
uid: 53896c70-b332-420a-b2a4-f72c822313f2
|
||||
rules:
|
||||
...
|
||||
- apiGroups:
|
||||
- coordination.k8s.io
|
||||
resources:
|
||||
- leases
|
||||
verbs:
|
||||
- create
|
||||
- apiGroups:
|
||||
- coordination.k8s.io
|
||||
resourceNames:
|
||||
- kube-scheduler
|
||||
- custom-scheduler <1>
|
||||
resources:
|
||||
- leases
|
||||
verbs:
|
||||
- get
|
||||
- update
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- endpoints
|
||||
verbs:
|
||||
- create
|
||||
- apiGroups:
|
||||
- ""
|
||||
resourceNames:
|
||||
- kube-scheduler
|
||||
- custom-scheduler <1>
|
||||
resources:
|
||||
- endpoints
|
||||
verbs:
|
||||
- get
|
||||
- update
|
||||
...
|
||||
----
|
||||
<1> This example uses `custom-scheduler` as the custom scheduler name.
|
||||
|
||||
. Create a `Pod` configuration and specify the name of the custom scheduler in the `schedulerName` parameter:
|
||||
+
|
||||
.Example `custom-scheduler-example.yaml` file
|
||||
[source,yaml]
|
||||
----
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: custom-scheduler-example
|
||||
labels:
|
||||
name: custom-scheduler-example
|
||||
spec:
|
||||
schedulerName: custom-scheduler <1>
|
||||
containers:
|
||||
- name: pod-with-second-annotation-container
|
||||
image: docker.io/ocpqe/hello-pod
|
||||
----
|
||||
<1> The name of the custom scheduler to use, which is `custom-scheduler` in this example. When no scheduler name is supplied, the pod is automatically scheduled using the default scheduler.
|
||||
|
||||
. Create the pod:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc create -f custom-scheduler-example.yaml
|
||||
----
|
||||
|
||||
.Verification
|
||||
|
||||
. Enter the following command to check that the pod was created:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc get pod custom-scheduler-example
|
||||
----
|
||||
+
|
||||
The `custom-scheduler-example` pod is listed in the output:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
custom-scheduler-example 1/1 Running 0 4m
|
||||
----
|
||||
|
||||
. Enter the following command to check that the custom scheduler has scheduled the pod:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc describe pod custom-scheduler-example
|
||||
----
|
||||
+
|
||||
The scheduler, `custom-scheduler`, is listed as shown in the following truncated output:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
Events:
|
||||
Type Reason Age From Message
|
||||
---- ------ ---- ---- -------
|
||||
Normal Scheduled <unknown> custom-scheduler Successfully assigned default/custom-scheduler-example to <node_name>
|
||||
----
|
||||
@@ -76,7 +76,7 @@ The following list of tasks provides an overview of how an administrator can man
|
||||
** xref:../nodes/scheduling/nodes-scheduler-node-selectors.adoc#nodes-scheduler-node-selectors[Node labels and selectors].
|
||||
** xref:../nodes/scheduling/nodes-scheduler-taints-tolerations.adoc#nodes-scheduler-taints-tolerations[Taints and tolerations].
|
||||
** xref:../nodes/scheduling/nodes-scheduler-pod-topology-spread-constraints.adoc#nodes-scheduler-pod-topology-spread-constraints[Pod topology spread constraints].
|
||||
** xref:../nodes/scheduling/nodes-custom-scheduler.adoc#nodes-custom-scheduler[Custom schedulers].
|
||||
** xref:../nodes/scheduling/secondary_scheduler/index.adoc#nodes-secondary-scheduler-about[Secondary scheduling].
|
||||
* xref:../nodes/scheduling/nodes-descheduler.adoc#nodes-descheduler[Configure the descheduler to evict pods] based on specific strategies so that the scheduler reschedules the pods to more appropriate nodes.
|
||||
* xref:../nodes/pods/nodes-pods-configuring.adoc#nodes-pods-configuring-restart_nodes-pods-configuring[Configure how pods behave after a restart using pod controllers and restart policies].
|
||||
* xref:../nodes/pods/nodes-pods-configuring.adoc#nodes-pods-configuring-bandwidth_nodes-pods-configuring[Limit both egress and ingress traffic on a pod].
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
:_content-type: ASSEMBLY
|
||||
[id="nodes-custom-scheduler"]
|
||||
= Running a custom scheduler
|
||||
include::_attributes/common-attributes.adoc[]
|
||||
:context: nodes-custom-scheduler
|
||||
|
||||
toc::[]
|
||||
|
||||
You can run multiple custom schedulers alongside the default scheduler and configure which scheduler to use for each pod.
|
||||
|
||||
[IMPORTANT]
|
||||
====
|
||||
It is supported to use a custom scheduler with {product-title}, but Red Hat does not directly support the functionality of the custom scheduler.
|
||||
|
||||
For information on how to configure the default scheduler, see xref:../../nodes/scheduling/nodes-scheduler-about.adoc#nodes-scheduler-about[Controlling pod placement using the scheduler].
|
||||
====
|
||||
|
||||
To schedule a given pod using a specific scheduler, xref:../../nodes/scheduling/nodes-custom-scheduler.adoc#nodes-custom-scheduler-deploying-pods_nodes-custom-scheduler[specify the name of the scheduler in that `Pod` specification].
|
||||
|
||||
// Deploying a custom scheduler
|
||||
include::modules/nodes-custom-scheduler-deploying.adoc[leveloffset=+1]
|
||||
|
||||
// Deploying pods using a custom scheduler
|
||||
include::modules/nodes-custom-scheduler-pods.adoc[leveloffset=+1]
|
||||
|
||||
[role="_additional-resources"]
|
||||
[id="additional-resources_nodes-custom-scheduler"]
|
||||
== Additional resources
|
||||
|
||||
* xref:../../openshift_images/create-images.adoc#images-create-guidelines_create-images[Learning container best practices]
|
||||
Reference in New Issue
Block a user