Skip to content

Commit 885736d

Browse files
author
wangyazhou
committed
修改授权
1 parent af3d6b2 commit 885736d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

k8s/kube_prometheus.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,13 @@
88

99

1010

11+
12+
13+
14+
15+
16+
17+
18+
19+
20+

k8s/kubernetes_security.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ system:serviceaccount:<namespace>:default
7878

7979
如果希望kube-system命名空间下的Service Account "default" 具有所有权限,就需要再策略文件中加入如下内容
8080

81-
```bash
81+
```yaml
8282
apiVersion: abac.authorization.kubernetes.io/v1beta1
8383
kind: Policy
8484
spec:
@@ -93,6 +93,8 @@ spec:
9393
9494
要使用RBAC授权模式, 首先需要在kube-apiserver服务的启动参数authorization-mode( 授权模式) 的列表中加上RBAC, 例如--authorization-mode=..., RBAC。
9595
96+
ServiceAccount, ClusterRole, ClusterRoleBinding之间的关系就是ClusterRole用来确定权限,ClusterRoleBinding用来绑定 ServiceAccount和ClusterRole,而一个pod像要有权限需要创建ServiceAccount账户,然后凭借绑定关系获取权限 ,可以参考 [部署prometheus实例](https://prometheus-operator.dev/docs/platform/platform-guide/)
97+
9698
- RBAC的API资源对象说明
9799
98100
在RBAC管理体系中, Kubernetes引入了4个资源对象: Role、ClusterRole、 RoleBinding和ClusterRoleBinding。

0 commit comments

Comments
 (0)