【问题标题】:Nextflow doesn't use the right service account to deploy workflows to kubernetesNextflow 未使用正确的服务帐户将工作流部署到 ​​Kubernetes
【发布时间】:2021-01-12 07:17:00
【问题描述】:

我们正在尝试在默认的 k8s 命名空间上使用 nextflow,我们使用的命名空间是 nextflownamespace。我们已经创建了 PVC 并确保默认服务帐户具有管理员角色绑定。我们收到 nextflow 无法访问 PVC 的错误:

"message": "persistentvolumeclaims \"my-nextflow-pvc\" is forbidden: 
User \"system:serviceaccount:mynamespace:default\" cannot get resource 
\"persistentvolumeclaims\" in API group \"\" in the namespace \"nextflownamespace\"",

在该错误中,我们看到 system:serviceaccount:mynamespace:default 错误地指向我们的默认命名空间 mynamespace,而不是我们为 nextflow 使用而创建的 nextflownamespace

我们尝试将debug.yaml = true 添加到nextflow.config,但找不到它提交给k8s 以验证错误的YAML。我们的配置文件如下所示:

profiles {
  standard { 
    k8s {
          executor = "k8s"
          namespace = "nextflownamespace"
          cpus = 1
          memory = 1.GB
          debug.yaml = true
        }
    aws{ 
          endpoint = "https://s3.nautilus.optiputer.net"
       }
  }

我们确实验证了当我们将命名空间更改为另一个任意值时,错误消息使用了新的任意命名空间,但服务帐户名称继续错误地指向用户的默认命名空间。

我们已经尝试了profiles.standard.k8s.serviceAccount = "system:serviceaccount:nextflownamespace:default" 的所有我们能想到的变体,但这些尝试没有得到任何改变。

【问题讨论】:

  • 我想知道使用嵌套配置文件是否会发生一些愚蠢的事情? IE。当您从config profile 中删除“标准”层然后设置profiles.k8s.serviceAccount = "system:serviceaccount:nextflownamespace:default" 时会发生什么?
  • @Steve 好像做到了!我们将其移至另一个错误。我们刚刚从配置文件中删除了标准,并从命令行中删除了--profile。如果您可以将其复制到答案中,我会接受。谢谢!
  • 太棒了 - 我对 Kubernetes 的经验为零,所以很高兴我能在这方面提供帮助!我希望下面的答案是好的。您是否还需要为“serviceAccount”设置添加一个值?不过,我仍然希望在命令行上出现-profile k8s(请注意单破折号和双破折号/连字符)。

标签: kubernetes nextflow


【解决方案1】:

我认为最好避免在 Nextflow 中使用嵌套的 config profiles。我要么从您的个人资料中删除“标准”层,要么将“标准”设为单独的个人资料:

profiles {

    standard {
      process.executor = 'local'
    }

    k8s {
        executor = "k8s"
        namespace = "nextflownamespace"
        cpus = 1
        memory = 1.GB
        debug.yaml = true
    }

    aws{ 
        endpoint = "https://s3.nautilus.optiputer.net"
    }
}

【讨论】:

    猜你喜欢
    • 2019-10-20
    • 2021-06-15
    • 1970-01-01
    • 2021-05-02
    • 2021-10-14
    • 2020-05-20
    • 2023-04-02
    • 2018-11-20
    • 2016-01-04
    相关资源
    最近更新 更多