通过 REST 调用启动 Argo 工作流程

Kickoff Argo workflows via REST call

我正在探索 Argo 来协调处理大数据。我希望通过 REST 调用启动一个工作流,该工作流将大型数据集分配给具有所需资源进行处理的多台机器。从架构的角度来看,我将如何实现这一目标?是否有我可以使用的 REST api 或者 Node.js 的一些库?

根据 Argo documentation:

Argo is implemented as a kubernetes controller and Workflow Custom Resource. Argo itself does not run an API server, and with all CRDs, it extends the Kubernetes API server by introducing a new API Group/Version (argorproj.io/v1alpha1) and Kind (Workflow). When CRDs are registered in a cluster, access to those resources are made available by exposing new endpoints in the kubernetes API server.
For example, to list workflows in the default namespace, a client would make an HTTP GET request to:

https://<k8s-api-server>/apis/argoproj.io/v1alpha1/namespaces/default/workflows

您可以在 this link.

之后找到 Golang、Python、Java、Ruby、OpenAPI 的示例

因此,您可以生成一个描述 Argo Workflow 资源的 YAML 文件,并将其发送到 Kubernetes API,如示例中所述。

希望对您有所帮助。

阿尔戈 2.5 introduces its own API.

目前官方支持Golang and Java clients. There is also a community-supported Python client. Updates will be available here: https://github.com/argoproj-labs/argo-client-gen

Argo 提供了 Swagger API 规范,因此为其他语言生成客户端应该相当容易。