Skip to content

Commit a97611d

Browse files
authored
Merge pull request #47931 from my-git9/pp-20144
[zh-cn] sync kubeadm/create-cluster-kubeadm.md
2 parents 5b675ba + 6b139b0 commit a97611d

File tree

1 file changed

+35
-117
lines changed

1 file changed

+35
-117
lines changed

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

Lines changed: 35 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -311,14 +311,15 @@ communicates with).
311311

312312
<!--
313313
1. (Recommended) If you have plans to upgrade this single control-plane `kubeadm` cluster
314-
to high availability you should specify the `--control-plane-endpoint` to set the shared endpoint
315-
for all control-plane nodes. Such an endpoint can be either a DNS name or an IP address of a load-balancer.
314+
to [high availability](/docs/setup/production-environment/tools/kubeadm/high-availability/)
315+
you should specify the `--control-plane-endpoint` to set the shared endpoint for all control-plane nodes.
316+
Such an endpoint can be either a DNS name or an IP address of a load-balancer.
316317
1. Choose a Pod network add-on, and verify whether it requires any arguments to
317318
be passed to `kubeadm init`. Depending on which
318319
third-party provider you choose, you might need to set the `--pod-network-cidr` to
319320
a provider-specific value. See [Installing a Pod network add-on](#pod-network).
320321
-->
321-
1. (推荐)如果计划将单个控制平面 kubeadm 集群升级成高可用
322+
1. (推荐)如果计划将单个控制平面 kubeadm 集群升级成[高可用](/zh-cn/docs/setup/production-environment/tools/kubeadm/high-availability/)
322323
你应该指定 `--control-plane-endpoint` 为所有控制平面节点设置共享端点。
323324
端点可以是负载均衡器的 DNS 名称或 IP 地址。
324325
2. 选择一个 Pod 网络插件,并验证是否需要为 `kubeadm init` 传递参数。
@@ -633,6 +634,15 @@ control-plane node or a node that has the kubeconfig credentials:
633634
kubectl apply -f <add-on.yaml>
634635
```
635636

637+
{{< note >}}
638+
<!--
639+
Only a few CNI plugins support Windows. More details and setup instructions can be found
640+
in [Adding Windows worker nodes](/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes/#network-config).
641+
-->
642+
只有少数 CNI 插件支持 Windows,
643+
更多详细信息和设置说明请参阅[添加 Windows 工作节点](/zh-cn/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes/#network-config)
644+
{{< /note >}}
645+
636646
<!--
637647
You can install only one Pod network per cluster.
638648
-->
@@ -725,135 +735,43 @@ kubectl label nodes --all node.kubernetes.io/exclude-from-external-load-balancer
725735
```
726736

727737
<!--
728-
### Joining your nodes {#join-nodes}
729-
-->
730-
### 加入节点 {#join-nodes}
731-
732-
<!--
733-
The nodes are where your workloads (containers and Pods, etc) run. To add new nodes to your cluster do the following for each machine:
734-
-->
735-
节点是你的工作负载(容器和 Pod 等)运行的地方。要将新节点添加到集群,请对每台计算机执行以下操作:
736-
737-
<!--
738-
* SSH to the machine
739-
* Become root (e.g. `sudo su -`)
740-
* [Install a runtime](/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#installing-runtime)
741-
if needed
742-
* Run the command that was output by `kubeadm init`. For example:
743-
-->
744-
* SSH 到机器
745-
* 成为 root (例如 `sudo su -`
746-
* 必要时[安装一个运行时](/zh-cn/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#installing-runtime)
747-
* 运行 `kubeadm init` 输出的命令,例如:
748-
749-
```bash
750-
kubeadm join --token <token> <control-plane-host>:<control-plane-port> --discovery-token-ca-cert-hash sha256:<hash>
751-
```
752-
753-
<!--
754-
If you do not have the token, you can get it by running the following command on the control-plane node:
755-
-->
756-
如果你没有令牌,可以通过在控制平面节点上运行以下命令来获取令牌:
738+
### Adding more control plane nodes
757739
758-
```bash
759-
kubeadm token list
760-
```
761-
762-
<!--
763-
The output is similar to this:
764-
-->
765-
输出类似于以下内容:
740+
See [Creating Highly Available Clusters with kubeadm](/docs/setup/production-environment/tools/kubeadm/high-availability/) for steps on creating a high availability kubeadm cluster by adding more control plane
741+
nodes.
766742
767-
```console
768-
TOKEN TTL EXPIRES USAGES DESCRIPTION EXTRA GROUPS
769-
8ewj1p.9r9hcjoqgajrj4gi 23h 2018-06-12T02:51:28Z authentication, The default bootstrap system:
770-
signing token generated by bootstrappers:
771-
'kubeadm init'. kubeadm:
772-
default-node-token
773-
```
743+
### Adding worker nodes {#join-nodes}
774744
775-
<!--
776-
By default, tokens expire after 24 hours. If you are joining a node to the cluster after the current token has expired,
777-
you can create a new token by running the following command on the control-plane node:
778-
-->
779-
默认情况下,令牌会在 24 小时后过期。如果要在当前令牌过期后将节点加入集群,
780-
则可以通过在控制平面节点上运行以下命令来创建新令牌:
745+
The worker nodes are where your workloads run.
781746
782-
```bash
783-
kubeadm token create
784-
```
747+
The following pages show how to add Linux and Windows worker nodes to the cluster by using
748+
the `kubeadm join` command:
785749
786-
<!--
787-
The output is similar to this:
750+
* [Adding Linux worker nodes](/docs/tasks/administer-cluster/kubeadm/adding-linux-nodes/)
751+
* [Adding Windows worker nodes](/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes/)
788752
-->
789-
输出类似于以下内容:
753+
### 添加更多控制平面节点
790754

791-
```console
792-
5didvk.d09sbcov8ph2amjw
793-
```
755+
请参阅[使用 kubeadm 创建高可用性集群](/zh-cn/docs/setup/production-environment/tools/kubeadm/high-availability/)
756+
了解通过添加更多控制平面节点创建高可用性 kubeadm 集群的步骤。
794757

795-
<!--
796-
If you don't have the value of `--discovery-token-ca-cert-hash`, you can get it by running the
797-
following command chain on the control-plane node:
798-
-->
799-
如果你没有 `--discovery-token-ca-cert-hash` 的值,则可以通过在控制平面节点上执行以下命令链来获取它:
800-
801-
```bash
802-
openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | \
803-
openssl dgst -sha256 -hex | sed 's/^.* //'
804-
```
758+
### 添加工作节点 {#join-nodes}
805759

806760
<!--
807-
The output is similar to:
808-
-->
809-
输出类似于以下内容:
810-
811-
```console
812-
8cb2de97839780a412b93877f8507ad6c94f73add17d5d7058e91741c9d5ec78
813-
```
761+
The worker nodes are where your workloads run.
814762
815-
{{< note >}}
816-
<!--
817-
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`.
818-
-->
819-
要为 `<control-plane-host>:<control-plane-port>` 指定 IPv6 元组,必须将 IPv6
820-
地址括在方括号中,例如 `[2001:db8::101]:2073`
821-
{{< /note >}}
763+
The following pages show how to add Linux and Windows worker nodes to the cluster by using
764+
the `kubeadm join` command:
822765
823-
<!--
824-
The output should look something like:
766+
* [Adding Linux worker nodes](/docs/tasks/administer-cluster/kubeadm/adding-linux-nodes/)
767+
* [Adding Windows worker nodes](/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes/)
825768
-->
826-
输出应类似于:
827-
828-
```console
829-
[preflight] Running pre-flight checks
830-
831-
... (log output of join workflow) ...
832-
833-
Node join complete:
834-
* Certificate signing request sent to control-plane and response
835-
received.
836-
* Kubelet informed of new secure connection details.
837-
838-
Run 'kubectl get nodes' on control-plane to see this machine join.
839-
```
769+
工作节点是工作负载运行的地方。
840770

841-
<!--
842-
A few seconds later, you should notice this node in the output from `kubectl get
843-
nodes` when run on the control-plane node.
844-
-->
845-
几秒钟后,当你在控制平面节点上执行 `kubectl get nodes`,你会注意到该节点出现在输出中。
771+
以下页面展示如何使用 `kubeadm join` 命令将 Linux 和 Windows 工作节点添加到集群:
846772

847-
{{< note >}}
848-
<!--
849-
As the cluster nodes are usually initialized sequentially, the CoreDNS Pods are likely to all run
850-
on the first control-plane node. To provide higher availability, please rebalance the CoreDNS Pods
851-
with `kubectl -n kube-system rollout restart deployment coredns` after at least one new node is joined.
852-
-->
853-
由于集群节点通常是按顺序初始化的,CoreDNS Pod 很可能都运行在第一个控制面节点上。
854-
为了提供更高的可用性,请在加入至少一个新节点后使用
855-
`kubectl -n kube-system rollout restart deployment coredns` 命令,重新平衡这些 CoreDNS Pod。
856-
{{< /note >}}
773+
* [添加 Linux 工作节点](/zh-cn/docs/tasks/administer-cluster/kubeadm/adding-linux-nodes/)
774+
* [添加 Windows 工作节点](/zh-cn/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes/)
857775

858776
<!--
859777
### (Optional) Controlling your cluster from machines other than the control-plane node

0 commit comments

Comments
 (0)