Kubernetes RBAC受權普通用戶對命名空間訪問權限

Kubernetes RBAC受權普通用戶對命名空間訪問權限

官方文檔:http://www.javashuo.com/article/p-kddzetdp-ch.htmlhtml

 

kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  namespace: default
  name: pod-reader
rules:
- apiGroups: [""]
  resources: ["pods"]
  verbs: ["get", "watch", "list"]

 

kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: read-pods
  namespace: default
subjects:
- kind: User
  name: jane
  apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: Role
  name: pod-reader
  apiGroup: rbac.authorization.k8s.io
相關文章
相關標籤/搜索