Skip to content

Commit cb5e1ea

Browse files
committed
[zh] sync /tools/kubeadm/create-cluster-kubeadm.md
1 parent 494a10f commit cb5e1ea

File tree

1 file changed

+34
-30
lines changed

1 file changed

+34
-30
lines changed

content/zh-cn/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm.md

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ slightly as the tool evolves, but the overall implementation should be pretty st
9595
`kubeadm` 工具的整体功能状态为一般可用性(GA)。一些子功能仍在积极开发中。
9696
随着工具的发展,创建集群的实现可能会略有变化,但总体实现应相当稳定。
9797

98+
{{< note >}}
9899
<!--
99100
Any commands under `kubeadm alpha` are, by definition, supported on an alpha level.
100101
-->
101-
{{< note >}}
102-
根据定义,在 `kubeadm alpha` 下的所有命令均在 alpha 级别上受支持。
102+
根据定义,在 `kubeadm alpha` 下的所有命令均在 Alpha 级别上受支持。
103103
{{< /note >}}
104104

105105
<!-- steps -->
@@ -134,6 +134,7 @@ For detailed instructions and other prerequisites, see [Installing kubeadm](/doc
134134
在所有主机上安装 {{< glossary_tooltip term_id="container-runtime" text="容器运行时" >}} 和 kubeadm。
135135
详细说明和其他前提条件,请参见[安装 kubeadm](/zh-cn/docs/setup/production-environment/tools/kubeadm/install-kubeadm/)
136136

137+
{{< note >}}
137138
<!--
138139
If you have already installed kubeadm, run
139140
`apt-get update && apt-get upgrade` or
@@ -143,7 +144,6 @@ When you upgrade, the kubelet restarts every few seconds as it waits in a crashl
143144
kubeadm to tell it what to do. This crashloop is expected and normal.
144145
After you initialize your control-plane, the kubelet runs normally.
145146
-->
146-
{{< note >}}
147147
如果你已经安装了kubeadm,执行 `apt-get update && apt-get upgrade``yum update`
148148
以获取 kubeadm 的最新版本。
149149

@@ -193,8 +193,8 @@ The control-plane node is the machine where the control plane components run, in
193193
communicates with).
194194
-->
195195
控制平面节点是运行控制平面组件的机器,
196-
包括 {{< glossary_tooltip term_id="etcd" >}} (集群数据库)
197-
和 {{< glossary_tooltip text="API Server" term_id="kube-apiserver" >}}
196+
包括 {{< glossary_tooltip term_id="etcd" >}}(集群数据库)
197+
和 {{< glossary_tooltip text="API 服务器" term_id="kube-apiserver" >}}
198198
(命令行工具 {{< glossary_tooltip text="kubectl" term_id="kubectl" >}} 与之通信)。
199199

