-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
Changed IsCriticalPod to return true in case of static pods #80491
Changed IsCriticalPod to return true in case of static pods #80491
Conversation
/sig scheduling |
/retest |
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.
/priority important-soon
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.
Thanks for this pr :)
I'm curious to see the results of the test suite after running the two hack
scripts below. You may have an import cycle, in which case we may need to rethink the approach slightly. We'll know for sure after re-running the test suite after running the hack scripts.
pkg/kubelet/types/pod_update.go
Outdated
@@ -23,6 +23,7 @@ import ( | |||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
utilfeature "k8s.io/apiserver/pkg/util/feature" | |||
kubeapi "k8s.io/kubernetes/pkg/apis/core" | |||
kubepod "k8s.io/kubernetes/pkg/kubelet/pod" |
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 run ./hack/update-bazel.sh
to add this new dependency to the proper BUILD.bazel
file.
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 ran the above hack scripts. Doesn't look like it's helping with the import cycle though :(
pkg/kubelet/types/pod_update.go
Outdated
@@ -146,6 +147,9 @@ func (sp SyncPodType) String() string { | |||
// or equal to SystemCriticalPriority. Both the default scheduler and the kubelet use this function | |||
// to make admission and scheduling decisions. | |||
func IsCriticalPod(pod *v1.Pod) bool { | |||
if kubepod.IsStaticPod(pod){ |
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 run ./hack/update-gofmt.sh :)
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.
Looks good. You may have to move IsCriticalPod
to pkg/kubelet/pod
, or another similar move to remove the circular dependency.
Also, please make sure to add adequate tests to cover the new logic.
Thanks @bsalamat! I made the needed change to remove the import cycle. |
pkg/kubelet/types/pod_update_test.go
Outdated
Name: "pod5", | ||
Namespace: "kube-system", | ||
Annotations: map[string]string{ | ||
"scheduler.alpha.kubernetes.io/critical-pod": "file", |
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.
If you meant to add a static pod, the key should have been ConfigSourceAnnotationKey
. What you have used is the deprecated critical annotation key.
/test pull-kubernetes-e2e-gce-100-performance |
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
Please go ahead and squash commits.
Thanks, @hpandeycodeit!
9fdd1c3
to
9e1aa1a
Compare
/test pull-kubernetes-e2e-gce-device-plugin-gpu |
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
/assign @dchen1107
for reviewing and approval
I am not necessarily adverse to this. I know I was out of the SIG node meeting where this was discussed as a result of PTO. I am wondering why the static pod author is not able to set priorityClassName on their manifest to system-cluster-critical ? we have been doing this, and i had not seen an issue with that approach. |
@derekwaynecarr They can set priorityClassName in their podspec, but the integer value of the priority will not be resolved by time a static pod goes through admission logic of Kubelet. Please see #80489 for more info. |
9bea463
to
c05d506
Compare
@derekwaynecarr We discussed this at SIG Node, and I documented what we discussed at the original issue: #80203 (comment) I believe I also recorded the meeting. Please let me know if you had a second thought on it. Otherwise, I plan to approve the pr. Thanks! |
/lgtm Will wait for @derekwaynecarr before giving the final approval. |
@bsalamat thanks for the missing detail. /approve |
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dchen1107, derekwaynecarr, hpandeycodeit 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Currently, If the static pods is critical, the kubelet will not realize it, since it's priority value determines whether the pod is critical or not. So SIG Node decided to consider all static pods as critical regardless of their
PodSpec.PriorityClassName.
Which issue(s) this PR fixes:
Fixes #80489
Does this PR introduce a user-facing change?: