k8s rbac 记录
程序员文章站
2024-03-13 19:46:03
...
参考:https://www.huaweicloud.com/articles/5bf22633f80c0ad49479f3c9935b2534.html
以下是一段比较通配的rbac代码:
# (2)serviceAccount
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app:
name:
namespace:
---
# (3)ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name:
rules:
- apiGroups:
- ""
resources:
- configmaps
- endpoints
- persistentvolumeclaims
- replicationcontrollers
- replicationcontrollers/scale
- secrets
- serviceaccounts
- services
- services/proxy
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- extensions
resources:
- daemonsets
- deployments
- deployments/rollback
- deployments/scale
- ingresses
- networkpolicies
- replicasets
- replicasets/scale
- replicationcontrollers/scale
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
---
# (4)ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
k8s-app:
name:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name:
subjects:
- kind: ServiceAccount
name:
namespace:
上一篇: 使用sys用户imp导入数据遇到字符集转换后列长度不够报错
下一篇: mysql 阻塞监控脚本