Skip to content
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 cluster-resources.md #736

Merged
merged 1 commit into from
Nov 18, 2024
Merged

Conversation

LavredisG
Copy link
Contributor

@LavredisG LavredisG commented Nov 15, 2024

/kind documentation

@karmada-bot karmada-bot added the kind/documentation Categorizes issue or PR as related to documentation. label Nov 15, 2024
@karmada-bot karmada-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 15, 2024
@@ -267,7 +267,8 @@ The above is a cluster resource model with three grades, each grade defines the

#### Schedule based on Customized Cluster Resource Models

`Cluster resource model` divides the nodes into levels of different intervals. When a Pod needs to be scheduled to a specific cluster, `karmada-scheduler` compares the number of nodes in different clusters that satisfy the requirement based on the resource request of the Pod instance, and it schedules it to a cluster that satisfies the requirement with a larger number of nodes.
`Cluster resource model` classifies the nodes into different grades, which are essentially resource ranges. When a Pod needs to be scheduled to a specific cluster, `karmada-scheduler` compares the number of replicas able to fit on each cluster. To do that it adds up
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the word classifies. Thanks.

@@ -267,7 +267,8 @@ The above is a cluster resource model with three grades, each grade defines the

#### Schedule based on Customized Cluster Resource Models

`Cluster resource model` divides the nodes into levels of different intervals. When a Pod needs to be scheduled to a specific cluster, `karmada-scheduler` compares the number of nodes in different clusters that satisfy the requirement based on the resource request of the Pod instance, and it schedules it to a cluster that satisfies the requirement with a larger number of nodes.
`Cluster resource model` classifies the nodes into different grades, which are essentially resource ranges. When a Pod needs to be scheduled to a specific cluster, `karmada-scheduler` compares the number of replicas able to fit on each cluster. To do that it adds up
the products of the `#(nodes)` * `#(replicas that can fit in each node)` and schedules the Pod to the cluster that can fit the most of them (highest cluster sumproduct).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That may not be correct, the cluster resource model is used by schedule to figure out how many replicas can hold for a specific cluster. That's the only mission.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, would you suggest to delete the part starting from "To do that ... "? I based the conclusion on the examples below, where the cluster that could most pods was chosen.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some like:

The Cluster Resource Model classifies nodes within a cluster based on their available resources. This classification helps the scheduler determine the number of replicas that can fit into each cluster. By categorizing nodes according to their available resources, the Cluster Resource Model enables the scheduler to make decisions about where to place application replicas based on different scheduling strategies.

@@ -351,24 +352,24 @@ status:
grade: 6
```

Suppose the Pod's resource request is for a 3-cores CPU and 20Gi of memory. All nodes that meet Grade 2 and above fulfill this request. Considering the number of nodes available in each cluster, the scheduler prefers to schedule the Pod to member3.
Suppose the Pod's resource request is for a 3-core CPU and 20Gi of memory. All nodes that are classified as grade 3 and above fulfill this request, since we need grade's resource `min` value to be at least as big as the requested value. For example, nodes in grade 2 with less than 3C and 20Gi don't fulfill our requirements, so we eliminate the entire grade due to that. Scheduler will then choose the cluster which can fit the most replicas on its nodes, which in our case is cluster 3, as computed below:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scheduler will then choose the cluster which can fit the most replicas on its nodes, which in our case is cluster 3, as computed below

Maybe we don't need to say the intention of which clusters it will choose, because it depends on the scheduling policy, we just say the result of available replicas each cluster can hold.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I can change that, scheduling result was mentioned in the original english text, so I included it too.

Copy link
Member

@RainbowMango RainbowMango Nov 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like:

The Cluster Resource Model classifies nodes within a cluster based on their available resources. This classification helps the scheduler determine the number of replicas that can fit into each cluster. By categorizing nodes according to their available resources, the Cluster Resource Model enables the scheduler to make decisions about where to place application replicas based on different scheduling strategies.

[edit]: Please ignore this, I should comment it on above. Because it's a general introduction.



Suppose now that the Pod requires 3C and 60Gi. Grade 2 nodes do not satisfy every resource request, so after considering the number of nodes available in each cluster, the scheduler prefers to schedule the Pod to member1.
Suppose now that the Pod requires 5C and 60Gi. In this case, not even grade 3 nodes satisfy the resource request (some may do, but since we can't know for sure, the entire grade has to be eliminated) since 5C > 4C and 60Gi > 32Gi, so after computing which cluster can fit the most replicas on its nodes, we get cluster 3 again, since it can fit 4 replicas, while the rest can fit none:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so after computing which cluster can fit the most replicas on its nodes, we get cluster 3 again, since it can fit 4 replicas, while the rest can fit none:

ditto.

Signed-off-by: LavredisG <lavredisgoume@gmail.com>
Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve
Thanks.

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 18, 2024
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 18, 2024
@karmada-bot karmada-bot merged commit 6338944 into karmada-io:main Nov 18, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/documentation Categorizes issue or PR as related to documentation. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants