K8s 报错 Unsupported value: "rbac.authorization.k8s.io": supported values: ""
K8s 报错 Unsupported value: "rbac.authorization.k8s.io": supported values: ""
问题现象
# kubectl apply -f role-devops.yml Warning: rbac.authorization.k8s.io/v1beta1 RoleBinding is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 RoleBinding The RoleBinding "RoleBinding-devops" is invalid: subjects[0].apiGroup: Unsupported value: "rbac.authorization.k8s.io": supported values: ""
分析原因
根据报错应该是rbac.authorization.k8s.io字段不支持,支持“”,替换后解决
YAML文件
# cat role-devops.yml apiVersion: rbac.authorization.k8s.io/v1beta1 kind: RoleBinding metadata: name: RoleBinding-devopsnamespace: kube-system subjects: - kind: ServiceAccount name: devops namespace: kube-system apiGroup: "" roleRef: kind: Role name: role-devops apiGroup: rbac.authorization.k8s.io