Argo is an open-source workflow engine built for Kubernetes with integrated functionalities of Continuous Integration (CI) and Continuous Delivery (CD). The source code can be accessed openly at https://github.com/argoproj.
Installing Argo
Using argo install command
# Download Argo.curl-sSL-oargohttps://github.com/argoproj/argo/releases/download/v2.1.0/argo-linux-amd64chmod+xargosudomvargo/usr/local/bin/argo# Deploy to Kuberneteskubectlcreatenamespaceargoargoinstall-nargo
Next, create a bucket named argo-bucket (You can use kubectl port-forward service/argo-artifacts-minio :9000 to reach the Minio UI for operation):
# download mc clientsudowgethttps://dl.minio.io/client/mc/release/linux-amd64/mc-O/usr/local/bin/mcsudochmod+x/usr/local/bin/mc# create argo-bucketEXTERNAL_IP=$(kubectl-nargogetserviceargo-artifacts-minio-ojsonpath='{.status.loadBalancer.ingress[0].ip}')mcconfighostaddargo-artifacts-minio-localhttp://$EXTERNAL_IP:9000 $ACCESS_KEY $ACCESS_SECRET_KEY --api=s3v4mcmbargo-artifacts-minio-local/argo-bucket
Then, modify the Argo workflow controller to use Minio:
$ kubectl -n argo create secret generic argo-artifacts-minio --from-literal=accesskey=$ACCESS_KEY --from-literal=secretkey=$ACCESS_SECRET_KEY
$kubectleditconfigmapworkflow-controller-configmap-nargo...executorImage:argoproj/argoexec:v2.0.0artifactRepository:s3:bucket:argo-bucketendpoint:argo-artifacts-minio.argo:9000insecure:true# accessKeySecret and secretKeySecret are secret selectors.# It references the k8s secret named 'argo-artifacts-minio'# which was created during the minio helm install. The keys,# 'accesskey' and 'secretkey', inside that secret are where the# actual minio credentials are stored.accessKeySecret:name:argo-artifacts-miniokey:accesskeysecretKeySecret:name:argo-artifacts-miniokey:secretkey
Installing Using Helm
Please note: The current Helm Charts use an outdated version of Minio and the deployment might fail.
# Download Argo.curl-sSL-o/usr/local/bin/argohttps://github.com/argoproj/argo/releases/download/v2.0.0/argo-linux-amd64chmod+x/usr/local/bin/argo# Deploy to Kuberneteshelmrepoaddargohttps://argoproj.github.io/argo-helm/kubectlcreateclusterrolebindingdefault-admin--clusterrole=cluster-admin--serviceaccount=kube-system:defaulthelminstallargo/argo-ci--nameargo-ci--namespace=kube-system
Accessing the Argo UI
$kubectl-nargoport-forwardservice/argo-ui:80Forwardingfrom127.0.0.1:52592 ->8001Forwardingfrom [::1]:52592 -> 8001# Open browser and visit 127.0.0.1:52592
Working with workflows
Firstly, give the default ServiceAccount cluster administration permission
# Authz yourself if you are not admin.kubectlcreateclusterrolebindingdefault-admin--clusterrole=cluster-admin--serviceaccount=argo:default
# This example demonstrates the ability to pass artifacts# from one step to the next.apiVersion:argoproj.io/v1alpha1kind:Workflowmetadata:generateName:artifact-passing-spec:entrypoint:artifact-exampletemplates: - name:artifact-examplesteps: - - name:generate-artifacttemplate:whalesay - - name:consume-artifacttemplate:print-messagearguments:artifacts: - name:messagefrom:"{{steps.generate-artifact.outputs.artifacts.hello-art}}" - name:whalesaycontainer:image:docker/whalesay:latestcommand: [sh,-c]args: ["cowsay hello world | tee /tmp/hello_world.txt"]outputs:artifacts: - name:hello-artpath:/tmp/hello_world.txt - name:print-messageinputs:artifacts: - name:messagepath:/tmp/messagecontainer:image:alpine:latestcommand: [sh,-c]args: ["cat /tmp/message"]