200200
<!--
@@ -230,7 +230,7 @@ must specify an IPv6 address, for example `--apiserver-advertise-address=2001:db
230230
1. (可选)除非另有说明,否则 `kubeadm` 使用与默认网关关联的网络接口来设置此控制平面节点 API server 的广播地址。
231231
要使用其他网络接口,请为 `kubeadm init` 设置 `--apiserver-advertise-address=<ip-address>` 参数。
232232
要部署使用 IPv6 地址的 Kubernetes 集群,
233-
必须指定一个 IPv6 地址,例如 `--apiserver-advertise-address=2001:db8::101`
233+
必须指定一个 IPv6 地址,例如 `--apiserver-advertise-address=2001:db8::101`
234234

235235
<!--
236236
To initialize the control-plane node run:
@@ -315,8 +315,8 @@ for control plane components and etcd server, provide extra arguments to each co
315315
To reconfigure a cluster that has already been created see
316316
[Reconfiguring a kubeadm cluster](/docs/tasks/administer-cluster/kubeadm/kubeadm-reconfigure).
317317
-->
318-
要重新配置一个已经创建的集群,请参见
319-
[重新配置一个 kubeadm 集群](/zh-cn/docs/tasks/administer-cluster/kubeadm/kubeadm-reconfigure)
318+
要重新配置一个已经创建的集群,
319+
请参见[重新配置一个 kubeadm 集群](/zh-cn/docs/tasks/administer-cluster/kubeadm/kubeadm-reconfigure)
320320

321321
<!--
322322
To run `kubeadm init` again, you must first [tear down the cluster](#tear-down).
@@ -336,8 +336,8 @@ is ready to run Kubernetes. These prechecks expose warnings and exit on errors.
336336
then downloads and installs the cluster control plane components. This may take several minutes.
337337
After it finishes you should see:
338338
-->
339-
`kubeadm init` 首先运行一系列预检查以确保机器
340-
准备运行 Kubernetes。这些预检查会显示警告并在错误时退出。然后 `kubeadm init`
339+
`kubeadm init` 首先运行一系列预检查以确保机器为运行 Kubernetes 准备就绪。
340+
这些预检查会显示警告并在错误时退出。然后 `kubeadm init`
341341
下载并安装集群控制平面组件。这可能会需要几分钟。
342342
完成之后你应该看到:
343343

@@ -464,8 +464,9 @@ Cluster DNS (CoreDNS) will not start up before a network is installed.**
464464
Make sure that your Pod network plugin supports RBAC, and so do any manifests
465465
that you use to deploy it.
466466
-->
467-
- 默认情况下,`kubeadm` 将集群设置为使用和强制使用 [RBAC](/zh-cn/docs/reference/access-authn-authz/rbac/)(基于角色的访问控制)。
468-
确保你的 Pod 网络插件支持 RBAC,以及用于部署它的 manifests 也是如此。
467+
- 默认情况下,`kubeadm` 将集群设置为使用和强制使用
468+
[RBAC](/zh-cn/docs/reference/access-authn-authz/rbac/)(基于角色的访问控制)。
469+
确保你的 Pod 网络插件支持 RBAC,以及用于部署它的清单也是如此。
469470

470471
<!--
471472
- If you want to use IPv6--either dual-stack, or single-stack IPv6 only
@@ -478,12 +479,12 @@ Cluster DNS (CoreDNS) will not start up before a network is installed.**
478479
IPv6 支持已在 CNI [v0.6.0](https://github.com/containernetworking/cni/releases/tag/v0.6.0) 版本中添加。
479480
{{< /caution >}}
480481

482+
{{< note >}}
481483
<!--
482484
Kubeadm should be CNI agnostic and the validation of CNI providers is out of the scope of our current e2e testing.
483485
If you find an issue related to a CNI plugin you should log a ticket in its respective issue
484486
tracker instead of the kubeadm or kubernetes issue trackers.
485487
-->
486-
{{< note >}}
487488
kubeadm 应该是与 CNI 无关的,对 CNI 驱动进行验证目前不在我们的端到端测试范畴之内。
488489
如果你发现与 CNI 插件相关的问题,应在其各自的问题跟踪器中记录而不是在 kubeadm
489490
或 kubernetes 问题跟踪器中记录。
@@ -530,13 +531,12 @@ If your network is not working or CoreDNS is not in the `Running` state, check o
530531
[troubleshooting guide](/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm/)
531532
for `kubeadm`.
532533
-->
533-
如果你的网络无法正常工作或 CoreDNS 不在“运行中”状态,请查看 `kubeadm`
534-
[故障排除指南](/zh-cn/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm/)
534+
如果你的网络无法正常工作或 CoreDNS 不在 `Running` 状态,请查看 `kubeadm`
535+
[故障排除指南](/zh-cn/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm/)
535536

536537
<!--
537538
### Managed node labels
538539
-->
539-
540540
### 托管节点标签 {#managed-node-labels}
541541

542542
<!--
@@ -548,7 +548,7 @@ a privileged client after a node has been created. To do that manually you can d
548548
and ensure it is using a privileged kubeconfig such as the kubeadm managed `/etc/kubernetes/admin.conf`.
549549
-->
550550
默认情况下,kubeadm 启用 [NodeRestriction](/zh-cn/docs/reference/access-authn-authz/admission-controllers/#noderestriction)
551-
准入控制器来限制 kubelets 在节点注册时可以应用哪些标签。准入控制器文档描述 kubelet `--node-labels` 选项允许使用哪些标签。
551+
准入控制器来限制 kubelet 在节点注册时可以应用哪些标签。准入控制器文档描述 kubelet `--node-labels` 选项允许使用哪些标签。
552552
其中 `node-role.kubernetes.io/control-plane` 标签就是这样一个受限制的标签,
553553
kubeadm 在节点创建后使用特权客户端手动应用此标签。
554554
你可以使用一个有特权的 kubeconfig,比如由 kubeadm 管理的 `/etc/kubernetes/admin.conf`
@@ -568,15 +568,17 @@ for example for a single machine Kubernetes cluster, run:
568568
如果你希望能够在控制平面节点上调度 Pod,例如单机 Kubernetes 集群,请运行:
569569

570570
```bash
571-
kubectl taint nodes --all node-role.kubernetes.io/control-plane- node-role.kubernetes.io/master-
571+
kubectl taint nodes --all node-role.kubernetes.io/control-plane-
572572
```
573+
573574
<!--
574575
The output will look something like:
575576
-->
576577
输出看起来像:
577578

578-
```console
579+
```
579580
node "test-01" untainted
581+
...
580582
```
581583

