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/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm.md
+41-36Lines changed: 41 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ weight: 70
18
18
<!--
19
19
While kubeadm is being used as the management tool for external etcd nodes
20
20
in this guide, please note that kubeadm does not plan to support certificate rotation
21
-
or upgrades for such nodes. The longterm plan is to empower the tool
21
+
or upgrades for such nodes. The long-term plan is to empower the tool
22
22
[etcdadm](https://github.com/kubernetes-sigs/etcdadm) to manage these
23
23
aspects.
24
24
-->
@@ -46,27 +46,30 @@ etcd cluster of three members that can be used by kubeadm during cluster creatio
46
46
## {{% heading "prerequisites" %}}
47
47
48
48
<!--
49
-
* Three hosts that can talk to each other over TCP ports 2379 and 2380. This document assumes these default ports. However, they are configurable through the kubeadm config file.
49
+
- Three hosts that can talk to each other over TCP ports 2379 and 2380. This
50
+
document assumes these default ports. However, they are configurable through
* Some infrastructure to copy files between hosts. For example `ssh` and `scp` can satisfy this requirement.
69
+
- Some infrastructure to copy files between hosts. For example `ssh` and `scp`
70
+
can satisfy this requirement.
68
71
-->
69
-
* 一些可以用来在主机间复制文件的基础设施。例如 `ssh` 和 `scp` 就可以满足需求。
72
+
- 一些可以用来在主机间复制文件的基础设施。例如 `ssh` 和 `scp` 就可以满足需求。
70
73
71
74
<!-- steps -->
72
75
@@ -76,13 +79,16 @@ etcd cluster of three members that can be used by kubeadm during cluster creatio
76
79
## 建立集群
77
80
78
81
<!--
79
-
The general approach is to generate all certs on one node and only distribute the *necessary* files to the other nodes.
82
+
The general approach is to generate all certs on one node and only distribute
83
+
the _necessary_ files to the other nodes.
80
84
-->
81
-
一般来说,是在一个节点上生成所有证书并且只分发这些*必要*的文件到其它节点上。
85
+
一般来说,是在一个节点上生成所有证书并且只分发这些**必要**的文件到其它节点上。
82
86
83
87
{{< note >}}
84
88
<!--
85
-
kubeadm contains all the necessary cryptographic machinery to generate the certificates described below; no other cryptographic tooling is required for this example.
89
+
kubeadm contains all the necessary cryptographic machinery to generate
90
+
the certificates described below; no other cryptographic tooling is required for
91
+
this example.
86
92
-->
87
93
kubeadm 包含生成下述证书所需的所有必要的密码学工具;在这个例子中,不需要其他加密工具。
88
94
{{< /note >}}
@@ -119,7 +125,7 @@ on Kubernetes dual-stack support see [Dual-stack support with kubeadm](/docs/set
@@ -196,7 +202,7 @@ on Kubernetes dual-stack support see [Dual-stack support with kubeadm](/docs/set
196
202
```
197
203
198
204
<!--
199
-
1. Generate the certificate authority
205
+
1. Generate the certificate authority.
200
206
201
207
If you already have a CA then the only action that is copying the CA's `crt` and
202
208
`key` file to `/etc/kubernetes/pki/etcd/ca.crt` and
@@ -219,15 +225,15 @@ on Kubernetes dual-stack support see [Dual-stack support with kubeadm](/docs/set
219
225
```
220
226
221
227
<!--
222
-
This creates two files
228
+
This creates two files:
223
229
-->
224
230
这一操作创建如下两个文件:
225
231
226
232
- `/etc/kubernetes/pki/etcd/ca.crt`
227
233
- `/etc/kubernetes/pki/etcd/ca.key`
228
234
229
235
<!--
230
-
1. Create certificates for each member
236
+
1. Create certificates for each member.
231
237
-->
232
238
4. 为每个成员创建证书
233
239
@@ -259,7 +265,7 @@ on Kubernetes dual-stack support see [Dual-stack support with kubeadm](/docs/set
259
265
```
260
266
261
267
<!--
262
-
1. Copy certificates and kubeadm configs
268
+
1. Copy certificates and kubeadm configs.
263
269
The certificates have been generated and now they must be moved to their
264
270
respective hosts.
265
271
-->
@@ -278,7 +284,7 @@ on Kubernetes dual-stack support see [Dual-stack support with kubeadm](/docs/set
278
284
```
279
285
280
286
<!--
281
-
1. Ensure all expected files exist
287
+
1. Ensure all expected files exist.
282
288
283
289
The complete list of required files on `$HOST0` is:
284
290
-->
@@ -327,7 +333,7 @@ on Kubernetes dual-stack support see [Dual-stack support with kubeadm](/docs/set
327
333
```
328
334
329
335
<!--
330
-
On `$HOST2`
336
+
On `$HOST2`:
331
337
-->
332
338
在 `$HOST2` 上:
333
339
@@ -349,7 +355,7 @@ on Kubernetes dual-stack support see [Dual-stack support with kubeadm](/docs/set
349
355
```
350
356
351
357
<!--
352
-
1. Create the static pod manifests
358
+
1. Create the static pod manifests.
353
359
354
360
Now that the certificates and configs are in place it's time to create the
355
361
manifests. On each host run the `kubeadm`command to generate a static manifest
@@ -361,13 +367,13 @@ on Kubernetes dual-stack support see [Dual-stack support with kubeadm](/docs/set
361
367
在每台主机上运行 `kubeadm` 命令来生成 etcd 使用的静态清单。
362
368
363
369
```shell
364
-
root@HOST0 $ kubeadm init phase etcd local --config=/tmp/${HOST0}/kubeadmcfg.yaml
365
-
root@HOST1 $ kubeadm init phase etcd local --config=$HOME/kubeadmcfg.yaml
366
-
root@HOST2 $ kubeadm init phase etcd local --config=$HOME/kubeadmcfg.yaml
370
+
root@HOST0 $ kubeadm init phase etcd local --config=/tmp/${HOST0}/kubeadmcfg.yaml
371
+
root@HOST1 $ kubeadm init phase etcd local --config=$HOME/kubeadmcfg.yaml
372
+
root@HOST2 $ kubeadm init phase etcd local --config=$HOME/kubeadmcfg.yaml
367
373
```
368
374
369
375
<!--
370
-
1. Optional: Check the cluster health
376
+
1. Optional: Check the cluster health.
371
377
-->
372
378
8. 可选:检查集群运行状况
373
379
@@ -385,8 +391,8 @@ on Kubernetes dual-stack support see [Dual-stack support with kubeadm](/docs/set
385
391
https://[HOST2 IP]:2379 is healthy: successfully committed proposal: took = 35.926451ms
386
392
```
387
393
<!--
388
-
Set ${ETCD_TAG} to the version tag of your etcd image. For example 3.4.3-0. To see the etcd image and tag that kubeadm uses execute kubeadm config images list --kubernetes-version ${K8S_VERSION}, where ${K8S_VERSION} is forexample v1.17.0
389
-
Set ${HOST0}to the IP address of the host you are testing.
394
+
- Set `${ETCD_TAG}` to the version tag of your etcd image. For example `3.4.3-0`. To see the etcd image and tag that kubeadm uses execute `kubeadm config images list --kubernetes-version ${K8S_VERSION}`, where `${K8S_VERSION}` is for example `v1.17.0`.
395
+
- Set `${HOST0}`to the IP address of the host you are testing.
0 commit comments