kubernetes RABC

1.RBAC


https://kubernetes.io/zh-cn/docs/reference/access-authn-authz/rbac/

[root@master-etcd1-234-31 namespaces]# cat test.role.yaml
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  namespace: test
  name: test-role
rules:
- apiGroups: ["*"] #对所有的api
  resources: ["pods","pods/exec"] #下面的pod的操作
  verbs: ["*"] #所有操作
  ##RO-Role  #注释只读的配置 以区分不同 下同
  #verbs: ["get", "watch", "list"]
- apiGroups: ["extensions", "apps/v1"]
  resources: ["deployments"]
  verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
  ##RO-Role
  #verbs: ["get", "watch", "list"]