diff --git a/content/zh-cn/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm.md b/content/zh-cn/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm.md index 94ecacdec2..20c8170931 100644 --- a/content/zh-cn/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm.md +++ b/content/zh-cn/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm.md @@ -114,7 +114,8 @@ If you see the following warnings while running `kubeadm init` ``` 这可能是由许多问题引起的。最常见的是: @@ -240,10 +241,12 @@ provider. Please contact the author of the Pod Network add-on to find out whethe Calico, Canal, and Flannel CNI providers are verified to support HostPort. -For more information, see the [CNI portmap documentation](https://github.com/containernetworking/plugins/blob/master/plugins/meta/portmap/README.md). +For more information, see the +[CNI portmap documentation](https://github.com/containernetworking/plugins/blob/master/plugins/meta/portmap/README.md). -If your network provider does not support the portmap CNI plugin, you may need to use the [NodePort feature of -services](/docs/concepts/services-networking/service/#type-nodeport) or use `HostNetwork=true`. +If your network provider does not support the portmap CNI plugin, you may need to use the +[NodePort feature of services](/docs/concepts/services-networking/service/#type-nodeport) +or use `HostNetwork=true`. --> ## `HostPort` 服务无法工作 @@ -267,9 +270,10 @@ services](/docs/concepts/services-networking/service/#type-nodeport) or use `Hos add-on provider to get the latest status of their support for hairpin mode. - If you are using VirtualBox (directly or via Vagrant), you will need to - ensure that `hostname -i` returns a routable IP address. By default the first + ensure that `hostname -i` returns a routable IP address. By default, the first interface is connected to a non-routable host-only network. A work around - is to modify `/etc/hosts`, see this [Vagrantfile](https://github.com/errordeveloper/k8s-playground/blob/22dd39dfc06111235620e6c4404a96ae146f26fd/Vagrantfile#L11) + is to modify `/etc/hosts`, see this + [Vagrantfile](https://github.com/errordeveloper/k8s-playground/blob/22dd39dfc06111235620e6c4404a96ae146f26fd/Vagrantfile#L11) for an example. --> ## 无法通过其服务 IP 访问 Pod @@ -301,12 +305,14 @@ Unable to connect to the server: x509: certificate signed by unknown authority ( regenerate a certificate if necessary. The certificates in a kubeconfig file are base64 encoded. The `base64 --decode` command can be used to decode the certificate and `openssl x509 -text -noout` can be used for viewing the certificate information. + - Unset the `KUBECONFIG` environment variable using: --> - 验证 `$HOME/.kube/config` 文件是否包含有效证书, 并在必要时重新生成证书。在 kubeconfig 文件中的证书是 base64 编码的。 该 `base64 --decode` 命令可以用来解码证书,`openssl x509 -text -noout` 命令可以用于查看证书信息。 + - 使用如下方法取消设置 `KUBECONFIG` 环境变量的值: ```shell @@ -328,7 +334,7 @@ Unable to connect to the server: x509: certificate signed by unknown authority ( - 另一个方法是覆盖 `kubeconfig` 的现有用户 "管理员": ```shell - mv $HOME/.kube $HOME/.kube.bak + mv $HOME/.kube $HOME/.kube.bak mkdir $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config @@ -337,7 +343,8 @@ Unable to connect to the server: x509: certificate signed by unknown authority ( @@ -401,11 +408,15 @@ Error from server (NotFound): the server could not find the requested resource ``` - 如果你正在 Vagrant 中使用 flannel 作为 Pod 网络,则必须指定 flannel 的默认接口名称。 @@ -417,7 +428,8 @@ Error from server (NotFound): the server could not find the requested resource ## 容器使用的非公共 IP @@ -428,10 +440,15 @@ Error from server: Get https://10.19.0.41:10250/containerLogs/default/mysql-ddc6 ``` - 这或许是由于 Kubernetes 使用的 IP 无法与看似相同的子网上的其他 IP 进行通信的缘故, 可能是由机器提供商的政策所导致的。 @@ -471,8 +488,8 @@ Error from server: Get https://10.19.0.41:10250/containerLogs/default/mysql-ddc6 CoreDNS 处于 `CrashLoopBackOff` 时的另一个原因是当 Kubernetes 中部署的 CoreDNS Pod 检测到环路时。 @@ -526,7 +544,7 @@ rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:24 ``` ## 节点上的 `/usr` 被以只读方式挂载 {#usr-mounted-read-only} @@ -648,13 +682,19 @@ for the feature to work. 类似 kubelet 和 kube-controller-manager 这类 Kubernetes 组件使用默认路径 `/usr/libexec/kubernetes/kubelet-plugins/volume/exec/`, 而 FlexVolume 的目录 **必须是可写入的**,该功能特性才能正常工作。 -(**注意**:FlexVolume 在 Kubernetes v1.23 版本中已被弃用) + +{{< note >}} + +FlexVolume 在 Kubernetes v1.23 版本中已被弃用。 +{{< /note >}} 为了解决这个问题,你可以使用 kubeadm 的[配置文件](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta3/)来配置 @@ -700,7 +740,10 @@ be advised that this is modifying a design principle of the Linux distribution. @@ -800,11 +843,14 @@ k8s.io/kubernetes/cmd/kubeadm/app/phases/upgrade.performEtcdStaticPodUpgrade ``` 本次失败的原因是受影响的版本在 PodSpec 中生成的 etcd 清单文件带有不需要的默认值。 这将导致与清单比较的差异,并且 kubeadm 预期 Pod 哈希值将发生变化,但 kubelet 永远不会更新哈希值。 @@ -813,17 +859,15 @@ There are two way to workaround this issue if you see it in your cluster: - 可以运行以下命令跳过 etcd 的版本升级,即受影响版本和 v1.28.3(或更高版本)之间的版本升级: -```shell -kubeadm upgrade {apply|node} [version] --etcd-upgrade=false -``` + ```shell + kubeadm upgrade {apply|node} [version] --etcd-upgrade=false + ``` + + 但不推荐这种方法,因为后续的 v1.28 补丁版本可能引入新的 etcd 版本。 -但不推荐这种方法,因为后续的 v1.28 补丁版本可能引入新的 etcd 版本。 - - 在升级之前,对 etcd 静态 Pod 的清单进行修补,以删除有问题的默认属性: ```patch @@ -869,6 +913,7 @@ This is not recommended in case a new etcd version was introduced by a later v1. ``` 有关此错误的更多信息,请查阅[此问题的跟踪页面](https://github.com/kubernetes/kubeadm/issues/2927)。