Skip to content

Commit 37f46ed

Browse files
authored
Merge pull request #25423 from jiaj12/patch-39
Update node-conformance.md
2 parents d4121d4 + 980d7f1 commit 37f46ed

File tree

1 file changed

+46
-24
lines changed

1 file changed

+46
-24
lines changed

content/zh/docs/setup/best-practices/node-conformance.md

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,32 +59,38 @@ To run the node conformance test, perform the following steps:
5959
要运行节点一致性测试,请执行以下步骤:
6060

6161
<!--
62-
1. Point your Kubelet to localhost `--api-servers="http://localhost:8080"`,
63-
because the test framework starts a local master to test Kubelet. There are some
64-
other Kubelet flags you may care:
62+
1. Work out the value of the `--kubeconfig` option for the kubelet; for example:
63+
`--kubeconfig=/var/lib/kubelet/config.yaml`.
64+
Because the test framework starts a local control plane to test the kubelet,
65+
use `http://localhost:8080` as the URL of the API server.
66+
There are some other kubelet command line parameters you may want to use:
6567
* `--pod-cidr`: If you are using `kubenet`, you should specify an arbitrary CIDR
6668
to Kubelet, for example `--pod-cidr=10.180.0.0/24`.
6769
* `--cloud-provider`: If you are using `--cloud-provider=gce`, you should
6870
remove the flag to run the test.
6971
-->
70-
1. 因为测试框架会启动一个本地的 master 来测试 Kubelet,所以将 Kubelet 指向本机 `--api-servers="http://localhost:8080"。
71-
还有一些其他 Kubelet 参数可能需要注意:
72-
* `--pod-cidr`: 如果使用 `kubenet`, 需要为 Kubelet 任意指定一个 CIDR, 例如 `--pod-cidr=10.180.0.0/24`
73-
* `--cloud-provider`: 如果使用 `--cloud-provider=gce`,需要移除这个参数来运行测试。
72+
1. 得出 kubelet 的 `--kubeconfig` 的值;例如:`--kubeconfig=/var/lib/kubelet/config.yaml`.
73+
由于测试框架启动了本地控制平面来测试 kubelet, 因此使用 `http://localhost:8080`
74+
作为API 服务器的 URL。
75+
一些其他的 kubelet 命令行参数可能会被用到:
76+
* `--pod-cidr`: 如果使用 `kubenet`, 需要为 Kubelet 任意指定一个 CIDR,
77+
例如 `--pod-cidr=10.180.0.0/24`
78+
* `--cloud-provider`: 如果使用 `--cloud-provider=gce`,需要移除这个参数
79+
来运行测试。
7480

7581

7682
<!--
7783
2. Run the node conformance test with command:
7884
-->
7985
2. 使用以下命令运行节点一致性测试:
8086

81-
```shell
82-
# $CONFIG_DIR is the pod manifest path of your Kubelet.
83-
# $LOG_DIR is the test output path.
84-
sudo docker run -it --rm --privileged --net=host \
85-
-v /:/rootfs -v $CONFIG_DIR:$CONFIG_DIR -v $LOG_DIR:/var/result \
86-
k8s.gcr.io/node-test:0.2
87-
```
87+
```shell
88+
# $CONFIG_DIR 是您 Kubelet 的 pod manifest 路径。
89+
# $LOG_DIR 是测试的输出路径。
90+
sudo docker run -it --rm --privileged --net=host \
91+
-v /:/rootfs -v $CONFIG_DIR:$CONFIG_DIR -v $LOG_DIR:/var/result \
92+
k8s.gcr.io/node-test:0.2
93+
```
8894

8995
<!--
9096
## Running Node Conformance Test for Other Architectures
@@ -96,11 +102,18 @@ Kubernetes also provides node conformance test docker images for other architect
96102
-->
97103
Kubernetes 也为其他硬件体系结构的系统提供了节点一致性测试的 Docker 镜像:
98104

99-
Arch | Image |
100-
--------|:-----------------:|
101-
amd64 | node-test-amd64 |
102-
arm | node-test-arm |
103-
arm64 | node-test-arm64 |
105+
<!--
106+
| Arch | Image | |
107+
| ----- | :-------------: | ---- |
108+
| amd64 | node-test-amd64 | |
109+
| arm | node-test-arm | |
110+
| arm64 | node-test-arm64 | |
111+
-->
112+
| 架构 | 镜像 | |
113+
| ----- | :-------------: | ---- |
114+
| amd64 | node-test-amd64 | |
115+
| arm | node-test-arm | |
116+
| arm64 | node-test-arm64 | |
104117

105118
<!--
106119
## Running Selected Test
@@ -114,22 +127,31 @@ To run specific tests, overwrite the environment variable `FOCUS` with theregula
114127

115128
```shell
116129
sudo docker run -it --rm --privileged --net=host \
117-
-v /:/rootfs:ro -v $CONFIG_DIR:$CONFIG_DIR -v $LOG_DIR:/var/result \
118-
-e FOCUS=MirrorPod \ # Only run MirrorPod test
119-
k8s.gcr.io/node-test:0.2
130+
-v /:/rootfs:ro -v $CONFIG_DIR:$CONFIG_DIR -v $LOG_DIR:/var/result \
131+
-e FOCUS=MirrorPod \ # Only run MirrorPod test
132+
k8s.gcr.io/node-test:0.2
120133
```
121134

122135
<!--
123136
To skip specific tests, overwrite the environment variable `SKIP` with theregular expression of tests you want to skip.
124137
-->
125138
要跳过特定的测试,请使用您希望跳过的测试的常规表达式覆盖环境变量 `SKIP`
126139

140+
<!--
127141
```shell
128142
sudo docker run -it --rm --privileged --net=host \
129143
-v /:/rootfs:ro -v $CONFIG_DIR:$CONFIG_DIR -v $LOG_DIR:/var/result \
130144
-e SKIP=MirrorPod \ # Run all conformance tests but skip MirrorPod test
131-
k8s.gcr.io/node-test:0.2
145+
k8s.gcr.io/node-test:0.2
132146
```
147+
-->
148+
```shell
149+
sudo docker run -it --rm --privileged --net=host \
150+
-v /:/rootfs:ro -v $CONFIG_DIR:$CONFIG_DIR -v $LOG_DIR:/var/result \
151+
-e SKIP=MirrorPod \ # 运行除 MirrorPod 测试外的所有一致性测试内容
152+
k8s.gcr.io/node-test:0.2
153+
```
154+
133155

134156
<!--
135157
Node conformance test is a containerized version of [node e2e test](https://github.com/kubernetes/community/blob/{{< param "githubbranch" >}}/contributors/devel/e2e-node-tests.md).
@@ -159,4 +181,4 @@ Theoretically, you can run any node e2e test if you configure the container andm
159181
-->
160182

161183
* 测试会在节点上遗留一些 Docker 镜像, 包括节点一致性测试本身的镜像和功能测试相关的镜像。
162-
* 测试会在节点上遗留一些死的容器。这些容器是在功能测试的过程中创建的。
184+
* 测试会在节点上遗留一些死的容器。这些容器是在功能测试的过程中创建的。

0 commit comments

Comments
 (0)