Skip to content

Hello World

Let's start by creating a very simple workflow template to echo "hello world" using the docker/whalesay container image from Docker Hub.

You can run this directly from your shell with a simple docker command:

$ docker run docker/whalesay cowsay "hello world"
< hello world >
                    ##        .
              ## ## ##       ==
           ## ## ## ##      ===
       /""""""""""""""""___/ ===
  ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~
       \______ o          __/
        \    \        __/

Hello from Docker!
This message shows that your installation appears to be working correctly.

Below, we run the same container on a Kubernetes cluster using an Argo workflow template. Be sure to read the comments as they provide useful explanations.

kind: Workflow                  # new type of k8s spec
  generateName: hello-world-    # name of the workflow spec
  entrypoint: whalesay          # invoke the whalesay template
    - name: whalesay              # name of the template
        image: docker/whalesay
        command: [ cowsay ]
        args: [ "hello world" ]
        resources: # limit the resources
            memory: 32Mi
            cpu: 100m

Argo adds a new kind of Kubernetes spec called a Workflow. The above spec contains a single template called whalesay which runs the docker/whalesay container and invokes cowsay "hello world". The whalesay template is the entrypoint for the spec. The entrypoint specifies the initial template that should be invoked when the workflow spec is executed by Kubernetes. Being able to specify the entrypoint is more useful when there is more than one template defined in the Kubernetes workflow spec. :-)


Back to top