Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Update nodeInfo once node was cordoned #491

Merged
merged 1 commit into from
Dec 13, 2018

Conversation

jiaxuanzhou
Copy link
Contributor

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #453 with #455
need to update the nodeInfo once the node was cordoned.
#uns
Special notes for your reviewer:
/assign @k82cn
Release note:

NONE

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 6, 2018
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 6, 2018
@jiaxuanzhou jiaxuanzhou changed the title Update nodeInfo once node was cordon(ed) Update nodeInfo once node was cordoned Dec 6, 2018
!reflect.DeepEqual(oldNode.Labels, newNode.Labels)
switch {
// TODO(jiaxuanzhou): reserved for predictions for volumes.
case !reflect.DeepEqual(oldNode.Status, newNode.Status):
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not check Allocatable directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For field of status for node, there are several potential predictions as disk presure, volumes check , mem presure. etc. when scheduling . So i list three logics for this check: status, spec, metaData of the node, and Allocatable is part of the status.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BTW, for resource calculating of the func (ni *NodeInfo) AddTask(task *TaskInfo), there is not any mutex lock for nodeinfo, even the tasks(pods) were handled sequentially , but it is easy to happen that the nodeInfo for the next task(pod) is not the updated one, so the worst result is several pods were bind to the same node and the pods will be reported not enough of cpu 、 mem or GPU..

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 10, 2018
@k82cn
Copy link
Contributor

k82cn commented Dec 13, 2018

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 13, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jiaxuanzhou, k82cn

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 13, 2018
@k8s-ci-robot k8s-ci-robot merged commit b59b7c6 into kubernetes-retired:master Dec 13, 2018
@jiaxuanzhou jiaxuanzhou deleted the nodeUpdate branch December 13, 2018 01:38
kevin-wangzefeng pushed a commit to kevin-wangzefeng/scheduler that referenced this pull request Jun 28, 2019
kevin-wangzefeng pushed a commit to kevin-wangzefeng/scheduler that referenced this pull request Jun 28, 2019
kevin-wangzefeng pushed a commit to kevin-wangzefeng/scheduler that referenced this pull request Jun 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[kube-batch] task still dispatched to the node marked with 'SchedulingDisabled'
3 participants