简体   繁体   English

意外覆盖了默认的集群管理员角色

[英]Accidentally overwrote the default cluster-admin role

While trying to setup Helm for my cluster I declared the cluster-admin role which caused the overwriting of the default cluster-admin role.在尝试为我的集群设置 Helm 时,我声明了导致默认集群管理员角色覆盖的集群管理员角色。 Now I don't have it in my cluster anymore.现在我的集群中没有它了。 How can I fix this?我怎样才能解决这个问题?

You can create a new one with the following yaml:您可以使用以下 yaml 创建一个新的:

cluster-admin.yaml :集群管理员.yaml

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  annotations:
    rbac.authorization.kubernetes.io/autoupdate: "true"
  labels:
    kubernetes.io/bootstrapping: rbac-defaults
  name: cluster-admin
rules:
- apiGroups:
  - '*'
  resources:
  - '*'
  verbs:
  - '*'
- nonResourceURLs:
  - '*'
  verbs:
  - '*'

Create clusterRole:创建集群角色:

$ kubectl apply -f cluster-admin.yaml

NB:注意:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM