argo-workflows
Less than 1 minute
argo-workflows
prepare
- k8s is ready
- argocd is ready and logged in
- ingress is ready
- cert-manager is ready
- the clusterissuer named
self-signed-ca-issuer
is ready
- the clusterissuer named
installation
- prepare
argo-workflows.yaml
apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: argo-workflows spec: syncPolicy: syncOptions: - CreateNamespace=true project: default source: repoURL: https://argoproj.github.io/argo-helm chart: argo-workflows targetRevision: 0.40.11 helm: releaseName: argo-workflows values: | crds: install: true keep: false singleNamespace: false controller: image: registry: quay.io workflowNamespaces: - business-workflows executor: image: registry: quay.io workflow: serviceAccount: create: true rbac: create: true server: enabled: true image: registry: quay.io ingress: enabled: true ingressClassName: nginx annotations: cert-manager.io/cluster-issuer: self-signed-ca-issuer nginx.ingress.kubernetes.io/rewrite-target: /$1 hosts: - argo-workflows.dev.geekcity.tech paths: - /?(.*) tls: - secretName: argo-workflows-tls hosts: - argo-workflows.dev.geekcity.tech authModes: - server sso: enabled: false destination: server: https://kubernetes.default.svc namespace: workflows
- prepare argo workflow client binary
MIRROR="files." VERSION=v3.5.4 curl -sSLo argo-linux-amd64.gz "https://${MIRROR}github.com/argoproj/argo-workflows/releases/download/${VERSION}/argo-linux-amd64.gz" gunzip argo-linux-amd64.gz chmod u+x argo-linux-amd64 mkdir -p ${HOME}/bin mv -f argo-linux-amd64 ${HOME}/bin/argo rm -f argo-linux-amd64.gz
- create
business-workflows
namespace to be controlled- NOTE: this should be set with
controller.workflowNamespaces
in the values ofargo-workflows.yaml
kubectl get namespace business-workflows > /dev/null 2>&1 || kubectl create namespace business-workflows
- NOTE: this should be set with
- apply to k8s
kubectl -n argocd apply -f argo-workflows.yaml
- sync by argocd
argocd app sync argocd/argo-workflows
tests
hello world
- prepare
hello-world.yaml
apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: generateName: hello-world- spec: entrypoint: whalesay serviceAccountName: argo-workflow templates: - name: whalesay container: image: docker.io/docker/whalesay:latest command: - cowsay args: - hello world
- submit with argo workflow client
argo -n business-workflows submit hello-world.yaml
- check status
argo -n business-workflows list
# argo -n business-workflows get hello-world-m5kqf argo -n business-workflows get @lastest
# argo -n business-workflows logs hello-world-m5kqf argo -n business-workflows logs @latest