kubernetes-guide/codeblock/rbac/test-admin-istio-system-rea...

51 lines
901 B
YAML
Raw Normal View History

2024-04-10 12:01:49 +08:00
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: admin
namespace: test
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["*"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: admin-to-roc
namespace: test
subjects:
- kind: User
name: roc
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: admin
apiGroup: rbac.authorization.k8s.io
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: readonly
namespace: istio-system
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["get", "watch", "list"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: readonly-to-roc
namespace: istio-system
subjects:
- kind: User
name: roc
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: readonly
apiGroup: rbac.authorization.k8s.io