Skip to content

Commit ed816c4

Browse files
authored
Merge pull request #40433 from asa3311/sync-labels-annotations-taints/index.md
[zh-cn] sync labels-annotations-taints/index.md
2 parents 0fb422c + 7179876 commit ed816c4

File tree

1 file changed

+26
-4
lines changed
  • content/zh-cn/docs/reference/labels-annotations-taints

1 file changed

+26
-4
lines changed

content/zh-cn/docs/reference/labels-annotations-taints/_index.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,17 +330,39 @@ Kubelet 使用 Go 定义的 `runtime.GOARCH` 填充它。如果你混合使用 A
330330
331331
Example: `kubernetes.io/os: "linux"`
332332
333-
Used on: Node
333+
Used on: Node, Pod
334+
335+
For nodes, the kubelet populates this with `runtime.GOOS` as defined by Go. This can be handy if you are
336+
mixing operating systems in your cluster (for example: mixing Linux and Windows nodes).
334337
335-
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).
338+
You can also set this label on a Pod. Kubernetes allows you to set any value for this label;
339+
if you use this label, you should nevertheless set it to the Go `runtime.GOOS` string for the operating
340+
system that this Pod actually works with.
341+
342+
When the `kubernetes.io/os` label value for a Pod does not match the label value on a Node,
343+
the kubelet on the node will not admit the Pod. However, this is not taken into account by
344+
the kube-scheduler. Alternatively, the kubelet refuses to run a Pod where you have specified a Pod OS, if
345+
this isn't the same as the operating system for the node where that kubelet is running. Just
346+
look for [Pods OS](/docs/concepts/workloads/pods/#pod-os) for more details.
336347
-->
348+
337349
### kubernetes.io/os {#kubernetes-io-os}
338350

339351
例子:`kubernetes.io/os: "linux"`
340352

341-
用于:Node
353+
用于:Node,Pod
354+
355+
对于节点,kubelet 会根据 Go 定义的 `runtime.GOOS` 填充这个值。
356+
你可以很方便地在集群中混合使用操作系统(例如:混合使用 Linux 和 Windows 节点)。
357+
358+
你还可以在 Pod 上设置这个标签。
359+
Kubernetes 允许你为此标签设置任何值;如果你使用此标签,
360+
你应该将其设置为与该 Pod 实际使用的操作系统相对应的 Go `runtime.GOOS` 字符串。
342361

343-
Kubelet 使用 Go 定义的 `runtime.GOOS` 填充它。如果你在集群中混合使用操作系统(例如:混合 Linux 和 Windows 节点),这会很方便。
362+
当 Pod 的 kubernetes.io/os 标签值与节点上的标签值不匹配时,节点上的 kubelet 不会运行该 Pod。
363+
但是,kube-scheduler 并未考虑这一点。
364+
另外,如果你为 Pod 指定的操作系统与运行该 kubelet 的节点操作系统不相同,那么 kubelet 会拒绝运行该 Pod。
365+
请查看 [Pod 操作系统](/zh-cn/docs/concepts/workloads/pods/#pod-os) 了解更多详情。
344366

345367
<!--
346368
### kubernetes.io/metadata.name

0 commit comments

Comments
 (0)