简体   繁体   English

Argo Workflow 如何使用 Kubernetes 执行控制流?

[英]How does an Argo Workflow carry out control flow with Kubernetes?

If desperate, one can consider Argo Workflows as a programming language implemented in YAML and using Kubernetes as a back-end.如果绝望,可以将 Argo Workflows 视为一种在 YAML 中实现并使用 Kubernetes 作为后端的编程语言。

  • A procedure can be defined using steps:可以使用steps:
  • Functions are Templates with arguments coming in two flavours:函数是带有 arguments 的模板,有两种风格:
    • Parameters, which are strings参数,它们是字符串
    • Artifacts, which are files shared by some tool, such as S3 or NFS Artifacts,由某些工具共享的文件,例如 S3 或 NFS
  • There is flow control有流量控制
    • Conditionals are implemented by when:条件由when:
    • Iterators are implemented by withSequence: and withItems:迭代器由withSequence:withItems:
    • Recursion is possible by Templates calling themselves递归可以通过模板调用自己

The templates map somewhat directly onto Kubernetes YAML specs.模板 map 有点直接指向 Kubernetes YAML 规范。 Parameters appear to be shared via annotations and artifacts are shared via native Kubernetes functionality.参数似乎通过注释共享,工件通过本机 Kubernetes 功能共享。

How is the flow-control implemented?流量控制是如何实现的? What features of Kubernetes does Argo use to accomplish this? Argo 使用 Kubernetes 的哪些功能来实现这一点? Does it have something to do with the Kubernetes Control Plane?它与 Kubernetes 控制平面有关吗?

Argo Workflows is implemented with custom Kubernetes Custom Resources , eg its own yaml manifest types. Argo Workflows 使用自定义Kubernetes 自定义资源实现,例如它自己的 yaml 清单类型。 For every custom resource there is an associated custom pod that acts as a Kubernetes Controller with the logic.对于每个自定义资源,都有一个关联的自定义 pod,它充当Kubernetes Controller与逻辑。

The custom controller may create other resources or Pods, and watch the result of their execution status in the status-fields and then implement its workflow logics accordingly, eg watch results and follow the declared when: expressions depending on the results.自定义 controller 可以创建其他资源或 Pod,并在 status-fields 中观察其执行状态的结果,然后相应地实现其工作流逻辑,例如观察结果并遵循声明的when:表达式取决于结果。

I have more experience using Tekton Pipelines but it works the same way as Argo Workflows.我有更多使用Tekton Pipelines的经验,但它的工作方式与 Argo Workflows 相同。 If you are interested in implementing similar things, I recommend to start with Kubebuilder and read The Kubebuilder book .如果您对实现类似的东西感兴趣,我建议您从Kubebuilder开始并阅读The Kubebuilder book

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将 argo 工作流程与 argo cd 结合起来? - How to combine argo workflow with argo cd? 如何跳过 Argo 工作流程的一个步骤 - How to skip a step for Argo workflow 如何在 Argo 工作流程中增加计数器? - how to increment a counter in Argo workflow? 如何访问在 argo 的另一个工作流模板中生成的工作流中的输出 - How to access the outputs in a workflow which are generated in another workflow template in argo 如何在 argo 和 kubernetes 中运行 akka 流媒体应用程序? - how to run an akka streaming app in argo and kubernetes? 无法保存输出:等待 Argo 工作流条件超时 - failed to save outputs: timed out waiting for the condition on Argo Workflow 删除 argo cron 工作流是否也会删除由它启动的所有 argo 工作流 - Does deleting an argo cron workflow delete all argo workflows started by it as well Argo HTTP 工作流程 - 无法获取令牌量:服务帐户 argo/default 没有任何机密 - Argo HTTP workflow - failed to get token volumes: service account argo/default does not have any secrets Kubernetes 是否需要最少数量的副本才能执行滚动部署? - Does Kubernetes need a minimum number of replicas in order to carry out a rolling deployment? Kubernetes 如何控制复制? - How does Kubernetes control replication?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM