apache-spark - 在 Kubernetes 上运行 Spark 时,是否可以作为另一个用户以 root 身份运行?
问题描述
当我向 Kubernetes 提交 Spark 作业时,容器中的所有内容都以 root 身份运行。是否可以以其他用户身份运行作业?
当我在客户端模式下提交作业时,驱动程序以提交它的用户身份运行,但执行程序以 root 身份运行,这可能导致访问执行程序创建的文件时出现文件访问问题。
解决方案
Unless the full customization of the K8s Pod is supported by Spark on K8s (in particular runAsUser feature) the only ways to control it (as I see for the moment) are:
- Build docker image specifying USER in Dockerfile
- Use some advanced K8s tools/controllers, eg Argo Events
- Customize spark-submit
or submit Spark Pods directly as Kubernetes Pods through K8s APIs
Hope to see some improvements coming with Spark v3.0.0 soonish though.
推荐阅读
- .net-core - 如何使用 .net core 3.1 后端设置分布式系统
- android - Cordova 无法为 android 构建 APK
- android - 移动应用链接在不同渠道中的处理方式不同
- arrays - 二维数组出错
- php - 如何返回字符串匹配的所有对象?
- ios - 不变违规:模块 AppRegistry 不是从 0.60.5 升级到 0.63.3 的已注册可调用模块(调用 runApplication)
- javascript - 将数组中的值与第二个数组 javascript 中的内容匹配
- javascript - 通过 React Router Render 传递的道具在组件中未定义
- ios - iOS如何通过openssl生成DH公钥(X.509 DER)到java服务器
- angular - 使用属性样式安全地注入 html