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
@@ -92,7 +91,9 @@ Instructions for other distributions or Kubernetes installations may vary.
92
91
<!--
93
92
## Create a static pod {#static-pod-creation}
94
93
95
-
You can configure a static Pod with either a [file system hosted configuration file](/docs/tasks/configure-pod-container/static-pod/#configuration-files) or a [web hosted configuration file](/docs/tasks/configure-pod-container/static-pod/#pods-created-via-http).
94
+
You can configure a static Pod with either a
95
+
[file system hosted configuration file](/docs/tasks/configure-pod-container/static-pod/#configuration-files)
96
+
or a [web hosted configuration file](/docs/tasks/configure-pod-container/static-pod/#pods-created-via-http).
96
97
-->
97
98
## 创建静态 Pod {#static-pod-creation}
98
99
@@ -102,7 +103,8 @@ You can configure a static Pod with either a [file system hosted configuration f
102
103
<!--
103
104
### Filesystem-hosted static Pod manifest {#configuration-files}
104
105
105
-
Manifests are standard Pod definitions in JSON or YAML format in a specific directory. Use the `staticPodPath: <the directory>` field in the
106
+
Manifests are standard Pod definitions in JSON or YAML format in a specific directory.
107
+
Use the `staticPodPath: <the directory>` field in the
which periodically scans the directory and creates/deletes static Pods as YAML/JSON files appear/disappear there.
108
110
Note that the kubelet will ignore files starting with dots when scanning the specified directory.
@@ -129,11 +131,15 @@ For example, this is how to start a simple web server as a static Pod:
129
131
```
130
132
131
133
<!--
132
-
2. Choose a directory, say `/etc/kubernetes/manifests` and place a web server Pod definition there, for example `/etc/kubernetes/manifests/static-web.yaml`:
134
+
1. Choose a directory, say `/etc/kubernetes/manifests` and place a web server
135
+
Pod definition there, for example `/etc/kubernetes/manifests/static-web.yaml`:
133
136
-->
134
137
2. 选择一个目录,比如在 `/etc/kubernetes/manifests` 目录来保存 Web 服务 Pod 的定义文件,例如
135
138
`/etc/kubernetes/manifests/static-web.yaml`:
136
139
140
+
<!--
141
+
# Run this command on the node where kubelet is running
142
+
-->
137
143
```shell
138
144
# 在 kubelet 运行的节点上执行以下命令
139
145
mkdir -p /etc/kubernetes/manifests/
@@ -156,7 +162,9 @@ For example, this is how to start a simple web server as a static Pod:
156
162
```
157
163
158
164
<!--
159
-
3. Configure your kubelet on the node to use this directory by running it with `--pod-manifest-path=/etc/kubernetes/manifests/` argument. On Fedora edit `/etc/kubernetes/kubelet` to include this line:
165
+
1. Configure your kubelet on the node to use this directory by running it with
@@ -173,7 +181,7 @@ For example, this is how to start a simple web server as a static Pod:
173
181
`staticPodPath: <目录>`字段。
174
182
175
183
<!--
176
-
4. Restart the kubelet. On Fedora, you would run:
184
+
1. Restart the kubelet. On Fedora, you would run:
177
185
178
186
```shell
179
187
# Run this command on the node where the kubelet is running
@@ -230,22 +238,24 @@ JSON/YAML 格式的 Pod 定义文件。
230
238
```
231
239
232
240
<!--
233
-
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:
241
+
1. Configure the kubelet on your selected node to use this web manifest by
242
+
running it with `--manifest-url=<manifest-url>`.
243
+
On Fedora, edit `/etc/kubernetes/kubelet` to include this line:
# Run this command on the node where the kubelet is running
247
-
systemctl restart kubelet
248
-
```
255
+
```shell
256
+
# Run this command on the node where the kubelet is running
257
+
systemctl restart kubelet
258
+
```
249
259
-->
250
260
3. 重启 kubelet。在 Fedora 上,你将运行如下命令:
251
261
@@ -314,7 +324,8 @@ static-web 1/1 Running 0 2m
314
324
315
325
{{< note >}}
316
326
<!--
317
-
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.
327
+
Make sure the kubelet has permission to create the mirror Pod in the API server.
328
+
If not, the creation request is rejected by the API server.
318
329
-->
319
330
要确保 kubelet 在 API 服务上有创建镜像 Pod 的权限。如果没有,创建请求会被 API 服务拒绝。
320
331
{{< /note >}}
@@ -385,6 +396,11 @@ CONTAINER IMAGE CREATED STATE
385
396
386
397
<!--
387
398
Once you identify the right container, you can get the logs for that container with `crictl`:
399
+
400
+
```shell
401
+
# Run these commands on the node where the container is running
402
+
crictl logs <container_id>
403
+
```
388
404
-->
389
405
一旦你找到合适的容器,你就可以使用 `crictl` 获取该容器的日志。
390
406
@@ -400,15 +416,18 @@ crictl logs <container_id>
400
416
```
401
417
402
418
<!--
403
-
To find more about how to debug using `crictl`, please visit [_Debugging Kubernetes nodes with crictl_](https://kubernetes.io/docs/tasks/debug/debug-cluster/crictl/)
419
+
To find more about how to debug using `crictl`, please visit
420
+
[_Debugging Kubernetes nodes with crictl_](/docs/tasks/debug/debug-cluster/crictl/).
The running kubelet periodically scans the configured directory (`/etc/kubernetes/manifests`in our example) forchanges and adds/removes Pods as files appear/disappearin this directory.
428
+
The running kubelet periodically scans the configured directory
429
+
(`/etc/kubernetes/manifests`in our example) for changes and
430
+
adds/removes Pods as files appear/disappear in this directory.
412
431
-->
413
432
## 动态增加和删除静态 Pod {#dynamic-addition-and-removal-of-static-pods}
0 commit comments