Skip to content

Commit bd63179

Browse files
authored
Merge pull request #27100 from tengqm/zh-sync-install-kubeadm
[zh] Sync install-kubeadm
2 parents b8d7f9f + 5805ef3 commit bd63179

File tree

1 file changed

+52
-47
lines changed

1 file changed

+52
-47
lines changed

content/zh/docs/setup/production-environment/tools/kubeadm/install-kubeadm.md

Lines changed: 52 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,16 @@ For information how to create a cluster with kubeadm once you have performed thi
3030
## {{% heading "prerequisites" %}}
3131

3232
<!--
33-
* One or more machines running one of:
34-
- Ubuntu 16.04+
35-
- Debian 9+
36-
- CentOS 7+
37-
- Red Hat Enterprise Linux (RHEL) 7+
38-
- Fedora 25+
39-
- HypriotOS v1.0.1+
40-
- Flatcar Container Linux (tested with 2512.3.0)
33+
* A compatible Linux host. The Kubernetes project provides generic instructions for Linux distributions based on Debian and Red Hat, and those distributions without a package manager.
4134
* 2 GB or more of RAM per machine (any less will leave little room for your apps)
4235
* 2 CPUs or more
4336
* Full network connectivity between all machines in the cluster (public or private network is fine)
4437
* Unique hostname, MAC address, and product_uuid for every node. See [here](#verify-mac-address) for more details.
4538
* Certain ports are open on your machines. See [here](#check-required-ports) for more details.
4639
* Swap disabled. You **MUST** disable swap in order for the kubelet to work properly.
4740
-->
48-
* 一台或多台运行着下列系统的机器:
49-
- Ubuntu 16.04+
50-
- Debian 9+
51-
- CentOS 7+
52-
- Red Hat Enterprise Linux (RHEL) 7+
53-
- Fedora 25+
54-
- HypriotOS v1.0.1+
55-
- Flatcar Container Linux (使用 2512.3.0 版本测试通过)
41+
* 一台兼容的 Linux 主机。Kubernetes 项目为基于 Debian 和 Red Hat 的 Linux
42+
发行版以及一些不提供包管理器的发行版提供通用的指令
5643
* 每台机器 2 GB 或更多的 RAM (如果少于这个数字将会影响你应用的运行内存)
5744
* 2 CPU 核或更多
5845
* 集群中的所有机器的网络彼此均能相互连接(公网和内网都可以)
@@ -211,7 +198,7 @@ The following table lists container runtimes and their associated socket paths:
211198
212199
| Runtime | Domain Socket |
213200
|------------|---------------------------------|
214-
| Docker | /var/run/docker.sock |
201+
| Docker | /var/run/dockershim.sock |
215202
| containerd | /run/containerd/containerd.sock |
216203
| CRI-O | /var/run/crio/crio.sock |
217204
-->
@@ -225,7 +212,7 @@ The following table lists container runtimes and their associated socket paths:
225212

226213
| 运行时 | 域套接字 |
227214
|------------|----------------------------------|
228-
| Docker | /var/run/docker.sock |
215+
| Docker | /var/run/dockershim.sock |
229216
| containerd | /run/containerd/containerd.sock |
230217
| CRI-O | /var/run/crio/crio.sock |
231218

@@ -289,7 +276,7 @@ kubelet and the control plane is supported, but the kubelet version may never ex
289276
server version. For example, kubelets running 1.7.0 should be fully compatible with a 1.8.0 API server,
290277
but not vice versa.
291278
292-
For information about installing `kubectl`, see [Install and set up kubectl](/docs/tasks/tools/install-kubectl/).
279+
For information about installing `kubectl`, see [Install and set up kubectl](/docs/tasks/tools/).
293280
-->
294281
## 安装 kubeadm、kubelet 和 kubectl
295282

@@ -308,7 +295,7 @@ kubeadm **不能** 帮你安装或者管理 `kubelet` 或 `kubectl`,所以你
308295
的版本不可以超过 API 服务器的版本。
309296
例如,1.7.0 版本的 kubelet 可以完全兼容 1.8.0 版本的 API 服务器,反之则不可以。
310297

311-
有关安装 `kubectl` 的信息,请参阅[安装和设置 kubectl](/zh/docs/tasks/tools/install-kubectl/)文档。
298+
有关安装 `kubectl` 的信息,请参阅[安装和设置 kubectl](/zh/docs/tasks/tools/)文档。
312299

313300
{{< warning >}}
314301
<!--
@@ -332,22 +319,50 @@ For more information on version skews, see:
332319
* Kubeadm 特定的[版本偏差策略](/zh/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/#version-skew-policy)
333320

334321
{{< tabs name="k8s_install" >}}
335-
{{% tab name="Ubuntu、Debian 或 HypriotOS" %}}
322+
{{% tab name="基于 Debian 的发行版" %}}
336323

337-
```bash
338-
sudo apt-get update && sudo apt-get install -y apt-transport-https curl
339-
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
340-
cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
341-
deb https://apt.kubernetes.io/ kubernetes-xenial main
342-
EOF
343-
sudo apt-get update
344-
sudo apt-get install -y kubelet kubeadm kubectl
345-
sudo apt-mark hold kubelet kubeadm kubectl
346-
```
324+
<!--
325+
1. Update the `apt` package index and install packages needed to use the Kubernetes `apt` repository:
326+
-->
327+
1. 更新 `apt` 包索引并安装使用 Kubernetes `apt` 仓库所需要的包:
328+
329+
```shell
330+
sudo apt-get update
331+
sudo apt-get install -y apt-transport-https ca-certificates curl
332+
```
333+
334+
<!--
335+
2. Download the Google Cloud public signing key:
336+
-->
337+
2. 下载 Google Cloud 公开签名秘钥:
338+
339+
```shell
340+
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
341+
```
342+
343+
<!--
344+
3. Add the Kubernetes `apt` repository:
345+
-->
346+
3. 添加 Kubernetes `apt` 仓库:
347+
348+
```shell
349+
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
350+
```
351+
352+
<!--
353+
4. Update `apt` package index, install kubelet, kubeadm and kubectl, and pin their version:
354+
-->
355+
4. 更新 `apt` 包索引,安装 kubelet、kubeadm 和 kubectl,并锁定其版本:
356+
357+
```shell
358+
sudo apt-get update
359+
sudo apt-get install -y kubelet kubeadm kubectl
360+
sudo apt-mark hold kubelet kubeadm kubectl
361+
```
347362

348363
{{% /tab %}}
349364

350-
{{% tab name="CentOS、RHEL 或 Fedora" %}}
365+
{{% tab name="基于 Red Hat 的发行版" %}}
351366

352367
```bash
353368
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
@@ -391,7 +406,7 @@ systemctl enable --now kubelet
391406
配置是 kubeadm 所不支持的。
392407

393408
{{% /tab %}}
394-
{{% tab name="Fedora CoreOS 或 Flatcar Container Linux" %}}
409+
{{% tab name="无包管理器的情况" %}}
395410

396411
<!--
397412
Install CNI plugins (required for most pod network):
@@ -411,11 +426,11 @@ Define the directory to download command files
411426

412427
{{< note >}}
413428
<!--
414-
The DOWNLOAD_DIR variable must be set to a writable directory.
415-
If you are running Flatcar Container Linux, set DOWNLOAD_DIR=/opt/bin.
429+
The `DOWNLOAD_DIR` variable must be set to a writable directory.
430+
If you are running Flatcar Container Linux, set `DOWNLOAD_DIR=/opt/bin`.
416431
-->
417-
DOWNLOAD_DIR 变量必须被设置为一个可写入的目录。
418-
如果你在运行 Flatcar Container Linux,可将 DOWNLOAD_DIR 设置为 /opt/bin。
432+
`DOWNLOAD_DIR` 变量必须被设置为一个可写入的目录。
433+
如果你在运行 Flatcar Container Linux,可将 `DOWNLOAD_DIR` 设置为 `/opt/bin`
419434
{{< /note >}}
420435

421436
```bash
@@ -531,16 +546,6 @@ or `/etc/default/kubelet`(`/etc/sysconfig/kubelet` for RPMs), please remove it a
531546
`/var/lib/kubelet/config.yaml` 文件中)。
532547
{{< /note >}}
533548

534-
<!--
535-
Restarting the kubelet is required:
536-
-->
537-
需要重新启动 kubelet:
538-
539-
```bash
540-
sudo systemctl daemon-reload
541-
sudo systemctl restart kubelet
542-
```
543-
544549
<!--
545550
The automatic detection of cgroup driver for other container runtimes
546551
like CRI-O and containerd is work in progress.

0 commit comments

Comments
 (0)