helm install报错Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest:

An error is reported when executing helm install ui aliyun/weave-scope 

The error is as follows:

[root@k8smaster ~]# helm install ui aliyun/weave-scope 
Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: [resource mapping not found for name: "weave-scope-agent-ui" namespace: "" from "": no matches for kind "ClusterRole" in version "rbac.authorization.k8s.io/v1beta1"
ensure CRDs are installed first, resource mapping not found for name: "ui-weave-scope" namespace: "" from "": no matches for kind "ClusterRoleBinding" in version "rbac.authorization.k8s.io/v1beta1"
ensure CRDs are installed first, resource mapping not found for name: "weave-scope-agent-ui" namespace: "" from "": no matches for kind "DaemonSet" in version "extensions/v1beta1"
ensure CRDs are installed first, resource mapping not found for name: "weave-scope-frontend-ui" namespace: "" from "": no matches for kind "Deployment" in version "apps/v1beta1"
ensure CRDs are installed first]

Reason: RBAC permission processing in K8s was introduced in Kubernetes version 1.5, upgraded to Beta version in version 1.6, and upgraded to GA in version 1.8... The version of weave is low, the version of k8s is high, and the version of k8s corresponds to the installed yaml file The version of the apiVersion is wrong, the version is not compatible, just modify it according to the error reported.

solve:

If it cannot be installed directly, download the package to the current directory first.

[root@k8smaster ~]# helm pull aliyun/weave-scope 
[root@k8smaster ~]# ls | grep weave
weave-scope-0.9.2.tgz

Unzip this package [If it prompts that xxx is an untrustworthy old timestamp, it doesn’t matter, don’t worry about it]

[root@k8smaster ~]# tar zxvf weave-scope-0.9.2.tgz 

Enter the decompressed folder and execute according to the error content

[root@k8smaster ~]# cd weave-scope
[root@k8smaster weave-scope]# grep -r v1beta1
charts/weave-scope-agent/templates/clusterrole.yaml:apiVersion: rbac.authorization.k8s.io/v1beta1
charts/weave-scope-agent/templates/clusterrolebinding.yaml:apiVersion: rbac.authorization.k8s.io/v1beta1
charts/weave-scope-agent/templates/daemonset.yaml:apiVersion: extensions/v1beta1
charts/weave-scope-frontend/templates/deployment.yaml:apiVersion: apps/v1beta1

Replace all ...v1beta1 in the corresponding yaml with ...v1

It should be noted that extensions/v1beta1 in the daemonset.yaml file must be changed to apps/v1

 [Other file modification, normal modification to ... v1 is enough, not to show too much here]

After the modification is complete, go back to the directory where the weave-scope folder is located, and then install it.

[root@k8smaster weave-scope]# cd ..
[root@k8smaster ~]# ls | grep weave-scope
weave-scope
[root@k8smaster ~]# helm install  ui  weave-scope
NAME: ui
LAST DEPLOYED: Wed Jul 26 09:16:49 2023
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:

Successful installation

Guess you like

Origin blog.csdn.net/qq_41954181/article/details/132018615