[英]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:注意:
rbac.authorization.kubernetes.io/autoupdate: "true"
is given for Auto-reconciliation . rbac.authorization.kubernetes.io/autoupdate: "true"
用于Auto-reconciliation 。
kubernetes.io/bootstrapping: rbac-defaults
is added by the API server. kubernetes.io/bootstrapping: rbac-defaults
由 API 服务器添加。 This label is used to represent Default roles and role bindings .此 label 用于表示默认角色和角色绑定。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.