Skip to content

Commit 4d4c083

Browse files
committed
edits
1 parent 24e05a5 commit 4d4c083

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

modules/nodes-scheduler-default-creating.adoc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@
1010
You can control change the default scheduling behavior using a ConfigMap in the `openshift-config` project.
1111
Add and remove predicates and priorities to the ConfigMap to create a _scheduler policy_.
1212

13+
.Sample scheduler configuration map
14+
[source,yaml]
15+
----
16+
kind: ConfigMap
17+
apiVersion: v1
18+
metadata:
19+
name: scheduler-policy
20+
namespace: openshift-config
21+
selfLink: /api/v1/namespaces/openshift-config/configmaps/mypolicy
22+
uid: 83917dfb-4422-11e9-b2c9-0a5e37b2b12e
23+
resourceVersion: '1049773'
24+
creationTimestamp: '2019-03-11T17:24:23Z'
25+
data:
26+
policy.cfg: "{\n\"kind\" : \"Policy\",\n\"apiVersion\" : \"v1\",\n\"predicates\" : [\n\t{\"name\" : \"PodFitsHostPorts\"},\n\t{\"name\" : \"PodFitsResources\"},\n\t{\"name\" : \"NoDiskConflict\"},\n\t{\"name\" : \"NoVolumeZoneConflict\"},\n\t{\"name\" : \"MatchNodeSelector\"},\n\t{\"name\" : \"HostName\"}\n\t],\n\"priorities\" : [\n\t{\"name\" : \"LeastRequestedPriority\", \"weight\" : 10},\n\t{\"name\" : \"BalancedResourceAllocation\", \"weight\" : 1},\n\t{\"name\" : \"ServiceSpreadingPriority\", \"weight\" : 1},\n\t{\"name\" : \"EqualPriority\", \"weight\" : 1}\n\t]\n}\n"
27+
----
28+
1329
.Procedure
1430

1531
To create the scheduler policy:
@@ -44,6 +60,12 @@ To create the scheduler policy:
4460
. Create a ConfigMap based on the JSON file:
4561
+
4662
----
63+
$ oc create configmap -n openshift-config --from-file=policy.cfg <configmap-name>
64+
----
65+
+
66+
For example:
67+
+
68+
----
4769
$ oc create configmap -n openshift-config --from-file=policy.cfg scheduler-policy
4870
4971
configmap/scheduler-policy created

modules/nodes-scheduler-default-modifying.adoc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ To modify the scheduler policy:
3333

3434
Edit the scheduler configuration file to configure the desired
3535
predicates and priorities.
36-
+
36+
3737
.Sample modified scheduler configuration map
3838
[source,yaml]
3939
----
4040
kind: ConfigMap
4141
apiVersion: v1
4242
metadata:
43-
name: mypolicy
43+
name: scheduler-policy
4444
namespace: openshift-config
4545
selfLink: /api/v1/namespaces/openshift-config/configmaps/mypolicy
4646
uid: 83917dfb-4422-11e9-b2c9-0a5e37b2b12e
@@ -49,19 +49,18 @@ metadata:
4949
data:
5050
policy.cfg: "{\n\"kind\" : \"Policy\",\n\"apiVersion\" : \"v1\",\n\"predicates\" : [\n\t{\"name\" : \"PodFitsHostPorts\"},\n\t{\"name\" : \"PodFitsResources\"},\n\t{\"name\" : \"NoDiskConflict\"},\n\t{\"name\" : \"NoVolumeZoneConflict\"},\n\t{\"name\" : \"MatchNodeSelector\"},\n\t{\"name\" : \"HostName\"}\n\t],\n\"priorities\" : [\n\t{\"name\" : \"LeastRequestedPriority\", \"weight\" : 10},\n\t{\"name\" : \"BalancedResourceAllocation\", \"weight\" : 1},\n\t{\"name\" : \"ServiceSpreadingPriority\", \"weight\" : 1},\n\t{\"name\" : \"EqualPriority\", \"weight\" : 1}\n\t]\n}\n"
5151
----
52-
+
52+
5353
For example, the following strings add the `labelpresence` predicate requiring the `rack` label on the nodes and the `labelPreference` priority giving a weight of 2 to the `rack` label:
54-
+
54+
5555
[source,yaml]
5656
----
5757
\n\t{\"name\" : \"labelPresence\", \"label\" : \"rack\", \"presence\" : \"true\"},
5858
\n\t{\"name\" : \"labelPreference\", \"label\" : \"rack\", \"presence\" : \"true\", \"weight\" : 2},\n\t
59-
-----
59+
----
6060

6161
The ConfigMap appears as following with the new priority:
62-
+
62+
6363
[source,yaml]
6464
----
6565
policy.cfg: "{\n\"kind\" : \"Policy\",\n\"apiVersion\" : \"v1\",\n\"predicates\" : [\n\t{\"name\" : \"PodFitsHostPorts\"},\n\t{\"name\" : \"PodFitsResources\"},\n\t{\"name\" : \"NoDiskConflict\"},\n\t{\"name\" : \"NoVolumeZoneConflict\"},\n\t{\"name\" : \"MatchNodeSelector\"},\n\t{\"name\" : \"HostName\"},\n\t{\"name\" : \"labelPresence\", \"label\" : \"rack\", \"presence\" : \"true\"}\n\t],\n\"priorities\" : [\n\t{\"name\" : \"LeastRequestedPriority\", \"weight\" : 10},\n\t{\"name\" : \"BalancedResourceAllocation\", \"weight\" : 1},\n\t{\"name\" : \"ServiceSpreadingPriority\", \"weight\" : 1},\n\t{\"name\" : \"EqualPriority\", \"weight\" : 1},\n\t{\"name\" : \"labelPreference\", \"label\" : \"rack\", \"presence\" : \"true\", \"weight\" : 2},\n\t]\n}\n "
6666
----
67-

0 commit comments

Comments
 (0)