Skip to content

Commit 55e6274

Browse files
authored
Merge pull request #35597 from Michelle951/michelle03
[zh-cn] updated /kubeadm/troubleshooting-kubeadm.md
2 parents 0c1e9e1 + 6cfb235 commit 55e6274

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

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

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,15 @@ Right after `kubeadm init` there should not be any pods in these states.
222222
You might have to grant it more RBAC privileges or use a newer version. Please file
223223
an issue in the Pod Network providers' issue tracker and get the issue triaged there.
224224
-->
225-
## Pods 处于 `RunContainerError`、`CrashLoopBackOff` 或者 `Error` 状态
225+
## Pod 处于 `RunContainerError`、`CrashLoopBackOff` 或者 `Error` 状态
226226

227-
在 `kubeadm init` 命令运行后,系统中不应该有 pods 处于这类状态。
227+
在 `kubeadm init` 命令运行后,系统中不应该有 Pod 处于这类状态。
228228

229-
- 在 `kubeadm init` 命令执行完后,如果有 pods 处于这些状态之一,请在 kubeadm
229+
- 在 `kubeadm init` 命令执行完后,如果有 Pod 处于这些状态之一,请在 kubeadm
230230
仓库提起一个 issue。`coredns` (或者 `kube-dns`) 应该处于 `Pending` 状态,
231231
直到你部署了网络插件为止。
232232

233-
- 如果在部署完网络插件之后,有 Pods 处于 `RunContainerError`、`CrashLoopBackOff`
233+
- 如果在部署完网络插件之后,有 Pod 处于 `RunContainerError`、`CrashLoopBackOff`
234234
或 `Error` 状态之一,并且 `coredns` (或者 `kube-dns`)仍处于 `Pending` 状态,
235235
那很可能是你安装的网络插件由于某种原因无法工作。你或许需要授予它更多的
236236
RBAC 特权或使用较新的版本。请在 Pod Network 提供商的问题跟踪器中提交问题,
@@ -239,7 +239,7 @@ Right after `kubeadm init` there should not be any pods in these states.
239239
- 如果你安装的 Docker 版本早于 1.12.1,请在使用 `systemd` 来启动 `dockerd` 和重启 `docker` 时,
240240
删除 `MountFlags=slave` 选项。
241241
你可以在 `/usr/lib/systemd/system/docker.service` 中看到 MountFlags。
242-
MountFlags 可能会干扰 Kubernetes 挂载的卷,并使 Pods 处于 `CrashLoopBackOff` 状态。
242+
MountFlags 可能会干扰 Kubernetes 挂载的卷,并使 Pod 处于 `CrashLoopBackOff` 状态。
243243
当 Kubernetes 不能找到 `var/run/secrets/kubernetes.io/serviceaccount` 文件时会发生错误。
244244

245245
<!--
@@ -254,7 +254,7 @@ before CoreDNS may be deployed fully. Hence the `Pending` state before the netwo
254254

255255
这一行为是 **预期之中** 的,因为系统就是这么设计的。
256256
kubeadm 的网络供应商是中立的,因此管理员应该选择
257-
[安装 pod 的网络插件](/zh-cn/docs/concepts/cluster-administration/addons/)。
257+
[安装 Pod 的网络插件](/zh-cn/docs/concepts/cluster-administration/addons/)。
258258
你必须完成 Pod 的网络配置,然后才能完全部署 CoreDNS。
259259
在网络被配置好之前,DNS 组件会一直处于 `Pending` 状态。
260260

