Play with "Argo Workflow" in your local kind
cluster.
The following instructions were tested in macOS Monterey (12.4), on 10 Jul 2022.
Ensure docker
is installed and running.
Install kubectl
CLI if you haven't yet.
Configure kind
before creating a cluster:
$ cat ~/.kube/kind-config.yaml
# 2 node (one masters & one worker) cluster config
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
extraPortMappings:
- containerPort: 80
hostPort: 80
listenAddress: "0.0.0.0"
- containerPort: 443
hostPort: 443
listenAddress: "0.0.0.0"
Create kind
cluster:
$ kind create cluster --name argo --config ~/.kube/kind-config.yaml
Set KUBECONFIG
:
$ export KUBECONFIG="$(kind get kubeconfig-path --name="argo")"
Verify:
$ kubectl cluster-info
Kubernetes master is running at https://127.0.0.1:58386
KubeDNS is running at https://127.0.0.1:58386/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
Create Namespace:
$ kubectl create ns argo
In Argo, each Workflow Step is a K8s Pod. For Argo to create pods to execute the steps of a Workflow, we must create a Rolebinding to grant permission to Argo Workflow Controller to run Pods in default namespace:
$ kubectl create rolebinding default-admin --clusterrole=admin --serviceaccount=default:default
By default, Argo's Executor is docker
. That doesn't work with kind
clusters. Kind uses containerd
, so let's configure Workflow Controller to use PNS (Process Namespace Sharing) executor:
$ kubectl create configmap -n argo workflow-controller-configmap --from-literal=config="containerRuntimeExecutor: pns"
Install Argo:
$ kubectl apply -n argo -f https://github.com/argoproj/argo-workflows/releases/download/v3.3.8/install.yaml
Verify if all Images have been pulled and that Pods are running:
$ kubectl get pod -n argo
NAME READY STATUS RESTARTS AGE
argo-server-746f79f45d-wdm79 1/1 Running 0 69s
workflow-controller-69cbc6579f-jc2dv 1/1 Running 0 69s
Argo is a Kubernetes Custom Controller and Workflow CRD (extension of K8s API). This means that kubectl
can be used to manage Workflows instead of Argo CLI:
$ kubectl create -f https://raw.githubusercontent.com/argoproj/argo/master/examples/coinflip.yaml
Port-forward:
$ kubectl port-forward -n argo svc/argo-server 8080:2746
Launch Argo UI at https://localhost:8080/.
- Kind for local Kubernetes - https://kind.sigs.k8s.io/
- Argo Quick Start - https://argoproj.github.io/argo/quick-start/
- Someone's solution in making Argo work in MicroK8s; use similar approach for
kind
clusters - argoproj/argo-workflows#2557 - https://boxboat.com/2020/02/10/argo-workflows/