Skip to content

Commit 72f5bf1

Browse files
authored
Merge pull request #40332 from pacoxu/patch-15
update kubernetes.io/os description as it can also be used in pod labels
2 parents bfc3f81 + 24586e4 commit 72f5bf1

File tree

1 file changed

+13
-2
lines changed
  • content/en/docs/reference/labels-annotations-taints

1 file changed

+13
-2
lines changed

content/en/docs/reference/labels-annotations-taints/_index.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,20 @@ The Kubelet populates this with `runtime.GOARCH` as defined by Go. This can be h
163163

164164
Example: `kubernetes.io/os: "linux"`
165165

166-
Used on: Node
166+
Used on: Node, Pod
167+
168+
For nodes, the kubelet populates this with `runtime.GOOS` as defined by Go. This can be handy if you are
169+
mixing operating systems in your cluster (for example: mixing Linux and Windows nodes).
170+
171+
You can also set this label on a Pod. Kubernetes allows you to set any value for this label;
172+
if you use this label, you should nevertheless set it to the Go `runtime.GOOS` string for the operating
173+
system that this Pod actually works with.
167174

168-
The Kubelet populates this with `runtime.GOOS` as defined by Go. This can be handy if you are mixing operating systems in your cluster (for example: mixing Linux and Windows nodes).
175+
When the `kubernetes.io/os` label value for a Pod does not match the label value on a Node,
176+
the kubelet on the node will not admit the Pod. However, this is not taken into account by
177+
the kube-scheduler. Alternatively, the kubelet refuses to run a Pod where you have specified a Pod OS, if
178+
this isn't the same as the operating system for the node where that kubelet is running. Just
179+
look for [Pods OS](/docs/concepts/workloads/pods/#pod-os) for more details.
169180

170181
### kubernetes.io/metadata.name
171182

0 commit comments

Comments
 (0)