kubernetes 身份与权限认证 (ServiceAccount && RBAC)
Kubernetes中提供了良好的多租户认证管理机制,如RBAC、ServiceAccount还有各种Policy等。 ServiceAccount Service Account为Pod中的进程提供身份信息。 当用户访问集群(例如使用 kubectl 命令)时, apiserver 会将用户认证为一个特定的 User Account ( 目前通常是 admin ,除非系统管理员自定义了集群配置)。Pod 容器中的进程也可以与 apiserver 联系。 当它们在联系 apiserver 的时候,它们会被认证为一个特定的 Service Account(例如 default )。 使用默认的 Service Account 访问 API server 当创建 pod 的时候, 如果没有指定一个 service account,系统会自动得在与该pod 相同的 namespace 下为其指派一个 default service account 。如果获取刚创建的 pod 的原始 json 或 yaml 信息( 例如使用 kubectl get pods podename -o yaml 命令),将看到 spec.serviceAccountName 字段已经被设置为 default 。 可以在 pod 中使用自动挂载的 service account 凭证来访问 API,如