gpt4 book ai didi

kubernetes - Argo 工作流始终使用默认服务帐户

转载 作者:行者123 更新时间:2023-12-03 23:59:06 24 4
gpt4 key购买 nike

我安装了 Argo Workflow 的默认 Helm chart ,仅将 init.serviceAccount 配置为我创建的 argo-sa。 (具有足够授权的ServiceAccount)
但是,运行每个工作流都作为 serviceaccount Default 运行,我无法弄清楚设置的配置位置。
根据 Argo Helm Chart 提供的 README,将 init.serviceAccount 指定为我创建的 serviceaccount 应该可以解决问题。
解决方法是修改默认服务帐户,但似乎不是一个很好的解决方案。
有什么我理解错误的吗?提前致谢。

最佳答案

Argo 安装不控制使用哪个 ServiceAccount 工作流。根据 Argo docs

When no ServiceAccount is provided [when the Workflow is submitted], Argo will use the defaultServiceAccount from the namespace from which it is run, which willalmost always have insufficient privileges by default.


如果您使用的是 Argo CLI to submit Workflows ,则可以使用 --serviceaccount 指定 ServiceAccount。
如果您使用 kubectl apply 或其他一些工具来安装 Workflows,则可以 set the ServiceAccount name in the yaml definition 。请参阅 example from the documentation ,或此缩写示例:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
spec:
serviceAccountName: some-serviceaccount
为方便起见,Argo Helm 图表 provides a way to create a ServiceAccount 用于运行您的工作流。但它实际上并不会导致您的工作流使用该 ServiceAccount。您必须在提交工作流时指定它。
  serviceAccount:
create: false # Specifies whether a service account should be created
annotations: {}
name: "argo-workflow" # Service account which is used to run workflows
rbac:
create: false # adds Role and RoleBinding for the above specified service account to be able to run workflows

关于kubernetes - Argo 工作流始终使用默认服务帐户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64924481/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com