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
Pod os field kubelet #105292
Pod os field kubelet #105292
Conversation
@ravisantoshgudimetla: 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/test-infra repository. |
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
/remove-sig api-machinery |
What is the KEP for this? /label api-review |
264f9d1
to
b6f2ccc
Compare
/lgtm remove the hold after the requisite pr merges (just tagged) |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: derekwaynecarr, ravisantoshgudimetla 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 |
pkg/kubelet/lifecycle/predicate.go
Outdated
} | ||
// Node OS label can be used as source of truth as the OS and arch reconciliation would have happened by now | ||
if nodeOS, ok := labels[v1.LabelOSStable]; ok { | ||
if string(pod.Spec.OS.Name) != nodeOS { |
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.
don't compare the pod os to the node labels, compare it to runtime.GOOS
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.
the pod nodeSelector should be compared to the node labels with the OS/Arch label ensured to match the real runtime.GOOS/GOARCH, but that's distinct from checking the pod.spec.os against runtime.GOOS
5767508
to
7ec9ce6
Compare
138c87c
to
6380487
Compare
6380487
to
da2a298
Compare
@liggitt suggested to not rely on featuregate in kubelet to reject pods. He also suggested to add another featuregate for Pod security standards so that they can get merged in this release instead of waiting till 1.26 or 1.27(when |
/retest |
pkg/kubelet/lifecycle/predicate.go
Outdated
if rejectPodAdmissionBasedOnOSField(admitPod) { | ||
return PodAdmitResult{ | ||
Admit: false, | ||
Reason: "PodOSFieldNodeLabelDoesNotMatch", |
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.
drop NodeLabel from the reason… we're not comparing to the label
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.
pick a reason that will continue to make sense if LCOW is ever supported… maybe PodOSNotSupported
or something?
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.
The only reason for keeping it is - the user may not know about the OS of the node. Sometimes the only object he/she may have access to is node object. In any case, I changed it.
Once kubernetes#104613 and kubernetes#104693 merge, we'll have OS field in pod spec. Kubelet should start rejecting pods where pod.Spec.OS and node's OS(using runtime.GOOS) won't match
da2a298
to
889d45d
Compare
/lgtm |
/retest |
/hold cancel /retest |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Once #104613 and #104693
merge, we'll have OS field in pod spec. Kubelet will also start reconciling labels.
From then on, Kubelet should start rejecting pods
where pod.Spec.OS and node's OS label won't match
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.: