操作系统信息
物理机,Centos8 Stream,8C/32G
Client Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.2",
GitCommit:"7f6f68fdabc4df88cfea2dcf9a19b2b830f1e647", GitTreeState:"clean",
BuildDate:"2023-05-17T14:20:07Z", GoVersion:"go1.20.4", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v5.0.1
Server Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.2",
GitCommit:"7f6f68fdabc4df88cfea2dcf9a19b2b830f1e647", GitTreeState:"clean",
BuildDate:"2023-05-17T14:13:28Z", GoVersion:"go1.20.4", Compiler:"gc", Platform:"linux/amd64"}
容器运行时
Client: Docker Engine - Community
Version: 24.0.2
API version: 1.43
Go version: go1.20.4
Git commit: cb74dfc
Built: Thu May 25 21:53:10 2023
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 24.0.2
API version: 1.43 (minimum version 1.12)
Go version: go1.20.4
Git commit: 659604f
Built: Thu May 25 21:52:10 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.21
GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8
runc:
Version: 1.1.7
GitCommit: v1.1.7-0-g860f061
docker-init:
Version: 0.19.0
GitCommit: de40ad0
KubeSphere版本信息
在线yaml安装,v3.4.1
问题是什么
版本导致的资源冲突,之前安装其他操作平台。使用官方的 kubesphere-delete.sh 脚本进行删除操作也没有删除到旧版本的CRD,导致一直安装失败。
某个资源安装报错导致安装流程走不下去,具体报错如下:
fatal: [localhost]: FAILED! => {"attempts": 5, "changed": true, "cmd": "/usr/local/bin/kubectl patch cc ks-installer --type merge -p '{\"status\": {\"redis\": {\"status\": \"enabled\", \"enabledTime\": \"2023-12-18T14:08:58CST\"}}}' -n kubesphere-system\n", "delta": "0:00:00.024230", "end": "2023-12-18 14:09:14.316185", "failed_when_result": true, "msg": "non-zero return code", "rc": 1, "start": "2023-12-18 14:09:14.291955", "stderr": "Error from server (Forbidden): configconstraints.apps.kubeblocks.io \"ks-installer\" is forbidden: User \"system:serviceaccount:kubesphere-system:ks-installer\" cannot get resource \"configconstraints\" in API group \"apps.kubeblocks.io\" at the cluster scope", "stderr_lines": ["Error from server (Forbidden): configconstraints.apps.kubeblocks.io \"ks-installer\" is forbidden: User \"system:serviceaccount:kubesphere-system:ks-installer\" cannot get resource \"configconstraints\" in API group \"apps.kubeblocks.io\" at the cluster scope"], "stdout": "", "stdout_lines": []}
把相关的CRD删除之后,安装成功了。提供参考的删除命令
kubectl delete crd backuppolicytemplates.apps.kubeblocks.io
kubectl delete crd clusterdefinitions.apps.kubeblocks.io
kubectl delete crd clusters.apps.kubeblocks.io
kubectl delete crd clusterversions.apps.kubeblocks.io
kubectl delete crd componentclassdefinitions.apps.kubeblocks.io
kubectl delete crd componentresourceconstraints.apps.kubeblocks.io
kubectl delete crd configconstraints.apps.kubeblocks.io
kubectl delete crd opsrequests.apps.kubeblocks.io
具体是什么资源冲突,要看具体报错