Skip to content

Commit c157bfe

Browse files
committed
[zh]Resync /configure-pod-container/static-pod.md
1 parent 9a61519 commit c157bfe

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

content/zh-cn/docs/tasks/configure-pod-container/static-pod.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ title: 创建静态 Pod
33
weight: 170
44
content_type: task
55
---
6+
<!--
7+
reviewers:
8+
- jsafrane
9+
title: Create static Pods
10+
weight: 170
11+
content_type: task
12+
-->
613

714
<!-- overview -->
815

@@ -14,9 +21,8 @@ Unlike Pods that are managed by the control plane (for example, a
1421
{{< glossary_tooltip text="Deployment" term_id="deployment" >}});
1522
instead, the kubelet watches each static Pod (and restarts it if it fails).
1623
-->
17-
1824
**静态 Pod** 在指定的节点上由 kubelet 守护进程直接管理,不需要
19-
{{< glossary_tooltip text="API 服务器" term_id="kube-apiserver" >}} 监管。
25+
{{< glossary_tooltip text="API 服务器" term_id="kube-apiserver" >}}监管。
2026
与由控制面管理的 Pod(例如,{{< glossary_tooltip text="Deployment" term_id="deployment" >}})
2127
不同;kubelet 监视每个静态 Pod(在它失败之后重新启动)。
2228

@@ -48,7 +54,6 @@ instead.
4854
替代这种方式。
4955
{{< /note >}}
5056

51-
5257
{{< note >}}
5358
<!--
5459
The `spec` of a static Pod cannot refer to other API objects
@@ -84,9 +89,8 @@ You can configure a static Pod with either a [file system hosted configuration f
8489
-->
8590
## 创建静态 Pod {#static-pod-creation}
8691

87-
可以通过[文件系统上的配置文件](/zh-cn/docs/tasks/configure-pod-container/static-pod/#configuration-files)
88-
或者 [Web 网络上的配置文件](/zh-cn/docs/tasks/configure-pod-container/static-pod/#pods-created-via-http)
89-
来配置静态 Pod。
92+
可以通过[文件系统上的配置文件](/zh-cn/docs/tasks/configure-pod-container/static-pod/#configuration-files)或者
93+
[Web 网络上的配置文件](/zh-cn/docs/tasks/configure-pod-container/static-pod/#pods-created-via-http)来配置静态 Pod。
9094

9195
<!--
9296
### Filesystem-hosted static Pod manifest {#configuration-files}
@@ -101,8 +105,8 @@ For example, this is how to start a simple web server as a static Pod:
101105
### 文件系统上的静态 Pod 声明文件 {#configuration-files}
102106

103107
声明文件是标准的 Pod 定义文件,以 JSON 或者 YAML 格式存储在指定目录。路径设置在
104-
[Kubelet 配置文件](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/)
105-
`staticPodPath: <目录>` 字段,kubelet 会定期的扫描这个文件夹下的 YAML/JSON
108+
[Kubelet 配置文件](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/)
109+
`staticPodPath: <目录>` 字段,kubelet 会定期的扫描这个文件夹下的 YAML/JSON
106110
文件来创建/删除静态 Pod。
107111
注意 kubelet 扫描目录的时候会忽略以点开头的文件。
108112

@@ -178,8 +182,8 @@ For example, this is how to start a simple web server as a static Pod:
178182
or add the `staticPodPath: <the directory>` field in the
179183
[kubelet configuration file](/docs/reference/config-api/kubelet-config.v1beta1/).
180184
-->
181-
或者在 [Kubelet 配置文件](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/)
182-
中添加 `staticPodPath: <目录>`字段。
185+
或者在 [Kubelet 配置文件](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/)中添加
186+
`staticPodPath: <目录>`字段。
183187
184188
<!--
185189
4. Restart the kubelet. On Fedora, you would run:
@@ -242,7 +246,7 @@ JSON/YAML 格式的 Pod 定义文件。
242246
2. Configure the kubelet on your selected node to use this web manifest by running it with `--manifest-url=<manifest-url>`. On Fedora, edit `/etc/kubernetes/kubelet` to include this line:
243247
-->
244248
2. 通过在选择的节点上使用 `--manifest-url=<manifest-url>` 配置运行 kubelet。
245-
在 Fedora 添加下面这行到 `/etc/kubernetes/kubelet`
249+
在 Fedora 添加下面这行到 `/etc/kubernetes/kubelet`
246250
247251
```
248252
KUBELET_ARGS="--cluster-dns=10.254.0.10 --cluster-domain=kube.local --manifest-url=<manifest-url>"
@@ -325,11 +329,9 @@ static-web 1/1 Running 0 2m
325329
326330
{{< note >}}
327331
<!--
328-
Make sure the kubelet has permission to create the mirror Pod in the API server. If not, the creation request is rejected by the API server. See [Pod Security admission](/docs/concepts/security/pod-security-admission) and [PodSecurityPolicy](/docs/concepts/security/pod-security-policy/).
332+
Make sure the kubelet has permission to create the mirror Pod in the API server. If not, the creation request is rejected by the API server.
329333
-->
330334
要确保 kubelet 在 API 服务上有创建镜像 Pod 的权限。如果没有,创建请求会被 API 服务拒绝。
331-
参阅 [Pod 安全性准入](/zh-cn/docs/concepts/security/pod-security-admission/)和
332-
[Pod 安全策略](/zh-cn/docs/concepts/security/pod-security-policy/)。
333335
{{< /note >}}
334336
335337
<!--
@@ -401,7 +403,7 @@ CONTAINER IMAGE CREATED STATE
401403
402404
The running kubelet periodically scans the configured directory (`/etc/kubernetes/manifests` in our example) for changes and adds/removes Pods as files appear/disappear in this directory.
403405
-->
404-
## 动态增加和删除静态 Pod
406+
## 动态增加和删除静态 Pod {#dynamic-addition-and-removal-of-static-pods}
405407
406408
运行中的 kubelet 会定期扫描配置的目录(比如例子中的 `/etc/kubernetes/manifests` 目录)中的变化,
407409
并且根据文件中出现/消失的 Pod 来添加/删除 Pod。
@@ -411,11 +413,11 @@ The running kubelet periodically scans the configured directory (`/etc/kubernete
411413
# This assumes you are using filesystem-hosted static Pod configuration
412414
# Run these commands on the node where the kubelet is running
413415
#
414-
mv /etc/kubelet.d/static-web.yaml /tmp
416+
mv /etc/kubernetes/manifests/static-web.yaml /tmp
415417
sleep 20
416418
crictl ps
417419
# You see that no nginx container is running
418-
mv /tmp/static-web.yaml /etc/kubelet.d/
420+
mv /tmp/static-web.yaml /etc/kubernetes/manifests/
419421
sleep 20
420422
crictl ps
421423
```

0 commit comments

Comments
 (0)