RBAC và ServiceAccount trong Kubernetes hoạt động thế nào?

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.

Xem toàn bộ Docker & Kubernetes cùng filter theo level & chủ đề con.

Mở danh sách Docker & Kubernetes