Simple Batch Workflow

Simple Batch Workflow

Save the below manifest as ‘workflow-whalesay.yaml’ using your favorite editor and let’s deploy the whalesay example from before using Argo.

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: whalesay-
spec:
  entrypoint: whalesay
  templates:
  - name: whalesay
    container:
      image: docker/whalesay
      command: [cowsay]
      args: ["This is an Argo Workflow!"]

Now deploy the workflow using the argo CLI.

You can also run workflow specs directly using kubectl but the argo CLI provides syntax checking, nicer output, and requires less typing. For the equivalent kubectl commands, see Argo CLI.

argo submit --watch workflow-whalesay.yaml
Name:                whalesay-2kfxb
Namespace:           default
ServiceAccount:      default
Status:              Succeeded
Created:             Sat Nov 17 10:32:13 -0500 (3 seconds ago)
Started:             Sat Nov 17 10:32:13 -0500 (3 seconds ago)
Finished:            Sat Nov 17 10:32:16 -0500 (now)
Duration:            3 seconds

STEP               PODNAME         DURATION  MESSAGE
 ✔ whalesay-2kfxb  whalesay-2kfxb  2s        

Make a note of the workflow’s name from your output (It should be similar to whalesay-xxxxx).

Confirm the output by running the following command, substituting name of your workflow for “whalesay-xxxxx”:

argo logs whalesay-xxxxx
 ___________________________ 
< This is an Argo Workflow! >
 --------------------------- 
    \
     \
      \     
                    ##        .            
              ## ## ##       ==            
           ## ## ## ##      ===            
       /""""""""""""""""___/ ===        
  ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~   
       \______ o          __/            
        \    \        __/             
          \____\______/