New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Scheduler Docs #10742
Update Scheduler Docs #10742
Conversation
@aveshagarwal @ravisantoshgudimetla I worked you on this topic some time back via #7313 Can you PTAL at admin_guide/scheduling/scheduler.adoc to address Jorge's concerns in https://bugzilla.redhat.com/show_bug.cgi?id=1596472 |
@aveshagarwal @ravisantoshgudimetla PTAL at my changes and recommend any other changes? Jorge Luis Tudela Gonzalez de Riancho |
1 similar comment
@aveshagarwal @ravisantoshgudimetla PTAL at my changes and recommend any other changes? Jorge Luis Tudela Gonzalez de Riancho |
@mburke5678 Could you remove weight from the following stanza: https://github.com/openshift/openshift-docs/pull/10742/files#diff-c881c052264120bfc3a506b42de92c15R481
|
@mburke5678 also the above part is incorrectly formatted. |
@@ -634,7 +629,7 @@ concentration of pods. | |||
] | |||
---- | |||
<1> Specify a name for the priority. | |||
<2> Specify a weight from 1 (bad fit) to 10 (best fit). | |||
<2> Specify a weight. Weight can be any positive value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could be negative too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-zero.
@@ -657,22 +652,20 @@ regardless of its value. | |||
"predicates":[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be priorities.
"<label>" <3> | ||
presence: true/false <4> | ||
"<label>" <2> | ||
presence: true/false <3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the above part seems completely incorrect. We are talking about priorities and label preference but the above shows predicate and label presence. The above should be fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aveshagarwal I changed these parameters back to how they were in previous version, before the changes to the scheduling topic were made.
Did you see @jtudelag comments in the BZ: _scheduling based on custom labels does not work... Most of the examples then do not apply.... I am not sure what needs to be changed. It looks like the examples at the bottom have been there for quite some time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mburke5678, I guess what @aveshagarwal means is that first of all, this is a priority function, not a predicate. Then it is "LabelPreference", not "LabelsPresence".
Also, as a function, It always should have a weight. It is still correct in OCP 3.5 examples:
https://docs.openshift.com/container-platform/3.5/admin_guide/scheduler.html#configurable-priority-functions
It was wrongly modifies in 3.6, probably a copy paste (as the file was moved in the doc hierarchy) shit happens ;)
https://docs.openshift.com/container-platform/3.6/admin_guide/scheduling/scheduler.html#configurable-priority-functions
So I guess a backport of all these changes should be done to 3.6 ,3.7 and 3.9.
Main question is if this is still honoured by the scheduler in OCP. Also, the explanation of what the LabelPreference function does should be re-written, as now it is just a copy paste of the LabelPresence predicate. @aveshagarwal should answer these questions, I dont have enought knowledge to do it ;(.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, now I have Configurable Priority: LabelPreference
, with weight
, and label
singlular/
Configurable Predicate: LabelsPresence
, no weight and labels
plural. Also has presence: true/false
.
Need a definition for LabelPreference
. They are slightly different
LabelPreference prefers nodes that have a particular label defined or not, regardless of its value.
LabelsPresence checks whether a particular node has a certain label defined or not, regardless of its value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mburke5678, I guess what @aveshagarwal means is that first of all, this is a priority function, not a predicate. Then it is "LabelPreference", not "LabelsPresence".
Also, as a function, It always should have a weight. It is still correct in OCP 3.5 examples:
https://docs.openshift.com/container-platform/3.5/admin_guide/scheduler.html#configurable-priority-functions
+1
Main question is if this is still honoured by the scheduler in OCP.
If I understand your questions correctly so yes LabelPreference and LabelPresence still work.
Also, the explanation of what the LabelPreference function does should be re-written, as now it is just a copy paste of the LabelPresence predicate. @aveshagarwal should answer these questions, I dont have enought knowledge to do it ;(.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, now I have Configurable Priority: LabelPreference, with weight, and label singlular/
Correct. LabelPreference also has presense: true/false
Configurable Predicate: LabelsPresence, no weight and labels plural. Also has presence: true/false.
correct.
Need a definition for LabelPreference. They are slightly different
LabelPreference prefers nodes that have a particular label defined or not, regardless of its value.
LabelsPresence checks whether a particular node has a certain label defined or not, regardless of its value.
From the code for LabelPreference:
// LabelPreference holds the parameters that are used to configure the corresponding priority function
type LabelPreference struct {
// Used to identify node "groups"
Label string `json:"label"`
// This is a boolean flag
// If true, higher priority is given to nodes that have the label
// If false, higher priority is given to nodes that do not have the label
Presence bool `json:"presence"`
}
From the code for LabelPresence :
// LabelsPresence holds the parameters that are used to configure the corresponding predicate in scheduler policy configuration.
type LabelsPresence struct {
// The list of labels that identify node "groups"
// All of the labels should be either present (or absent) for the node to be considered a fit for hosting the pod
Labels []string `json:"labels"`
// The boolean flag that indicates whether the labels should be present or absent from the node
Presence bool `json:"presence"`
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aveshagarwal
"If true, higher priority is given to nodes that have the label"
What is "true" in this case? The presence of the specified label on a node?
**_LabelPreference_** give priority based on the specified label. If the label is present on a node, that node is given priority. If no label is specified, priority is given to nodes that do not have a label.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is "true" in this case? The presence of the specified label on a node?
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
presence should be quoted
The preview will be availble shortly at:
|
@wjiangjay PTAL |
@@ -241,6 +241,12 @@ you require. | |||
# master-restart api master-restart controllers | |||
---- | |||
|
|||
[NOTE] | |||
==== | |||
There are cases where using configuring scheduler policy to use custom labels does not spread pod as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mburke5678 I'm not a native speaker, but "using configuring scheduler policy" does not seem grammarly correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to mention that is only about ServiceAntiAffinity specifically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtudelag You are correct. I saw that, too; but hadn't pushed the change yet. Thank you.
@aveshagarwal I reworded the note to mention ServiceAntiAffinity and moved it to that section.
https://github.com/openshift/openshift-docs/pull/10742/files#diff-c881c052264120bfc3a506b42de92c15R648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mburke5678 lgtm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mburke5678 lgtm too ;).
"labelsPreference":{ | ||
"label":[ | ||
"label":[ <3> | ||
"rack" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two label here?
] | ||
} | ||
} | ||
} | ||
], | ||
---- | ||
<1> Specify a name for the predicate. | ||
<2> Specify a weight from 1 (bad fit) to 10 (best fit). | ||
<3> Specify a label for matching. | ||
<2> Specify a label for matching. | ||
For example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example:
should be started with newline
Others LGTM |
@avesh Line 667 Two labels here?
|
@openshift/team-documentation PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of picks, suggestions, and questions.
] | ||
} | ||
} | ||
} | ||
], | ||
---- | ||
<1> Specify a name for the predicate. | ||
<2> Specify a weight from 1 (bad fit) to 10 (best fit). | ||
<3> Specify a label for matching. | ||
<2> Specify a label for matching. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/for matching/to match ?
defined or not, regardless of its value. Matching by label can be useful, for | ||
example, where nodes have their physical location or status defined by labels. | ||
**_LabelsPresence_** checks whether a particular node has a specific label. The labels create node _groups_ that the | ||
`LabelPreference` priority uses. Matching by label can be useful, for example, where nodes have their physical location or status defined by labels. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/`LabelPreference`/`labelPreference` ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is correct (I think). Passed dev and QE reviews.
**_LabelsPresence_** checks whether a particular node has a certain label | ||
defined or not, regardless of its value. Matching by label can be useful, for | ||
example, where nodes have their physical location or status defined by labels. | ||
**_LabelsPresence_** checks whether a particular node has a specific label. The labels create node _groups_ that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/**_LabelsPresence_**\The `labelsPresence` parameter
<2> Specify a weight from 1 (bad fit) to 10 (best fit). | ||
<3> Specify a label for matching. | ||
<4> Specify whether the labels are required. | ||
<2> Specify a label for matching. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/for matching/to match
"<label>" <3> | ||
presence: true/false <4> | ||
"<label>" <2> | ||
presence: "true/false" <3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd s/"true/false"/"true" and specify the valid parameters in annotation 3.
---- | ||
<1> Specify a name for the priority. | ||
<2> Specify a weight. Weight can be any non-zero positive value. | ||
<3> Specify a label for matching. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/for matching/to match
regardless of its value. | ||
[NOTE] | ||
==== | ||
There are situations when using `ServiceAntiAffinity` based on custom labels does not spread pod as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/There are situations when/In some situations,
See link:https://access.redhat.com/solutions/3432401[this Red Hat Solution]. | ||
==== | ||
|
||
**_LabelPreference_** gives priority based on the specified label. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/**_LabelPreference_**\The `labelPreference` parameter
---- | ||
<1> Specify a name for the priority. | ||
<2> Specify a weight. Weight can be any non-zero positive value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Weight can be/Enter
] | ||
} | ||
} | ||
} | ||
], | ||
---- | ||
<1> Specify a name for the priority. | ||
<2> Specify a weight from 1 (bad fit) to 10 (best fit). | ||
<2> Specify a weight. Weight can be any non-zero positive value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Weight can be/Enter
@mburke5678 lgtm. |
**_LabelsPresence_** checks whether a particular node has a certain label | ||
defined or not, regardless of its value. Matching by label can be useful, for | ||
example, where nodes have their physical location or status defined by labels. | ||
The `abelsPresence` parameter checks whether a particular node has a specific label. The labels create node _groups_ that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: abelsPresence (L
) is missing
/cherrypick enterprise-3.6 |
@mburke5678: new pull request created: #11277 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherrypick enterprise-3.7 |
@mburke5678: new pull request created: #11278 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherrypick enterprise-3.9 |
/cherrypick enterprise-3.10 |
@mburke5678: new pull request created: #11279 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@mburke5678: new pull request created: #11280 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherrypick enterprise-3.11 |
@mburke5678: new pull request created: #11281 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
"<label>" <3> | ||
presence: true/false <4> | ||
"<label>" <2> | ||
presence: "true" <3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here, the structure should be:
"predicates":[
{
"name":"<name>", (1)
"argument":{
"labelsPresence":{
"labels":[
"<label>" (2)
],
"presence": true (3)
}
}
}
],
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this change in a follow-up PR: #11335
From BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1596472
1. _Wrong statements or examples that I can tell:
Predicates [3] are boolean functions, they return true/false. The example is wrong, it does not make sense to have a weigh in a predicate. Both ServiceAffinity and LabelsPresence Configurable Predicates examples are wrong.
Configurable priorities [4] examples are wrong.
They apply only to one label. So label must be in singular "label", not "labels"
Weight can be any positive value. It does not need to range between 0 and 10. Actually, in [5] you can see a default weight of 10000 in a function._
2. Do we want to add:
Service-Anti-Affinity based on custom labels is not recommended to achieve equal distribution of pods across multiple zones... it's highly recommended to use failure-domain.beta.kubernetes.io/region and failure-domain.beta.kubernetes.io/zone node label
https://access.redhat.com/solutions/3432401