@@ -346,17 +346,17 @@ Unable to connect to the server: x509: certificate signed by unknown authority (
346346
-->
347347
## TLS 证书错误
348348

349-
以下错误指出证书可能不匹配
349+
以下错误说明证书可能不匹配
350350

351351
```none
352352
# kubectl get pods
353353
Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")
354354
```
355355

356-
- 验证 `$HOME/.kube/config` 文件是否包含有效证书,
357-
在必要时重新生成证书。在 kubeconfig 文件中的证书是 base64 编码的。
358-
该 `base64 --decode` 命令可以用来解码证书,`openssl x509 -text -noout` 命令
359-
可以用于查看证书信息
356+
- 验证 `$HOME/.kube/config` 文件是否包含有效证书,
357+
并在必要时重新生成证书。在 kubeconfig 文件中的证书是 base64 编码的。
358+
该 `base64 --decode` 命令可以用来解码证书,`openssl x509 -text -noout`
359+
命令可以用于查看证书信息
360360
- 使用如下方法取消设置 `KUBECONFIG` 环境变量的值:
361361

362362
```shell
@@ -388,8 +388,8 @@ in kube-apiserver logs. To fix the issue you must follow these steps:
388388
## Kubelet 客户端证书轮换失败 {#kubelet-client-cert}
389389

390390
默认情况下,kubeadm 使用 `/etc/kubernetes/kubelet.conf` 中指定的 `/var/lib/kubelet/pki/kubelet-client-current.pem` 符号链接
391-
来配置 kubelet 自动轮换客户端证书。如果此轮换过程失败,你可能会在 kube-apiserver 日志中看到
392-
诸如 `x509: certificate has expired or is not yet valid` 之类的错误。要解决此问题,你必须执行以下步骤:
391+
来配置 kubelet 自动轮换客户端证书。如果此轮换过程失败,你可能会在 kube-apiserver 日志中看到诸如
392+
`x509: certificate has expired or is not yet valid` 之类的错误。要解决此问题,你必须执行以下步骤:
393393
<!--
394394
1. Backup and delete `/etc/kubernetes/kubelet.conf` and `/var/lib/kubelet/pki/kubelet-client*` from the failed node.
395395
1. From a working control plane node in the cluster that has `/etc/kubernetes/pki/ca.key` execute
@@ -447,15 +447,15 @@ Error from server (NotFound): the server could not find the requested resource
447447
This may lead to problems with flannel, which defaults to the first interface on a host. This leads to all hosts thinking they have the same public IP address. To prevent this, pass the `--iface eth1` flag to flannel so that the second interface is chosen.
448448
-->
449449

450-
## 在 Vagrant 中使用 flannel 作为 pod 网络时的默认 NIC
450+
## 在 Vagrant 中使用 flannel 作为 Pod 网络时的默认 NIC
451451

452452
以下错误可能表明 Pod 网络中出现问题:
453453

454454
```sh
455455
Error from server (NotFound): the server could not find the requested resource
456456
```
457457

458-
- 如果你正在 Vagrant 中使用 flannel 作为 pod 网络,则必须指定 flannel 的默认接口名称。
458+
- 如果你正在 Vagrant 中使用 flannel 作为 Pod 网络,则必须指定 flannel 的默认接口名称。
459459

460460
Vagrant 通常为所有 VM 分配两个接口。第一个为所有主机分配了 IP 地址 `10.0.2.15`,用于获得 NATed 的外部流量。
461461

@@ -505,7 +505,7 @@ Error from server: Get https://10.19.0.41:10250/containerLogs/default/mysql-ddc6
505505
- 这或许是由于 Kubernetes 使用的 IP 无法与看似相同的子网上的其他 IP 进行通信的缘故,
506506
可能是由机器提供商的政策所导致的。
507507
- DigitalOcean 既分配一个共有 IP 给 `eth0`,也分配一个私有 IP 在内部用作其浮动 IP 功能的锚点,
508-
然而 `kubelet` 将选择后者作为节点的 `InternalIP` 而不是公共 IP
508+
然而 `kubelet` 将选择后者作为节点的 `InternalIP` 而不是公共 IP
509509

510510
使用 `ip addr show` 命令代替 `ifconfig` 命令去检查这种情况,因为 `ifconfig` 命令
511511
不会显示有问题的别名 IP 地址。或者指定的 DigitalOcean 的 API 端口允许从 droplet 中
@@ -547,9 +547,9 @@ kubectl -n kube-system get deployment coredns -o yaml | \
547547
Another cause for CoreDNS to have `CrashLoopBackOff` is when a CoreDNS Pod deployed in Kubernetes detects a loop. [A number of workarounds](https://github.com/coredns/coredns/tree/master/plugin/loop#troubleshooting-loops-in-kubernetes-clusters)
548548
are available to avoid Kubernetes trying to restart the CoreDNS Pod every time CoreDNS detects the loop and exits.
549549
-->
550-
## `coredns` pods 有 `CrashLoopBackOff` 或者 `Error` 状态
550+
## `coredns` Pod 有 `CrashLoopBackOff` 或者 `Error` 状态
551551

552-
如果有些节点运行的是旧版本的 Docker,同时启用了 SELinux,你或许会遇到 `coredns` pods 无法启动的情况。
552+
如果有些节点运行的是旧版本的 Docker,同时启用了 SELinux,你或许会遇到 `coredns` Pod 无法启动的情况。
553553
要解决此问题,你可以尝试以下选项之一:
554554

555555
- 升级到 [Docker 的较新版本](/zh-cn/docs/setup/production-environment/container-runtimes/#docker)。
@@ -601,7 +601,7 @@ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/dock
601601
yum install docker-ce-18.06.1.ce-3.el7.x86_64
602602
```
603603
-->
604-
## etcd pods 持续重启
604+
## etcd Pod 持续重启
605605

606606
如果你遇到以下错误:
607607

@@ -725,9 +725,10 @@ for the feature to work.
725725
在支持 [FlexVolume](https://github.com/kubernetes/community/blob/ab55d85/contributors/devel/sig-storage/flexvolume.md)时,
726726
类似 kubelet 和 kube-controller-manager 这类 Kubernetes 组件使用默认路径
727727
`/usr/libexec/kubernetes/kubelet-plugins/volume/exec/`
728-
而 FlexVolume 的目录 _必须是可写入的_,该功能特性才能正常工作。
728+
而 FlexVolume 的目录 **必须是可写入的**,该功能特性才能正常工作。
729729
(**注意**:FlexVolume 在 Kubernetes v1.23 版本中已被弃用)
730730

731+
731732
<!--
732733
To workaround this issue you can configure the flex-volume directory using the kubeadm
733734
[configuration file](/docs/reference/config-api/kubeadm-config.v1beta3/).
@@ -771,8 +772,8 @@ nodeRegistration:
771772
Alternatively, you can modify `/etc/fstab` to make the `/usr` mount writeable, but please
772773
be advised that this is modifying a design principle of the Linux distribution.
773774
-->
774-
或者,你要可以更改 `/etc/fstab` 使得 `/usr` 目录能够以可写入的方式挂载,不过
775-
请注意这样做本质上是在更改 Linux 发行版的某种设计原则。
775+
或者,你要可以更改 `/etc/fstab` 使得 `/usr` 目录能够以可写入的方式挂载,
776+
不过请注意这样做本质上是在更改 Linux 发行版的某种设计原则。
776777

777778
<!--
778779
## `kubeadm upgrade plan` prints out `context deadline exceeded` error message
@@ -800,8 +801,8 @@ This is a regression introduced in kubeadm 1.15. The issue is fixed in 1.20.
800801
-->
801802
## `kubeadm reset` 会卸载 `/var/lib/kubelet`
802803

803-
如果已经挂载了 `/var/lib/kubelet` 目录,执行 `kubeadm reset` 操作的时候
804-
会将其卸载
804+
如果已经挂载了 `/var/lib/kubelet` 目录,执行 `kubeadm reset`
805+
操作的时候会将其卸载
805806

806807
要解决这一问题,可以在执行了 `kubeadm reset` 操作之后重新挂载
807808
`/var/lib/kubelet` 目录。

0 commit comments

Comments
 (0)