每期一个小窍门(006): k8s创建顶级权限cluster role
Posted 李昊轩的博客
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了每期一个小窍门(006): k8s创建顶级权限cluster role相关的知识,希望对你有一定的参考价值。
需要创建两部分: ClusterRoleBinding, ServiceAccount
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: admin
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: admin
namespace: kube-system
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin
namespace: kube-system
labels:
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
查看token
kubectl get secret -n kube-system
kubectl describe secret XXX -n kube-system
以上是关于每期一个小窍门(006): k8s创建顶级权限cluster role的主要内容,如果未能解决你的问题,请参考以下文章