ServiceAccount là identity cho Pod khi gọi Kubernetes API. RBAC dùng Role/ClusterRole và RoleBinding/ClusterRoleBinding để cấp quyền theo verbs, resources và namespace scope.
Ví dụ Role tối thiểu:
yaml
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: pod-reader
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch"]Production nên áp dụng least privilege.
Không dùng default ServiceAccount với quyền rộng cho mọi workload.