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

Fix csi attach limit node update #70540

Merged

Conversation

gnufied
Copy link
Member

@gnufied gnufied commented Nov 1, 2018

Fix node's allocatable/capacity not being updated with CSI volume limits.

Fixes #70541

I will cover this with e2e but not sure if we want to block behind - kubernetes-csi/csi-test#127

For now I have manually verified that this works.

Events:
  Type     Reason            Age                From               Message
  ----     ------            ----               ----               -------
  Warning  FailedScheduling  11s (x4 over 12s)  default-scheduler  pod has unbound immediate PersistentVolumeClaims
  Warning  FailedScheduling  6s (x3 over 11s)   default-scheduler  0/1 nodes are available: 1 node(s) exceed max volume
 count.

/sig storage

Fix CSI volume limits not showing up in node's capacity and allocatable

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 1, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gnufied

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 Nov 1, 2018
@gnufied gnufied force-pushed the fix-csi-attach-limit-node-update branch from 9f78fb8 to 8313769 Compare November 1, 2018 16:00
@gnufied
Copy link
Member Author

gnufied commented Nov 1, 2018

cc @verult @msau42

@msau42
Copy link
Member

msau42 commented Nov 1, 2018

/assign @verult

@neolit123
Copy link
Member

/kind bug
/priority important-soon

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 1, 2018
@@ -166,7 +168,7 @@ func (nim *nodeInfoManager) updateNode(updateFuncs ...nodeUpdateFunc) error {
}

if needUpdate {
_, updateErr := nodeClient.Update(node)
_, _, updateErr := nodeutil.PatchNodeStatus(kubeClient.CoreV1(), types.NodeName(node.Name), originalNode, node)
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not always the node status that gets updated. For example, for labels are added to the Node object for topology.

Dumb question: why wasn't it working before?

Copy link
Member Author

Choose a reason for hiding this comment

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

Patching status also updates labels and annotations.

Dumb question: why wasn't it working before?

I am not sure I understand. It never updated attach limits in node's allocatable/capacity. it never worked. The unit tests are not enough to capture this stuff. I am working on e2e to make sure this is covered.

Copy link
Contributor

Choose a reason for hiding this comment

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

Previously the fields are updated in the fetched Node object directly, and the object is then passed to Update(). So Update() still sent the request with updated fields right? Why weren't allocatable/capacity updated?

Copy link
Member Author

Choose a reason for hiding this comment

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

We discussed this offline. Hope that answers it.

Copy link
Member Author

@gnufied gnufied Nov 2, 2018

Choose a reason for hiding this comment

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

Added a note about why we are using PatchNodeStatus here.

@gnufied gnufied force-pushed the fix-csi-attach-limit-node-update branch from 8313769 to e12fbd5 Compare November 2, 2018 14:42
@gnufied
Copy link
Member Author

gnufied commented Nov 2, 2018

/test pull-kubernetes-e2e-kops-aws

@verult
Copy link
Contributor

verult commented Nov 2, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 2, 2018
@verult
Copy link
Contributor

verult commented Nov 2, 2018

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 2, 2018
@gnufied gnufied force-pushed the fix-csi-attach-limit-node-update branch from e12fbd5 to 889468b Compare November 2, 2018 19:10
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 2, 2018
@verult
Copy link
Contributor

verult commented Nov 2, 2018

/lgtm
/unhold

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 2, 2018
@gnufied
Copy link
Member Author

gnufied commented Nov 2, 2018

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 2, 2018
@k8s-ci-robot k8s-ci-robot merged commit af583b1 into kubernetes:master Nov 2, 2018
k8s-ci-robot added a commit that referenced this pull request Nov 8, 2018
…0-upstream-release-1.12

Automated cherry pick of #70540: Fix csi volume attach limit
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants