Search code examples
kubernetesworkflowargoprojargo-workflows

Kickoff Argo workflows via REST call


I am exploring Argo to orchestrate processing big data. I wish to kick off a workflow via REST call that divides a large data set among a number of machines with desired resources for processing. From an architectural perspective, how would I accomplish this? Is there an REST api or maybe some libraries for Node.js that I can use?


Solution

  • According to 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
    

    You can find examples for Golang, Python, Java, Ruby, OpenAPI following this link.

    So, you can generate a YAML file describing Argo Workflow resources and send it to the Kubernetes API as described in the examples.

    I hope it helps.