系统环境 | kubernetes版本 | kubesphere版本 |
---|---|---|
ubuntu18.04 | v1.18.5 | v3.0.0 |
我是先通过kubeadm工具安装的一个master两个node,然后kubesphere的官方文档在此基础上直接安装的kubesphere。在安装好后,访问web界面的时候,出现如下报错:
查看日志:
root@k8smaster1:~# kubectl get all -n openpitrix-system
NAME READY STATUS RESTARTS AGE
pod/hyperpitrix-generate-kubeconfig-hsjzt 0/2 Completed 0 21m
pod/hyperpitrix-release-app-job-9nhm8 0/1 Completed 0 21m
pod/openpitrix-hyperpitrix-deployment-5b585565cb-4nldt 1/1 Running 0 21m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/hyperpitrix ClusterIP None <none> 9123/TCP,9121/TCP,9100/TCP,9102/TCP,9113/TCP,9122/TCP,9104/TCP,9118/TCP,9106/TCP,9101/TCP,9108/TCP,9103/TCP,9107/TCP 21m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/openpitrix-hyperpitrix-deployment 1/1 1 1 21m
NAME DESIRED CURRENT READY AGE
replicaset.apps/openpitrix-hyperpitrix-deployment-5b585565cb 1 1 1 21m
NAME COMPLETIONS DURATION AGE
job.batch/hyperpitrix-generate-kubeconfig 1/1 2m14s 21m
job.batch/hyperpitrix-release-app-job 1/1 2m58s 21m
查看对应pod的日志
root@k8smaster1:~# kubectl logs openpitrix-hyperpitrix-deployment-5b585565cb-4nldt -n openpitrix-system
2021-02-07 11:04:58.94253 -DEBUG- Response is error: Internal, describe resources failed: Error 1049: Unknown database 'app' (grpc_server.go:191)
2021-02-07 11:04:58.98698 -INFO- Request received [DescribeApps] [&{UserId:system OwnerPath::system AccessPath:}] [{"sort_key":"create_time","reverse":false,"limit":10}] (grpc_server.go:180)
2021-02-07 11:04:58.98706 -INFO- Request received [DescribeAppVersionReviews] [&{UserId:system OwnerPath::system AccessPath:}] [{"sort_key":"status_time","reverse":true,"limit":10,"status":["submitted"]}] (grpc_server.go:180)
2021-02-07 11:04:58.99628 -ERROR- Error 1049: Unknown database 'app' (event.go:36)
2021-02-07 11:04:58.99634 -ERROR- dbr.select.load.query: map[sql:SELECT DISTINCT app_version_review.review_id, app_version_review.version_id, app_version_review.app_id, app_version_review.owner_path, app_version_review.owner, app_version_review.status, app_version_review.phase, app_version_review.status_time, app_version_review.reviewer, app.name AS app_name, app_version.name AS app_version_name, app_version.type AS app_version_type FROM app_version_review LEFT JOIN `app_version` ON app_version.version_id = app_version_review.version_id LEFT JOIN `app` ON app.app_id = app_version_review.app_id WHERE ((`app_version_review`.`owner_path` LIKE '%') OR (`app_version_review`.`owner` = 'system')) AND ((`app_version_review`.`status` IN ('submitted'))) ORDER BY app_version_review.status_time DESC LIMIT 10 OFFSET 0] (event.go:37)
2021-02-07 11:04:58.99635 -DEBUG- dbr.select spend 9.19ms: map[sql:SELECT DISTINCT app_version_review.review_id, app_version_review.version_id, app_version_review.app_id, app_version_review.owner_path, app_version_review.owner, app_version_review.status, app_version_review.phase, app_version_review.status_time, app_version_review.reviewer, app.name AS app_name, app_version.name AS app_version_name, app_version.type AS app_version_type FROM app_version_review LEFT JOIN `app_version` ON app_version.version_id = app_version_review.version_id LEFT JOIN `app` ON app.app_id = app_version_review.app_id WHERE ((`app_version_review`.`owner_path` LIKE '%') OR (`app_version_review`.`owner` = 'system')) AND ((`app_version_review`.`status` IN ('submitted'))) ORDER BY app_version_review.status_time DESC LIMIT 10 OFFSET 0] (event.go:48)
2021-02-07 11:04:58.99638 -ERROR- Error 1049: Unknown database 'app' (event.go:36)
2021-02-07 11:04:58.99642 -ERROR- dbr.select.load.query: map[sql:SELECT app_id, active, name, repo_id, description, status, home, icon, screenshots, maintainers, keywords, sources, readme, owner, owner_path, chart_name, tos, abstraction, isv, create_time, status_time, update_time FROM app WHERE (`active` = 0) AND ((`owner_path` LIKE '%') OR (`owner` = 'system')) ORDER BY create_time ASC LIMIT 10 OFFSET 0] (event.go:37)
2021-02-07 11:04:58.99643 -DEBUG- dbr.select spend 9.37ms: map[sql:SELECT app_id, active, name, repo_id, description, status, home, icon, screenshots, maintainers, keywords, sources, readme, owner, owner_path, chart_name, tos, abstraction, isv, create_time, status_time, update_time FROM app WHERE (`active` = 0) AND ((`owner_path` LIKE '%') OR (`owner` = 'system')) ORDER BY create_time ASC LIMIT 10 OFFSET 0] (event.go:48)
2021-02-07 11:04:58.99638 -ERROR- err: Error 1049: Unknown database 'app', errMsg: describe resources failed: Error 1049: Unknown database 'app' (handler.go:590)
2021-02-07 11:04:58.99651 -INFO- Handled request [DescribeAppVersionReviews] [&{UserId:system OwnerPath::system AccessPath:}] exec_time is [9.424898ms] (grpc_server.go:188)
2021-02-07 11:04:58.99653 -DEBUG- Response is error: Internal, describe resources failed: Error 1049: Unknown database 'app' (grpc_server.go:191)
2021-02-07 11:04:58.99648 -ERROR- err: Error 1049: Unknown database 'app', errMsg: describe resources failed: Error 1049: Unknown database 'app' (handler.go:132)
2021-02-07 11:04:58.99657 -INFO- Handled request [DescribeApps] [&{UserId:system OwnerPath::system AccessPath:}] exec_time is [9.559564ms] (grpc_server.go:188)
2021-02-07 11:04:58.99658 -DEBUG- Response is error: Internal, describe resources failed: Error 1049: Unknown database 'app' (grpc_server.go:191)
2021-02-07 11:04:59.0508 -INFO- Request received [DescribeApps] [&{UserId:system OwnerPath::system AccessPath:}] [{"sort_key":"create_time","reverse":false,"limit":10}] (grpc_server.go:180)
2021-02-07 11:04:59.05669 -ERROR- Error 1049: Unknown database 'app' (event.go:36)
虽然pod你查看启动都是正常,但是日志里面有错误,Unknow database ‘app’
解决方案:删除命名空间openpitrix-system下的所有资源,以及删除该命名空间。重新执行:
kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/kubesphere-installer.yaml
kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/cluster-configuration.yaml
检查安装日志:
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f
当出现如下图,可以访问该url:
如果该篇文章对您有一点点帮助,请点个赞👍吧!