You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/zh-cn/docs/reference/labels-annotations-taints/_index.md
+26-4Lines changed: 26 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -330,17 +330,39 @@ Kubelet 使用 Go 定义的 `runtime.GOARCH` 填充它。如果你混合使用 A
330
330
331
331
Example: `kubernetes.io/os: "linux"`
332
332
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).
334
337
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.
336
347
-->
348
+
337
349
### kubernetes.io/os {#kubernetes-io-os}
338
350
339
351
例子:`kubernetes.io/os: "linux"`
340
352
341
-
用于:Node
353
+
用于:Node,Pod
354
+
355
+
对于节点,kubelet 会根据 Go 定义的 `runtime.GOOS` 填充这个值。
356
+
你可以很方便地在集群中混合使用操作系统(例如:混合使用 Linux 和 Windows 节点)。
357
+
358
+
你还可以在 Pod 上设置这个标签。
359
+
Kubernetes 允许你为此标签设置任何值;如果你使用此标签,
360
+
你应该将其设置为与该 Pod 实际使用的操作系统相对应的 Go `runtime.GOOS` 字符串。
342
361
343
-
Kubelet 使用 Go 定义的 `runtime.GOOS` 填充它。如果你在集群中混合使用操作系统(例如:混合 Linux 和 Windows 节点),这会很方便。
362
+
当 Pod 的 kubernetes.io/os 标签值与节点上的标签值不匹配时,节点上的 kubelet 不会运行该 Pod。
363
+
但是,kube-scheduler 并未考虑这一点。
364
+
另外,如果你为 Pod 指定的操作系统与运行该 kubelet 的节点操作系统不相同,那么 kubelet 会拒绝运行该 Pod。
0 commit comments