小编Nit*_*lli的帖子

Airflow 中的 KubernetesPodOperator 特权 security_context

我在 Google 的 Cloud Composer 上运行 Airflow。我现在用的是KubernetesPodOperator并想通过一个谷歌存储桶安装到目录荚gcsfuse。似乎要做到这一点,我需要提供此处指定的 k8s 特权安全上下文。似乎气流最近向 KubernetesPodOperator 添加了 security_context 参数。我在操作符中指定的安全上下文是:

security_context = {
  'securityContext': {
    'privileged': True,
    'capabilities':
      {'add': ['SYS_ADMIN']}
  }
}
Run Code Online (Sandbox Code Playgroud)

当我尝试airflow test dag_id task_id date在气流工作器中运行时,pod 启动,当代码尝试通过 gcsfuse 挂载存储桶时,它会引发错误"fusermount: fuse device not found, try 'modprobe fuse' first"。这使得它看起来好像 security_context 不起作用(例如)。

我是否误解了运算符中的 security_context 参数和/或我的 securityContext 字典定义是否无效?

kubernetes google-kubernetes-engine airflow google-cloud-composer

5
推荐指数
1
解决办法
866
查看次数