K8s集群部署完毕后,安装kuboard(版本号:v3.5.2.7),查看kuboard状态为running。

[root@master ~]# kubectl get pods -A|grep kuboard
kuboard kuboard-v3-master 1/1 Running 0 28m

但是访问kuboard报错:

{
"message":“Failed to retrieve connector list.",
"type":"Internal Server Error"
}

查看kuboar容器日志:

kubectl logs kuboard-v3-master -n kuboard

[GIN] 2024/08/31 - 10:58:59 | 200 |     128.155µs |      10.244.0.1 | GET      "/kuboard-resources/version.json"
[GIN] 2024/08/31 - 10:58:59 | 200 | 158.753µs | 10.244.0.1 | GET "/kuboard-resources/version.json"
{"level":"warn","ts":"2024-08-31T10:59:01.150+0800","caller":"clientv3/retry_interceptor.go:61","msg":"retrying of unary invoker failed","target":"endpoint://client-f0736a56-3d98-4909-a65d-ab8223f8d18a/127.0.0.1:2379","attempt":0,"error":"rpc error: code = Unavailable desc = etcdserver: request timed out"}
time="2024-08-31T02:59:01Z" level=error msg="Storage health check failed: delete auth request: etcdserver: request timed out"
{"level":"warn","ts":"2024-08-31T10:59:06.203+0800","caller":"wal/wal.go:806","msg":"slow fdatasync","took":"10.054787821s","expected-duration":"1s"}
[GIN] 2024/08/31 - 10:59:09 | 200 | 126.781µs | 10.244.0.1 | GET "/kuboard-resources/version.json"
[GIN] 2024/08/31 - 10:59:09 | 200 | 208.837µs | 10.244.0.1 | GET "/kuboard-resources/version.json"
[GIN] 2024/08/31 - 10:59:18 | 303 | 8.606739ms | 10.100.62.174 | GET "/"
[GIN] 2024/08/31 - 10:59:18 | 303 | 993.333µs | 10.100.62.174 | GET "/login?state=%2F"
[GIN] 2024/08/31 - 10:59:19 | 200 | 214.749µs | 10.244.0.1 | GET "/kuboard-resources/version.json"
[GIN] 2024/08/31 - 10:59:19 | 200 | 774.826µs | 10.244.0.1 | GET "/kuboard-resources/version.json"
{"level":"warn","ts":"2024-08-31T10:59:21.151+0800","caller":"clientv3/retry_interceptor.go:61","msg":"retrying of unary invoker failed","target":"endpoint://client-f0736a56-3d98-4909-a65d-ab8223f8d18a/127.0.0.1:2379","attempt":0,"error":"rpc error: code = Unavailable desc = etcdserver: request timed out"}
time="2024-08-31T02:59:21Z" level=error msg="Storage health check failed: create auth request: etcdserver: request timed out"
{"level":"warn","ts":"2024-08-31T10:59:23.563+0800","caller":"etcdserver/util.go:163","msg":"apply request took too long","took":"5.000096055s","expected-duration":"100ms","prefix":"read-only range ","request":"key:\"kuboard-sso-namespace/connector/\" range_end:\"kuboard-sso-namespace/connector0\" ","response":"","error":"context deadline exceeded"}
{"level":"info","ts":"2024-08-31T10:59:23.563+0800","caller":"traceutil/trace.go:145","msg":"trace[1745762788] range","detail":"{range_begin:kuboard-sso-namespace/connector/; range_end:kuboard-sso-namespace/connector0; }","duration":"5.000255889s","start":"2024-08-31T10:59:18.563+0800","end":"2024-08-31T10:59:23.563+0800","steps":["trace[1745762788] 'agreement among raft nodes before linearized reading' (duration: 5.00003686s)"]}
{"level":"warn","ts":"2024-08-31T10:59:23.564+0800","caller":"clientv3/retry_interceptor.go:61","msg":"retrying of unary invoker failed","target":"endpoint://client-f0736a56-3d98-4909-a65d-ab8223f8d18a/127.0.0.1:2379","attempt":0,"error":"rpc error: code = Unknown desc = context deadline exceeded"}
time="2024-08-31T02:59:23Z" level=error msg="Failed to parse authorization request: Unable to retrieve connectors"
[GIN] 2024/08/31 - 10:59:23 | 400 | 5.005672321s | 10.100.62.174 | GET "/sso/auth?access_type=offline&client_id=kuboard-sso&redirect_uri=%2Fcallback&response_type=code&scope=openid+profile+email+groups&state=%2F&connector_id=default"
{"level":"warn","ts":"2024-08-31T10:59:25.563+0800","caller":"etcdserver/v3_server.go:746","msg":"timed out waiting for read index response (local node might have slow network)","timeout":"7s"}

检查etcd没问题。实在没找到问题原因,遂准备将kuboard替换成以前安装过的老版本v3.5.1.0.

首先修改kuboard.yaml里的镜像版本号:

vi /etc/kubernetes/manifests/kuboard.yaml

然后删除kuboard容器:

kubectl delete pod kuboard-v3-master -n kuboard

片刻后kuboard启动成功:

[root@master ~]# kubectl get pods -A|grep kuboard
kuboard kuboard-v3-master 1/1 Running 0 28m

访问kuboard界面,居然就成功了。虽然没找到问题根本原因,也在此分享下解决办法。