582584
<!--
@@ -675,10 +677,10 @@ The output is similar to:
675677
8cb2de97839780a412b93877f8507ad6c94f73add17d5d7058e91741c9d5ec78
676678
```
677679

680+
{{< note >}}
678681
<!--
679682
To specify an IPv6 tuple for `<control-plane-host>:<control-plane-port>`, IPv6 address must be enclosed in square brackets, for example: `[2001:db8::101]:2073`.
680683
-->
681-
{{< note >}}
682684
要为 `<control-plane-host>:<control-plane-port>` 指定 IPv6 元组,必须将 IPv6 地址括在方括号中,例如:`[2001:db8::101]:2073`
683685
{{< /note >}}
684686

@@ -706,12 +708,12 @@ nodes` when run on the control-plane node.
706708
-->
707709
几秒钟后,当你在控制平面节点上执行 `kubectl get nodes`,你会注意到该节点出现在输出中。
708710

711+
{{< note >}}
709712
<!--
710713
As the cluster nodes are usually initialized sequentially, the CoreDNS Pods are likely to all run
711714
on the first control-plane node. To provide higher availability, please rebalance the CoreDNS Pods
712715
with `kubectl -n kube-system rollout restart deployment coredns` after at least one new node is joined.
713716
-->
714-
{{< note >}}
715717
由于集群节点通常是按顺序初始化的,CoreDNS Pod 很可能都运行在第一个控制面节点上。
716718
为了提供更高的可用性,请在加入至少一个新节点后
717719
使用 `kubectl -n kube-system rollout restart deployment coredns` 命令,重新平衡这些 CoreDNS Pod。
@@ -734,6 +736,8 @@ to your workstation like this:
734736
scp root@<control-plane-host>:/etc/kubernetes/admin.conf .
735737
kubectl --kubeconfig ./admin.conf get nodes
736738
```
739+
740+
{{< note >}}
737741
<!--
738742
The example above assumes SSH access is enabled for root. If that is not the
739743
case, you can copy the `admin.conf` file to be accessible by some other user
@@ -747,7 +751,6 @@ command. That command will print out a KubeConfig file to STDOUT which you
747751
should save to a file and distribute to your user. After that, grant
748752
privileges by using `kubectl create (cluster)rolebinding`.
749753
-->
750-
{{< note >}}
751754
上面的示例假定为 root 用户启用了 SSH 访问。如果不是这种情况,
752755
你可以使用 `scp``admin.conf` 文件复制给其他允许访问的用户。
753756

@@ -773,6 +776,7 @@ If you want to connect to the API Server from outside the cluster you can use
773776
scp root@<control-plane-host>:/etc/kubernetes/admin.conf .
774777
kubectl --kubeconfig ./admin.conf proxy
775778
```
779+
776780
<!--
777781
You can now access the API Server locally at `http://localhost:8001/api/v1`
778782
-->
@@ -789,7 +793,8 @@ switch those off and do no further clean up. You can use
789793
`kubectl config delete-cluster` to delete your local references to the
790794
cluster.
791795
-->
792-
如果你在集群中使用了一次性服务器进行测试,则可以关闭这些服务器,而无需进一步清理。你可以使用 `kubectl config delete-cluster` 删除对集群的本地引用。
796+
如果你在集群中使用了一次性服务器进行测试,则可以关闭这些服务器,而无需进一步清理。
797+
你可以使用 `kubectl config delete-cluster` 删除对集群的本地引用。
793798

