-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
kubelet: fix a bug where kubelet wrongly drops the QOSClass field of the Pod's s status when it rejects a Pod #128083
Conversation
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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-sigs/prow repository. |
/cc |
this change is not critical from my point of view. I would think we can take it only if we pair it up with the e2e test I suggested. We can even make this test to be a conformance test in future. |
a4d823b
to
f0edb32
Compare
5b853e4
to
0c1b91f
Compare
/test pull-kubernetes-e2e-gce |
Commented #128083 (comment) - mentioning it here in case the comment will be hard to notice |
0c1b91f
to
090039a
Compare
090039a
to
dbb4729
Compare
Test without this patch:
Test with this patch:
|
expectedStatus.InitContainerStatuses = nil | ||
expectedStatus.ContainerStatuses = nil | ||
// expectedStatus.QOSClass keep it as is | ||
expectedStatus.EphemeralContainerStatuses = nil | ||
expectedStatus.Resize = "" | ||
expectedStatus.ResourceClaimStatuses = nil |
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.
were those not nil
before?
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.
Those are nil. The kube-scheduler will set some fields of the pod status, i.e., conditions
. I don't know whether other components set other fields of the pod status. If other components set the fields of the pod status, the test will fail, so I explicitly set all the fields of the pod status in the same order as the definition.
If it is not required, I will remove 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.
@SergeyKanzhelev should I remove those?
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.
yes please.
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.
removed
expectedStatus.NominatedNodeName = "" | ||
expectedStatus.HostIP = "" | ||
expectedStatus.HostIPs = nil | ||
expectedStatus.PodIP = "" |
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.
Is PodIP not nil in both cases?
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.
same as above.
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.
please remove.
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.
removed
/test pull-kubernetes-e2e-kind-ipv6 |
…s status when it rejects a Pod Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
dbb4729
to
c7e384f
Compare
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.
/lgtm
/approve
LGTM label has been added. Git tree hash: 7405edbfbe37c904d3598393ef710ebdc22d970f
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: carlory, SergeyKanzhelev 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 |
/retest |
The CI https://testgrid.k8s.io/sig-node-cri-o#ci-crio-cgroupv1-node-e2e-unlabelled and https://testgrid.k8s.io/sig-node-cri-o#ci-crio-cgroupv2-node-e2e-unlabelled failed for the adding test case. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
#127744 tries tightening validation on the qosClass field of pod status. It will be forbidden to update the QoS class field via the status subsource. If a Node can not admit a pod, the kubelet will update the pod status with the reason and message and mark the pod as failed but it forgets to keep the qosClass field unchanged. This will cause the pod to be updated with an empty qosClass field. the Pod will stay pending forever because the update is forbidden by a kube-apiserver once #127744 is merged.
Considering the upgrade/downgrade scenario, I submit this PR to fix the issue.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: