Skip to content

Commit bbc4a83

Browse files
authored
Merge pull request #39347 from windsonsea/haetcd
[zh] sync setup-ha-etcd-with-kubeadm.md
2 parents 1c9d556 + a62f2b0 commit bbc4a83

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

content/zh-cn/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -377,27 +377,29 @@ on Kubernetes dual-stack support see [Dual-stack support with kubeadm](/docs/set
377377
-->
378378
8. 可选:检查集群运行状况
379379
380-
```shell
381-
docker run --rm -it \
382-
--net host \
383-
-v /etc/kubernetes:/etc/kubernetes registry.k8s.io/etcd:${ETCD_TAG} etcdctl \
380+
<!--
381+
If `etcdctl` isn't available, you can run this tool inside a container image.
382+
You would do that directly with your container runtime using a tool such as
383+
`crictl run` and not through Kubernetes
384+
-->
385+
如果 `etcdctl` 不可用,你可以在容器镜像内运行此工具。
386+
你可以使用 `crictl run` 这类工具直接在容器运行时执行此操作,而不是通过 Kubernetes。
387+
388+
```sh
389+
ETCDCTL_API=3 etcdctl \
384390
--cert /etc/kubernetes/pki/etcd/peer.crt \
385391
--key /etc/kubernetes/pki/etcd/peer.key \
386392
--cacert /etc/kubernetes/pki/etcd/ca.crt \
387-
--endpoints https://${HOST0}:2379 endpoint health --cluster
393+
--endpoints https://${HOST0}:2379 endpoint health
388394
...
389395
https://[HOST0 IP]:2379 is healthy: successfully committed proposal: took = 16.283339ms
390396
https://[HOST1 IP]:2379 is healthy: successfully committed proposal: took = 19.44402ms
391397
https://[HOST2 IP]:2379 is healthy: successfully committed proposal: took = 35.926451ms
392398
```
399+
393400
<!--
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`.
395401
- Set `${HOST0}`to the IP address of the host you are testing.
396402
-->
397-
- 将 `${ETCD_TAG}` 设置为你的 etcd 镜像的版本标签,例如 `3.4.3-0`
398-
要查看 kubeadm 使用的 etcd 镜像和标签,请执行
399-
`kubeadm config images list --kubernetes-version ${K8S_VERSION}`
400-
例如,其中的 `${K8S_VERSION}` 可以是 `v1.17.0`
401403
- 将 `${HOST0}` 设置为要测试的主机的 IP 地址。
402404
403405
## {{% heading "whatsnext" %}}
@@ -407,6 +409,6 @@ Once you have an etcd cluster with 3 working members, you can continue setting u
407409
highly available control plane using the
408410
[external etcd method with kubeadm](/docs/setup/production-environment/tools/kubeadm/high-availability/).
409411
-->
410-
一旦拥有了一个正常工作的 3 成员的 etcd 集群,你就可以基于
411-
[使用 kubeadm 外部 etcd 的方法](/zh-cn/docs/setup/production-environment/tools/kubeadm/high-availability/),
412+
一旦拥有了一个正常工作的 3 成员的 etcd 集群,
413+
你就可以基于[使用 kubeadm 外部 etcd 的方法](/zh-cn/docs/setup/production-environment/tools/kubeadm/high-availability/),
412414
继续部署一个高可用的控制平面。

0 commit comments

Comments
 (0)