Search code examples
javakotlinkubernetesyamlargo-workflows

How do I Programmatically invoke Argo by submitting an appropriate .YAML file


The only way I see so far to create a container using Argo is through the command line:

argo submit --watch fileName.yaml

I would like to invoke Argo programmatically in Kotlin or Java in order to automate this process. Is there a way I can do that?

I've looked into documentation on Github: https://github.com/argoproj/argo-workflows. I did not find anything there.


Solution

  • I accomplished this task by invoking the Kubernetes API. Argo is a Custom Resource of Kubernetes, and has equivalent Kubernetes command

    kubectl create -f https://raw.githubusercontent.com/argoproj/argo-workflows/master/examples/hello-world.yaml

    I just had to invoke the above command using the Kubernetes API.