Introduction & Architecture

Argo Workflows is an open source container-level workflow engine for coordinating parallel jobs on Kubernetes. Argo Workflows implements the entire architecture functionality by abstracting Kubernetes CRDs (Custom Resource Definitions), such as Workflow Template, Workflow, and Cron Workflow.

What can Argo workflow do?

  • Define workflows, where each step in the workflow is a container.
  • Model multi-step workflows as a series of tasks, or use directed acyclic graphs (DAGs) to capture dependencies between tasks.
  • With ArgoWorkflow on Kubernetes, you can easily run compute-intensive jobs for computer learning or data processing in a short time.
  • Run CI/CD pipelines locally on Kubernetes without configuring complex software development products.

What are the features of Argo workflow?

  • Workflow: Call multiple workflow templates for task orchestration and execute them in different orders.
  • Workflow Template: The template of a workflow is a definition of a workflow, so it can be called within a workflow template or in other workflows and workflow templates in the cluster.
  • Cluster Workflow Template: Cluster-level Workflow Template, which can access all namespaces of the cluster through clusterrole role authorization
  • Cron Wrokflow: Task scheduling type workflow, equivalent to the advanced version of k8s cronjob.

Installation Configuration

Install argo workflow

Here we install the stable version 2.12.10. The entire installation process will configure service account, role, ClusterRole, deployment, etc.

1
2
kubectl create ns argo
kubectl apply -n argo -f https://raw.githubusercontent.com/argoproj/argo/v2.12.10/manifests/install.yaml

Set up external access to the Ingress cluster

Since our cluster environment ingress controller uses traefik, and the default internal access method of argo workflow is to access via https, I can only add relevant annotations here to forward requests to argo-server

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: traefik
traefik.ingress.kubernetes.io/redirect-entry-point: https
name: argo-server
namespace: argo
spec:
rules:
- host: argo.test.cn
http:
paths:
- backend:
serviceName: argo-server
servicePort: web
path: /
status:
loadBalancer: {}

Cluster external access: https://argo.test.cn

workflow simple test

Here we take hello world as an example test:

1
2
3
4
5
6
7
# argo submit -n argo --watch https://raw.githubusercontent.com/argoproj/argo-workflows/master/examples/hello-world.yaml
Name: hello-world-4mffd
Namespace: argo
ServiceAccount: default
Status: Pending
Created: Fri May 07 16:11:25 +0800 (now)
Name: hello-world-4mffd Namespace: argo ServiceAccount: default Status: Pending Created: Fri May 07 16:11:25 +0800 (now) Name: hello-world-4mffd Namespace: argo ServiceAccount: default Status: Running Created: Fri May 07 16:11:25 +0800 (now) ) Duration: 0 seconds STEP TEMPLATE PODNAME DURATION MESSAGE ◷ hello-world-4mffd whalesay hello-world-4mffd 0s Name: hello-world-4mffd Namespace: argo ServiceAccount: default Status: Running Created: Fri May 07 16:11:25 +0800 (10 seconds ago) Started: Fri May 07 16:11:25 +0800 (10 seconds ago) Duration: 10 seconds STEP TEMPLATE PODNAME DURATION MESSAGE ◷ hello-world-4mffd whalesay hello-world-4mffd 10s ContainerCreating Name: hello-world-4mffd Namespace: argo ServiceAccount: default Status: Succeeded Conditions: Completed True Created : Fri May 07 16:11:25 +0800 (2 minutes ago) Started: Fri May 07 16:11:25 +0800 (2 minutes ago) Finished: Fri May 07 16:14:18 +0800 (now) Duration: 2 minutes 53 seconds ResourcesDuration: 1m18s*cpu,1m18s*memory STEP TEMPLATE PODNAME DURATION MESSAGE ✔ hello-world-4mffd whalesay hello-world-4mffd 2m # argo list -n argo NAME STATUS AGE DURATION PRIORITY hello-world-4mffd Succeeded 3m 2m 0 # argo logs -f hello-world-4mffd -n argo hello-world-4mffd: _____________ hello-world-4mffd: < hello world > hello-world-4mffd: ------------- hello-world-4mffd: \ hello-world-4mffd: \ hello-world-4mffd: \ hello-world-4mffd: ## . hello-world-4mffd: ## ## ## == hello-world-4mffd: ## ## ## ## === hello-world-4mffd: /""""""""""""""___/ === hello-world-4mffd: ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~ hello-world-4mffd: \______ o __/ hello-world-4mffd: \ \ __/ hello-world-4mffd: \____\______/ ```