794799
<!--
795800
However, if you want to deprovision your cluster more cleanly, you should
@@ -846,7 +851,7 @@ Now remove the node:
846851
现在删除节点:
847852

848853
```bash
849-
kubectl delete node <node name>
854+
kubectl delete node <节点名称>
850855
```
851856

852857
<!--
@@ -871,7 +876,8 @@ See the [`kubeadm reset`](/docs/reference/setup-tools/kubeadm/kubeadm-reset/)
871876
reference documentation for more information about this subcommand and its
872877
options.
873878
-->
874-
有关此子命令及其选项的更多信息,请参见 [`kubeadm reset`](/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-reset/) 参考文档。
879+
有关此子命令及其选项的更多信息,请参见
880+
[`kubeadm reset`](/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-reset/) 参考文档。
875881

876882
<!-- discussion -->
877883

@@ -903,8 +909,7 @@ options.
903909
* 有关 Pod 网络附加组件的更多列表,请参见[集群网络](/zh-cn/docs/concepts/cluster-administration/networking/)页面。
904910
* <a id="other-addons" />请参阅[附加组件列表](/zh-cn/docs/concepts/cluster-administration/addons/)以探索其他附加组件,
905911
包括用于 Kubernetes 集群的日志记录、监视、网络策略、可视化和控制的工具。
906-
* 配置集群如何处理集群事件的日志以及
907-
在 Pod 中运行的应用程序。
912+
* 配置集群如何处理集群事件的日志以及在 Pod 中运行的应用程序。
908913
有关所涉及内容的概述,请参见[日志架构](/zh-cn/docs/concepts/cluster-administration/logging/)
909914

910915
<!--
@@ -946,7 +951,6 @@ match the kubeadm version with the versions of the control plane components, kub
946951
<!--
947952
### kubeadm's skew against the Kubernetes version
948953
-->
949-
950954
### kubeadm 中的 Kubernetes 版本偏差 {#kubeadm-s-skew-against-the-kubernetes-version}
951955

952956
<!--
@@ -1074,10 +1078,10 @@ Workarounds:
10741078
解决方法:
10751079

10761080
<!--
1077-
* Regularly [back up etcd](https://coreos.com/etcd/docs/latest/admin_guide.html). The
1081+
* Regularly [back up etcd](https://etcd.io/docs/v3.5/op-guide/recovery/). The
10781082
etcd data directory configured by kubeadm is at `/var/lib/etcd` on the control-plane node.
10791083
-->
1080-
* 定期[备份 etcd](https://coreos.com/etcd/docs/latest/admin_guide.html)
1084+
* 定期[备份 etcd](https://etcd.io/docs/v3.5/op-guide/recovery/)
10811085
kubeadm 配置的 etcd 数据目录位于控制平面节点上的 `/var/lib/etcd` 中。
10821086

10831087
<!--

0 commit comments

Comments
 (0)