使用基于角色的访问控制 (RBAC) 设置 Apache Livy 和 Spark 应用程序权限 - Amazon EMR
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

使用基于角色的访问控制 (RBAC) 设置 Apache Livy 和 Spark 应用程序权限

为了部署 Livy,EKS 上的 Amazon EMR 会创建一个服务器服务账户和角色以及 Spark 服务账户和角色。这些角色必须具有必要的 RBAC 权限才能完成设置和运行 Spark 应用程序。

服务器服务帐户和角色的 RBAC 权限

EKS 上的 Amazon EMR 创建 Livy 服务器服务账户和角色来管理 Spark 任务的 Livy 会话,以及路由进出入口和其他资源的流量。

此服务账户的默认名称为 emr-containers-sa-livy。它必须具有以下权限。

rules: - apiGroups: - "" resources: - "namespaces" verbs: - "get" - apiGroups: - "" resources: - "serviceaccounts" "services" "configmaps" "events" "pods" "pods/log" verbs: - "get" "list" "watch" "describe" "create" "edit" "delete" "deletecollection" "annotate" "patch" "label" - apiGroups: - "" resources: - "secrets" verbs: - "create" "patch" "delete" "watch" - apiGroups: - "" resources: - "persistentvolumeclaims" verbs: - "get" "list" "watch" "describe" "create" "edit" "delete" "annotate" "patch" "label"

Spark 服务账号和角色的 RBAC 权限

Spark 驱动程序 Pod 需要一个与该 Pod 位于同一命名空间的 Kubernetes 服务账户。此服务帐号需要权限才能管理执行程序 pod 以及驱动程序容器所需的任何资源。除非命名空间中的默认服务账号具有所需的权限,否则驱动程序将失败并退出。需要以下 RBAC 权限。

rules: - apiGroups: - "" "batch" "extensions" "apps" resources: - "configmaps" "serviceaccounts" "events" "pods" "pods/exec" "pods/log" "pods/portforward" "secrets" "services" "persistentvolumeclaims" "statefulsets" verbs: - "create" "delete" "get" "list" "patch" "update" "watch" "describe" "edit" "deletecollection" "patch" "label"