创建部署问题时,请参考下面模板,你提供的信息越多,越容易及时获得解答。如果未按模板创建问题,管理员有权关闭问题。
确保帖子格式清晰易读,用 markdown code block 语法格式化代码块。
你只花一分钟创建的问题,不能指望别人花上半个小时给你解答。
操作系统信息
ECS:Centos7.9,8C/32G
Kubernetes版本信息
将 kubectl version
命令执行结果贴在下方
Client Version: version.Info{Major:“1”, Minor:“23”, GitVersion:“v1.23.0”, GitCommit:“ab69524f795c42094a6630298ff53f3c3ebab7f4”, GitTreeState:“clean”, BuildDate:“2021-12-07T18:16:20Z”, GoVersion:“go1.17.3”, Compiler:“gc”, Platform:“linux/amd64”}
Server Version: version.Info{Major:“1”, Minor:“23”, GitVersion:“v1.23.0”, GitCommit:“ab69524f795c42094a6630298ff53f3c3ebab7f4”, GitTreeState:“clean”, BuildDate:“2021-12-07T18:09:57Z”, GoVersion:“go1.17.3”, Compiler:“gc”, Platform:“linux/amd64”}
[root@k8s-0001 kukk]#
[root@k8s-0001 kukk]# kubectl version
Client Version: version.Info{Major:“1”, Minor:“23”, GitVersion:“v1.23.0”, GitCommit:“ab69524f795c42094a6630298ff53f3c3ebab7f4”, GitTreeState:“clean”, BuildDate:“2021-12-07T18:16:20Z”, GoVersion:“go1.17.3”, Compiler:“gc”, Platform:“linux/amd64”}
Server Version: version.Info{Major:“1”, Minor:“23”, GitVersion:“v1.23.0”, GitCommit:“ab69524f795c42094a6630298ff53f3c3ebab7f4”, GitTreeState:“clean”, BuildDate:“2021-12-07T18:09:57Z”, GoVersion:“go1.17.3”, Compiler:“gc”, Platform:“linux/amd64”}
容器运行时
将 docker version
/ crictl version
/ nerdctl version
结果贴在下方
KubeSphere版本信息
例如:v2.1.1/v3.0.0。离线安装还是在线安装。在已有K8s上安装还是使用kk安装。
kk:v3.0.7 在线安装kubesphere:v3.3.2和k8s:v1.23.0
问题是什么
基于阿里云ecs通过kk在线安装三主三从高可用集群,部署成功:

无法进入页面,kubectl get pods -n kubesphere-system 发现异常:

通过kubectl describe pods ks-apiserver-9f878c6d5-wwrdh -n kubesphere-system查看:
Events:
Type Reason Age From Message
Warning BackOff 33m (x3911 over 14h) kubelet Back-off restarting failed container
Warning FailedMount 29m kubelet MountVolume.SetUp failed for volume “kubesphere-config” : failed to sync configmap cache: timed out waiting for the condition
Warning FailedMount 29m kubelet MountVolume.SetUp failed for volume “ks-router-config” : failed to sync configmap cache: timed out waiting for the condition
Normal Pulled 27m (x4 over 29m) kubelet Container image “registry.cn-beijing.aliyuncs.com/kubesphereio/ks-apiserver:v3.3.2” already present on machine
Normal Created 27m (x4 over 29m) kubelet Created container ks-apiserver
Normal Started 27m (x4 over 29m) kubelet Started container ks-apiserver
Warning BackOff 4m8s (x120 over 29m) kubelet Back-off restarting failed container
通过kubectl describe pods redis-76dd4856b6-nxz4r -n kubesphere-system查看:
Events:
Type Reason Age From Message
Warning FailedMount 60m (x63 over 14h) kubelet Unable to attach or mount volumes: unmounted volumes=[redis-pvc], unattached volumes=[kube-api-access-grf8q redis-pvc redis-config]: timed out waiting for the condition
Warning FailedMount 46m (x231 over 14h) kubelet Unable to attach or mount volumes: unmounted volumes=[redis-pvc], unattached volumes=[redis-pvc redis-config kube-api-access-grf8q]: timed out waiting for the condition
Warning FailedMount 31m (x421 over 14h) kubelet MountVolume.SetUp failed for volume “pvc-b8e589cb-c6ac-4c51-bf5f-c9cd706d1a41” : mount failed: exit status 32
Mounting command: mount
Mounting arguments: -t nfs 192.168.1.222:/data/nfs/kubesphere-system-redis-pvc-pvc-b8e589cb-c6ac-4c51-bf5f-c9cd706d1a41 /var/lib/kubelet/pods/c70fd160-3776-45db-831f-9598e6642da8/volumes/kubernetes.io~nfs/pvc-b8e589cb-c6ac-4c51-bf5f-c9cd706d1a41
Output: mount: wrong fs type, bad option, bad superblock on 192.168.1.222:/data/nfs/kubesphere-system-redis-pvc-pvc-b8e589cb-c6ac-4c51-bf5f-c9cd706d1a41,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so.
Warning FailedMount 13m (x2 over 26m) kubelet Unable to attach or mount volumes: unmounted volumes=[redis-pvc], unattached volumes=[redis-config kube-api-access-grf8q redis-pvc]: timed out waiting for the condition
Warning FailedMount 11m (x2 over 17m) kubelet Unable to attach or mount volumes: unmounted volumes=[redis-pvc], unattached volumes=[kube-api-access-grf8q redis-pvc redis-config]: timed out waiting for the condition
Warning FailedMount 8m44s (x6 over 29m) kubelet Unable to attach or mount volumes: unmounted volumes=[redis-pvc], unattached volumes=[redis-pvc redis-config kube-api-access-grf8q]: timed out waiting for the condition
Warning FailedMount 33s (x23 over 31m) kubelet MountVolume.SetUp failed for volume “pvc-b8e589cb-c6ac-4c51-bf5f-c9cd706d1a41” : mount failed: exit status 32
Mounting command: mount
Mounting arguments: -t nfs 192.168.1.222:/data/nfs/kubesphere-system-redis-pvc-pvc-b8e589cb-c6ac-4c51-bf5f-c9cd706d1a41 /var/lib/kubelet/pods/c70fd160-3776-45db-831f-9598e6642da8/volumes/kubernetes.io~nfs/pvc-b8e589cb-c6ac-4c51-bf5f-c9cd706d1a41
Output: mount: wrong fs type, bad option, bad superblock on 192.168.1.222:/data/nfs/kubesphere-system-redis-pvc-pvc-b8e589cb-c6ac-4c51-bf5f-c9cd706d1a41,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so.

====================================================
在三台node服务器上部署的nfs,node1作为服务端,node2,node3挂载
执行kubectl get sc:

执行kubectl get pv和kubectl get pvc -n kubesphere-system:


====================以上为问题描述=============
请路过的各位大佬协助,是什么原因导致上述失败。感谢,好人一生平安~
补充kk,nfs相关配置:

