Demo for my talk at ArgoCon '21 showing how to use Go to create and submit dynamic Argo Workflows. This repo implements a Go-based CLI called "feedme" that will accept one or more of the following meals to prepare using Argo Workflows:
omelette
egg-sandwich
turkey-sandwich
pasta
steak
cake
Usage:
./feedme --omelette --egg-sandwich --turkey-sandwich --pasta --steak --cake
Should create a workflow that looks like:
If you leave out any of the meals, the DAG will omit those branches. Running:
./feedme --steak --cake
Will produce:
- Have a Kubernetes cluster available, I used Docker for Mac's.
- Install Argo:
kubectl create namespace argo kubectl apply -n argo -f https://github.com/argoproj/argo-workflows/releases/download/v3.2.4/install.yaml
- Disable Argo Auth (for local installs only!):
kubectl patch deployment -n argo argo-server -p '{"spec":{"template":{"spec":{"containers":[{"name":"argo-server","args":["server", "--auth-mode", "server"]}]}}}}'
- Make Argo accessible outside the cluster (may differ depending on your K8s setup):
kubectl patch service -n argo argo-server -p '{"spec":{"type":"NodePort"}}' # Get the Argo UI port: kubectl get service -n argo argo-server -oyaml | grep nodePort: # open the UI open https://localhost:<PORT>
- Build this program (tested using Go 1.17 originally)
go build -o feedme ./cmd
- Run
./feedme omlette steak cake