Skip to Content
Kubernetes即学即用(第二版)
book

Kubernetes即学即用(第二版)

by Brendan Burns, Joe Beda, Kelsey Hightower
June 2021
Intermediate to advanced
300 pages
5h 4m
Chinese
China Electric Power Press Ltd.
Content preview from Kubernetes即学即用(第二版)
基于角色的访问控制
201
管理
ClusterRole
资源的最佳实践是,创建许多细粒度的集群角色,然后将
它们聚合在一起形成更高级别或定义更广泛的集群角色。这就是定义内置集
群角色的方式。例如,你可以看到内置的
edit
角色的定义如下所示:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: edit
...
aggregationRule:
clusterRoleSelectors:
- matchLabels:
rbac.authorization.k8s.io/aggregate-to-edit: "true"
...
这表明
edit
角色的定义聚合了所有标签
rbac.authorization.k8s.io/
aggregate-to-edit
设置为
true
ClusterRole
对象。
14.3.2
使用组进行绑定
在管理大量隶属不同组织却拥有相似集群访问权限的人员时,通常最佳做法
是使用组来管理定义集群访问权限的角色,而不是单独执行角色到身份的绑
定。将一个组绑定到一个
ClusterRole
或命名空间
Role
时,该组中的成员都
将获得该角色定义的资源和动词。因此,如果想让某个人获得访问该组的角色,
则只需将这个人添加到该组中。
使用组是大规模管理访问权限的首选策略,主要原因有如下几个。首先,在
任何大型组织中,集群的访问权限都是根据某人所属的团队而定义的,而不
是某个特定的身份。例如,前端操作团队中的某个成员需要查看和编辑前端 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PyTorch深度学习

PyTorch深度学习

Posts & Telecom Press, Vishnu Subramanian
Python数据分析

Python数据分析

Posts & Telecom Press, Ivan Idris
Python贝叶斯分析(第2版)

Python贝叶斯分析(第2版)

Posts & Telecom Press, Osvaldo Martin
Python高级编程(第2版)

Python高级编程(第2版)

Posts & Telecom Press, Michał Jaworski, Tarek Ziadé

Publisher Resources

ISBN: 9787519856762