Skip to content

Commit 6a4dd34

Browse files
authored
Merge pull request #34581 from tengqm/zh-resync-assign-pods
[zh-cn] Resync assign pods to nodes
2 parents 07390f1 + 6fdc91b commit 6a4dd34

File tree

1 file changed

+38
-18
lines changed

1 file changed

+38
-18
lines changed

content/zh-cn/docs/tasks/configure-pod-container/assign-pods-nodes.md

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,31 @@ weight: 120
1414
This page shows how to assign a Kubernetes Pod to a particular node in a
1515
Kubernetes cluster.
1616
-->
17-
此页面显示如何将 Kubernetes Pod 分配给 Kubernetes 集群中的特定节点。
18-
17+
此页面显示如何将 Kubernetes Pod 指派给 Kubernetes 集群中的特定节点。
1918

2019
## {{% heading "prerequisites" %}}
2120

2221
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
2322

24-
2523
<!-- steps -->
2624

2725
<!--
2826
## Add a label to a node
2927
30-
1. List the nodes in your cluster:
28+
1. List the {{< glossary_tooltip term_id="node" text="nodes" >}} in your cluster, along with their labels:
3129
-->
3230
## 给节点添加标签
3331

34-
1. 列出集群中的节点
32+
1. 列出你的集群中的{{< glossary_tooltip term_id="node" text="节点" >}},
33+
包括这些节点上的标签:
3534

3635
```shell
3736
kubectl get nodes
3837
```
3938

40-
<!-- The output is similar to this: -->
39+
<!--
40+
The output is similar to this:
41+
-->
4142
输出类似如下:
4243

4344
```
@@ -48,9 +49,9 @@ Kubernetes cluster.
4849
```
4950

5051
<!--
51-
1. Chose one of your nodes, and add a label to it:
52+
1. Choose one of your nodes, and add a label to it:
5253
-->
53-
2. 选择其中一个节点,为它添加标签:
54+
2. 从你的节点中选择一个,为它添加标签:
5455

5556
```shell
5657
kubectl label nodes <your-node-name> disktype=ssd
@@ -64,7 +65,7 @@ Kubernetes cluster.
6465
<!--
6566
1. Verify that your chosen node has a `disktype=ssd` label:
6667
-->
67-
3. 验证你选择的节点是否有 `disktype=ssd` 标签:
68+
3. 验证你选择的节点确实带有 `disktype=ssd` 标签:
6869

6970
```shell
7071
kubectl get nodes --show-labels
@@ -94,18 +95,18 @@ This pod configuration file describes a pod that has a node selector,
9495
`disktype: ssd`. This means that the pod will get scheduled on a node that has
9596
a `disktype=ssd` label.
9697
-->
97-
## 创建一个调度到你选择的节点的 pod
98+
## 创建一个将被调度到你选择的节点的 Pod
9899

99-
此 Pod 配置文件描述了一个拥有节点选择器 `disktype: ssd` 的 Pod。这表明该 Pod 将被调度到
100-
`disktype=ssd` 标签的节点。
100+
此 Pod 配置文件描述了一个拥有节点选择器 `disktype: ssd` 的 Pod。这表明该 Pod
101+
将被调度到有 `disktype=ssd` 标签的节点。
101102

102103
{{< codenew file="pods/pod-nginx.yaml" >}}
103104

104105
<!--
105106
1. Use the configuration file to create a pod that will get scheduled on your
106107
chosen node:
107108
-->
108-
1. 使用该配置文件去创建一个 pod,该 pod 将被调度到你选择的节点上:
109+
1. 使用该配置文件创建一个 Pod,该 Pod 将被调度到你选择的节点上:
109110

110111
```shell
111112
kubectl create -f https://k8s.io/examples/pods/pod-nginx.yaml
@@ -114,25 +115,44 @@ a `disktype=ssd` label.
114115
<!--
115116
1. Verify that the pod is running on your chosen node:
116117
-->
117-
2. 验证 pod 是不是运行在你选择的节点上
118+
2. 验证 Pod 确实运行在你选择的节点上
118119

119120
```shell
120121
kubectl get pods --output=wide
121122
```
122123

123-
<!-- The output is similar to this: -->
124+
<!--
125+
The output is similar to this:
126+
-->
124127
输出类似如下:
125128

126129
```
127130
NAME READY STATUS RESTARTS AGE IP NODE
128131
nginx 1/1 Running 0 13s 10.200.0.4 worker0
129132
```
130133

134+
<!--
135+
## Create a pod that gets scheduled to specific node
136+
137+
You can also schedule a pod to one specific node via setting `nodeName`.
138+
-->
139+
## 创建一个会被调度到特定节点上的 Pod
140+
141+
你也可以通过设置 `nodeName` 将某个 Pod 调度到特定的节点。
142+
143+
{{< codenew file="pods/pod-nginx-specific-node.yaml" >}}
144+
145+
<!--
146+
Use the configuration file to create a pod that will get scheduled on `foo-node` only.
147+
-->
148+
使用此配置文件来创建一个 Pod,该 Pod 将只能被调度到 `foo-node` 节点。
149+
131150
## {{% heading "whatsnext" %}}
132151

133152
<!--
134-
Learn more about
135-
[labels and selectors](/docs/concepts/overview/working-with-objects/labels/).
153+
* Learn more about [labels and selectors](/docs/concepts/overview/working-with-objects/labels/).
154+
* Learn more about [nodes](/docs/concepts/architecture/nodes/).
136155
-->
137-
进一步了解[标签和选择器](/zh-cn/docs/concepts/overview/working-with-objects/labels/)
156+
* 进一步了解[标签和选择算符](/zh-cn/docs/concepts/overview/working-with-objects/labels/)
157+
* 进一步了解[节点](/zh-cn/docs/concepts/architecture/nodes/)
138158

0 commit comments

Comments
 (0)