-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Explain use of pod os field #35439
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
Explain use of pod os field #35439
Conversation
✅ Pull request preview available for checkingBuilt without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
/retitle [WIP] Explain use of pod os field |
08f595b
to
e990b19
Compare
Hi from the Comms team! Just a reminder that the Ready to Review deadline for feature blogs is Tuesday, August 16. You will also be assigned a publication date post-release. Is there anything we can do to help you right now? |
onto the container runtime, it'd be better to identify the OS early in the life-cycle of pod and use the | ||
identification mechanism consistently across all kubernetes components including `kubelet`. | ||
With that in mind, `OS` field has been added to the pod spec in 1.23 release of kubernetes as an | ||
alpha feature and it graduated to stable in 1.25.`PodSecurity` admission plugin has been updated to use the `OS` field. |
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.
alpha feature and it graduated to stable in 1.25.`PodSecurity` admission plugin has been updated to use the `OS` field. | |
alpha feature and it graduated to stable in 1.25. In addition, the `PodSecurity` admission plugin has been updated to use the `OS` field. |
Or something like that
Mabye a link to the admission plugin?
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 field is os
. In the Golang code the capitalization is different, but to a Kubernetes end user the field name is all-lowercase.
|
||
## What problems does this solve? | ||
|
||
Today, the `kube-apiserver` and `kubelet` while admitting pods have no notion of the OS on which the pod can run. |
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.
Today, the `kube-apiserver` and `kubelet` while admitting pods have no notion of the OS on which the pod can run. | |
Today, at pod admission time the `kube-apiserver` and `kubelet` have no notion of the OS on which the pod can run. |
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.
Today, the `kube-apiserver` and `kubelet` while admitting pods have no notion of the OS on which the pod can run. | |
In the first releases of Kubernetes the `kube-apiserver` did not have record any detail | |
about which operating system a Pod should run on. Initially, Kubernetes only supported Linux | |
nodes; later, Kubernetes added support for Windows nodes (stable since Kubernetes v1.14). | |
You could use [labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) | |
to give the scheduler a hint about where to place your Pod, but the actual Pod API didn't track that | |
OS at all. | |
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.
Some early feedback.
/hold
as valid a publication date isn't assigned yet
@@ -0,0 +1,50 @@ | |||
# Identify Pod Operating System authoritatively during pod admission time |
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.
# Identify Pod Operating System authoritatively during pod admission time |
layout: blog | ||
title: "Identifying pod operating system authoritatively during pod admission time" | ||
date: 2022-07-27 | ||
slug: Identifying pod operating system authoritatively during pod admission time |
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.
slug: Identifying pod operating system authoritatively during pod admission time | |
slug: pod-os-field-explained |
|
||
**Authors:** Ravi Gudimetla (Apple) | ||
|
||
This blog describes how to identify pod's operating system authoritatively using the `OS` field in the pod spec and how 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.
This blog describes how to identify pod's operating system authoritatively using the `OS` field in the pod spec and how it | |
This article describes how to identify pod's operating system authoritatively using the `os` field in the pod spec, and how that |
|
||
## What problems does this solve? | ||
|
||
Today, the `kube-apiserver` and `kubelet` while admitting pods have no notion of the OS on which the pod can run. |
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.
Today, the `kube-apiserver` and `kubelet` while admitting pods have no notion of the OS on which the pod can run. | |
In the first releases of Kubernetes the `kube-apiserver` did not have record any detail | |
about which operating system a Pod should run on. Initially, Kubernetes only supported Linux | |
nodes; later, Kubernetes added support for Windows nodes (stable since Kubernetes v1.14). | |
You could use [labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) | |
to give the scheduler a hint about where to place your Pod, but the actual Pod API didn't track that | |
OS at all. | |
## What problems does this solve? | ||
|
||
Today, the `kube-apiserver` and `kubelet` while admitting pods have no notion of the OS on which the pod can run. | ||
As a result, the end user of the kubernetes cluster can set Linux specific security constraints onto Windows pods or vice-versa. |
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.
As a result, the end user of the kubernetes cluster can set Linux specific security constraints onto Windows pods or vice-versa. | |
As a result, the end user of a Kubernetes cluster can specify Linux specific security constraints onto Windows pods, or vice-versa. |
|
||
|
||
## How does it work? | ||
A new field called `OS` has been added to the pod spec. Every object in kubernetes is validated before 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.
A new field called `OS` has been added to the pod spec. Every object in kubernetes is validated before it | |
Pods now have an optional `.spec.os` field (and this is a stable feature, available in every cluster running | |
Kubernetes v1.25 or later). Every object in Kubernetes is validated before it |
gets persisted to etcd during API admission time, including pod object. Using the `OS` field in pod spec, | ||
we introduced new validation which forbids Linux specific constraints to be set on Windows pods and vice-versa. |
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.
gets persisted to etcd during API admission time, including pod object. Using the `OS` field in pod spec, | |
we introduced new validation which forbids Linux specific constraints to be set on Windows pods and vice-versa. | |
gets persisted to etcd during API admission time, including pod object. Kubernetes v1.25 also introduced | |
new validation which forbids you from setting Linux specific constraints on Windows pods and vice-versa. | |
`` |
- AllowPrivilegeEscalation | ||
- Capabilities | ||
- SeccompProfile | ||
when `pod.Spec.OS.Name` is set to `Windows` |
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.
when `pod.Spec.OS.Name` is set to `Windows` | |
when you set `.spec.os.name` for a Pod to `Windows`. |
|
||
|
||
## How do I use it? | ||
By setting `pod.Spec.OS.Name=Windows` or `pod.Spec.OS.Name=Linux` |
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 consider providing an example manifest for a Pod.
KEP: https://github.com/kubernetes/enhancements/issues/2802 | ||
API Changes: https://github.com/kubernetes/kubernetes/pull/104693 |
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.
Once https://kubernetes.io/docs/concepts/workloads/pods/ mentions the new field (see #35590), please link there.
Hi there! Your assigned publication date is September 5. Thank you! |
@ravisantoshgudimetla it'd be great to get this PR ready for review. Would you like help with that? |
--- | ||
layout: blog | ||
title: "Identifying pod operating system authoritatively during pod admission time" | ||
date: 2022-07-27 |
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.
date: 2022-07-27 | |
date: 2022-09-05 |
Also please rename the file to 2022-09-05-pod-os-field.md
Hi @ravisantoshgudimetla , this blog post is scheduled to be published next week on Sept 5. |
e990b19
to
30434e6
Compare
30434e6
to
e67e7c1
Compare
(if this is ready for review, please edit the PR title or add a comment to make it clear that this work should move forward) |
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. Some feedback that I recommend applying.
@katcosgrove let's postpone this one a week - does that work? |
@sftim We can do September 12! |
@ravisantoshgudimetla we're happy to have a version of this article for the blog, but it has missed the timings for post-release blogs. Even though the timing didn't work out, I'd like to make use of the work that has gone in. Let's aim for a new date. How about the 19th of October? Does that work. You need to make two changes: one to the filename, and another to the date in the front matter. |
--- | ||
layout: blog | ||
title: "Identifying Pod Operating System Authoritatively During Pod Admission Time" | ||
date: 2022-09-20 |
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 proposed published date has passed, the filename also needs to be changed
date: 2022-09-20 | |
date: 2022-10-19 |
Hi @kubernetes/sig-windows-leads, can we get a technical review for this blog |
/sig windows |
|
||
In the first releases of Kubernetes the `kube-apiserver` did not record any detail about which operating system a Pod should run on. Initially, Kubernetes only supported Linux | ||
nodes; later, Kubernetes added support for Windows nodes (stable since Kubernetes v1.14). | ||
You could use [labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) |
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.
Maybe we should just say there are many different ways to give the scheduler a hint?
One of the more common ways is to use a nodeSelector.
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'll reword it to While Kubernetes has multiple ways to hint scheduler about the node on which pod needs to run, a more common way is to use nodeSelector
, WDYT?
One of the big motivating factors of having this pod os field is so that windows pods can still be scheduled with I think it would be good to highlight this in the blog post. |
@ravisantoshgudimetla would you be willing to to revise this in light of #35439 (comment) ? |
@ravisantoshgudimetla Ready to give this another stab? |
@ravisantoshgudimetla Ping! |
Ping @ravisantoshgudimetla . If you're not available, we can take over this PR and address the necessary changes. |
Hey all, I was out for the past few weeks, I can address the changes and will update this PR this week. |
Co-authored-by: Mark Rossetti <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I have added it here - https://github.com/kubernetes/website/pull/35439/files#diff-f2f020ab42d6a660ddb4835f70a43f8a64f9f50204e7ab49d0f275d76af4345cR31. PTAL |
@ravisantoshgudimetla how about a new publication date - perhaps the 14th of March 2023? If you would like to aim for that, we can see if we can get reviews to happen on the blog team side. |
Adding another friendly ping here @ravisantoshgudimetla 🙂 @sftim Lets choose a new publication date – perhaps a couple of months or so away from today? That way Ravi has enough time to address feedback and the blog team have enough time in parallel to review. |
@ravisantoshgudimetla - can you make me a collaborator on your k/webite fork and then I can help push this through? |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifeycycle stale |
@ravisantoshgudimetla : Please advise if you'd like to continue work on this PR and also, let us know of a realistic target date for publication. Additionally, it'd be great if you could grant collaborator access to @marosset as requested in the above comments. This has been in the works for a year and I'm sure you'd appreciate that we'd like to see this merged sooner rather than later. |
Hey @ravisantoshgudimetla , thank you for all your hard work on this! However, since there has been no activity on addressing the feedback despite repeated reminders we'll be closing the PR. Please feel free to reopen the PR whenever you have the bandwidth to work together so that we can get this blog published. |
@divya-mohan0209: Closed this PR. In response to this:
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. |
Identify OS authoritatively during pod admission time using
pod.OS
field