kubernetes 找不到名称的资源Map:“cattle-admin-binding”命名空间:“牛制”

cgvd09ve  于 2022-12-22  发布在  Kubernetes
关注(0)|答案(1)|浏览(578)

while I try to add my k8s cluster in azure vm, is shows error like error: resource mapping not found for name: "cattle-admin-binding" namespace: "cattle-system" from "STDIN": no matches for kind "ClusterRoleBinding" in version "rbac.authorization.k8s.io/v1beta1" ensure CRDs are installed first
下面是所执行命令的输出

root@kubeadm-master:~# curl --insecure -sfL https://104.211.32.151:8443/v3/import/lqkbhj6gwg9xcb5j8pnqcmxhtdg6928wmb7fj2n9zv95dbxsjq8vn9.yaml | kubectl apply -f -clusterrole.rbac.authorization.k8s.io/proxy-clusterrole-kubeapiserver 
created
clusterrolebinding.rbac.authorization.k8s.io/proxy-role-binding-kubernetes-master created
namespace/cattle-system created
serviceaccount/cattle created
secret/cattle-credentials-e558be7 created
clusterrole.rbac.authorization.k8s.io/cattle-admin created

Warning: spec.template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key: beta.kubernetes.io/os is deprecated since v1.14; use "kubernetes.io/os" instead

deployment.apps/cattle-cluster-agent created
daemonset.apps/cattle-node-agent created

error: resource mapping not found for name: "cattle-admin-binding" namespace: "cattle-system" from "STDIN": no matches for kind "ClusterRoleBinding" in version "rbac.authorization.k8s.io/v1beta1"

确保首先安装CRD

pkbketx9

pkbketx91#

我也面临着同样的问题,所以我将cattle-admin-binding的API版本从beta版改为stable版,如下所示:
旧值:

apiVersion: rbac.authorization.k8s.io/v1beta1

变更为:

apiVersion: rbac.authorization.k8s.io/v1

虽然我后来遇到了一些其他的问题,上面的错误已经消失了。

相关问题