From 24586e49e773e89e9d5cd15b2ba433237db3f058 Mon Sep 17 00:00:00 2001 From: Paco Xu Date: Tue, 28 Mar 2023 15:48:44 +0800 Subject: [PATCH] add tips for pod os label: use runtime.GOOS --- .../en/docs/reference/labels-annotations-taints/_index.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/content/en/docs/reference/labels-annotations-taints/_index.md b/content/en/docs/reference/labels-annotations-taints/_index.md index da704bd695f..78ae061da83 100644 --- a/content/en/docs/reference/labels-annotations-taints/_index.md +++ b/content/en/docs/reference/labels-annotations-taints/_index.md @@ -118,7 +118,12 @@ Example: `kubernetes.io/os: "linux"` Used on: Node, Pod -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). +For nodes, 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). + +You can also set this label on a Pod. Kubernetes allows you to set any value for this label; +if you use this label, you should nevertheless set it to the Go `runtime.GOOS` string for the operating +system that this Pod actually works with. When the `kubernetes.io/os` label value for a Pod does not match the label value on a Node, the kubelet on the node will not admit the Pod. However, this is not taken into account by