Skip to content

Instantly share code, notes, and snippets.

@peteristhegreat
Last active January 13, 2025 02:58
Show Gist options
  • Save peteristhegreat/0fd04dadbb157dee04ea79f4bdaca15a to your computer and use it in GitHub Desktop.
Save peteristhegreat/0fd04dadbb157dee04ea79f4bdaca15a to your computer and use it in GitHub Desktop.
Getting Started with Argo Workflows 2024
apiVersion: v1
kind: ServiceAccount
metadata:
name: argo
namespace: default
annotations:
meta.helm.sh/release-name: argo-3
automountServiceAccountToken: true
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: argo
rules:
- apiGroups:
- argoproj.io
resources:
- clusterworkflowtemplates
- cronworkflows
- eventbus
- eventsources
- sensors
- workflowartifactgctasks
- workfloweventbindings
- workflows
- workflowtaskresults
- workflowtasksets
- workflowtemplates
verbs:
- "*"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: argo-rolebinding
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: argo
subjects:
- kind: ServiceAccount
name: argo
namespace: default
---
apiVersion: v1
kind: Secret
metadata:
name: argo-token
namespace: default
annotations:
kubernetes.io/service-account.name: argo
type: kubernetes.io/service-account-token

Setup PVC/PV access for your k8s cluster.

Download the values.yaml below and put it in your current directory.

It is based off of:

https://github.com/bitnami/charts/blob/main/bitnami/argo-workflows/values.yaml

Install the helm chart from bitnami

helm upgrade --install argo-3 oci://registry-1.docker.io/bitnamicharts/argo-workflows -f values.yaml
kubectl apply -f argo-serviceaccount-setup.yaml

Install argo-cli via instructions seciton on one of the releases.

https://github.com/argoproj/argo-workflows/releases/

usually something like

ARGO_OS=darwin # or linux
curl -sLO "https://github.com/argoproj/argo-workflows/releases/download/v3.6.0-rc3/argo-$ARGO_OS-amd64.gz"
gunzip "argo-$ARGO_OS-amd64.gz"
chmod +x "argo-$ARGO_OS-amd64"
mv "./argo-$ARGO_OS-amd64" /usr/local/bin/argo
argo version

Wait until you have running pods for Argo...

$ kubectl get pods
NAME                                                                       READY   STATUS      RESTARTS        AGE
argo-3-argo-workflows-controller-6f74896bc7-2rfqr                          1/1     Running     3               10m
argo-3-argo-workflows-server-d5f5c4cb5-jrsqk                               1/1     Running     0               10m
argo-3-postgresql-0                                                        1/1     Running     0               10m

Download the argo-workflows/templates.yaml and the rest of the examples from https://github.com/argoproj/argo-workflows/tree/main/examples/workflow-template

Push the default workflow-template/templates.yaml for the examples:

argo template create templates.yaml

Now you can submit workflows as long as you specify the service account

argo submit example.yaml --serviceaccount argo

Troubleshooting

PVC not working? Setup PVC for your k8s stack properly, and be sure to set the storageClass in your values.yaml. Also delete the stale PVC or you won't see it come up.

Crashes and restarts on some of the server pods, intermittently

Change the resourcesPreset for the pod that is having issues. Such as:

server.resourcesPreset
controller.resourcesPreset
executor.resourcesPreset
postgresql.primary.resourcesPreset

The default value is nano. Consider changing to micro or small depending on how busy your argo workflows cluster is.

global:
defaultStorageClass: "gp2" # e.g. for AWS
storageClass: "gp2"
controller:
workflowNamespaces:
- default
server:
auth:
mode: server
workflow:
rbac:
create: true
serviceAccount:
create: true
name: argo-workflow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment