操作系统信息
虚拟机,Centos76,4C/16G
Kubernetes版本信息
v1.21.11。多master+nginx负载均衡。
容器运行时
Docker version 20.10.13
KubeSphere版本信息
v3.2.1。在线最小化安装。已有K8s。
问题是什么
安装ks失败,ks-apiserver & redis-ha-server-0 报错:
[root@ks-master1 kubesphere]# kubectl -n kubesphere-system get pods
NAME READY STATUS RESTARTS AGE
ks-apiserver-567b8d878b-57q45 0/1 CrashLoopBackOff 45 3h38m
ks-apiserver-567b8d878b-rsvqh 0/1 CrashLoopBackOff 49 4h1m
ks-apiserver-7f7d9c6f84-vrdzv 0/1 CrashLoopBackOff 53 4h18m
ks-console-65f4d44d88-6d9mh 1/1 Running 0 4h36m
ks-console-65f4d44d88-kbtwq 1/1 Running 0 4h36m
ks-console-65f4d44d88-nld65 1/1 Running 0 4h36m
ks-controller-manager-5c8c497474-8t9g8 1/1 Running 0 4h30m
ks-controller-manager-5c8c497474-flkx9 1/1 Running 0 4h32m
ks-controller-manager-5c8c497474-kq7mc 1/1 Running 0 4h30m
ks-installer-85dcfff87d-5k2zk 1/1 Running 0 4h46m
redis-ha-haproxy-5789f59c68-b7pzz 1/1 Running 0 3h38m
redis-ha-haproxy-5789f59c68-hfd96 1/1 Running 0 3h38m
redis-ha-haproxy-5789f59c68-rxgw5 1/1 Running 0 3h38m
redis-ha-server-0 0/2 Init:0/1 0 4h38m
查看ks-apiserver日志,错误是关联到redis service
[root@ks-master1 kubesphere]# kubectl -n kubesphere-system logs -f ks-apiserver-567b8d878b-57q45
W0324 21:42:00.371448 1 client_config.go:615] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
W0324 21:42:00.400842 1 client_config.go:615] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
W0324 21:42:00.432582 1 metricsserver.go:238] Metrics API not available.
Error: failed to connect to redis service, please check redis status, error: EOF
2022/03/24 21:42:00 failed to connect to redis service, please check redis status, error: EOF
再看redis-ha-server-0日志,提示挂载glusterFS存储卷失败
[root@ks-master1 kubesphere]# kubectl -n kubesphere-system describe pod redis-ha-server-0
....
....
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedMount 12m (x55 over 4h55m) kubelet Unable to attach or mount volumes: unmounted volumes=[data], unattached volumes=[config data kube-api-access-kw798]: timed out waiting for the condition
Warning FailedMount 2m40s (x194 over 4h55m) kubelet (combined from similar events): MountVolume.SetUp failed for volume "pvc-ff420b50-3d32-45cd-a72b-10a57d597a7b" : mount failed: mount failed: exit status 32
Mounting command: systemd-run
Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/pods/1274e3a1-46a4-485f-8d3e-0810af4eabcf/volumes/kubernetes.io~glusterfs/pvc-ff420b50-3d32-45cd-a72b-10a57d597a7b --scope -- mount -t glusterfs -o auto_unmount,backup-volfile-servers=192.168.142.138:192.168.142.139:192.168.142.96,log-file=/var/lib/kubelet/plugins/kubernetes.io/glusterfs/pvc-ff420b50-3d32-45cd-a72b-10a57d597a7b/redis-ha-server-0-glusterfs.log,log-level=ERROR 192.168.142.139:vol_eb29f07f2e7e47f132ad3ff3e00beb39 /var/lib/kubelet/pods/1274e3a1-46a4-485f-8d3e-0810af4eabcf/volumes/kubernetes.io~glusterfs/pvc-ff420b50-3d32-45cd-a72b-10a57d597a7b
Output: Running scope as unit run-30326.scope.
mount: unknown filesystem type 'glusterfs'
, the following error information was pulled from the glusterfs log to help diagnose this issue: could not open log file for pod redis-ha-server-0
pv有创建,pvc未创建
[root@ks-master1 kubesphere]# kubectl get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pvc-c0caaaca-e900-4798-8399-f5341b6be705 20Gi RWO Delete Bound kubesphere-monitoring-system/prometheus-k8s-db-prometheus-k8s-0 glusterfs 5h8m
pvc-ff420b50-3d32-45cd-a72b-10a57d597a7b 2Gi RWO Delete Bound kubesphere-system/data-redis-ha-server-0 glusterfs 5h13m
[root@ks-master1 kubesphere]#
[root@ks-master1 kubesphere]#
[root@ks-master1 kubesphere]#
[root@ks-master1 kubesphere]# kubectl get pvc
No resources found in default namespace.
k8s已经配置了外置的glusterFS SC,并可正常使用
[root@ks-master1 kubesphere]# kubectl get sc
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
glusterfs (default) kubernetes.io/glusterfs Delete Immediate true 6h46m
查了下kubesphere安装需求
当使用 --cluster-signing-cert-file
和 --cluster-signing-key-file
参数启动时,在 kube-apiserver
中会激活 CSR 签名功能。请参见 RKE 安装问题
不知道是否跟这个有关?
请大神们帮忙指点,小弟感激不尽!!!