Skip to content

phdah/argoWorkflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

argoWorkflow

Fully automated setup for local functioning Argo CI/CD. It is done by

  • setting up Kind k8s cluster
  • installing Argo CD

Then Argo CD installs and maintain all other applications specified in the app/application.yml file. Here both other infra apps, such as Argo itself, and non-infra apps are defined.

Everything is setup to be done with make for an easy and idempotent interaction.

Useful links

Argo Workflow: installation guide

Argo Events working example

Installation

Prerequisite

kind (0.17.0)
kubectl (1.26.2-1)
make (4.4.1)
terraform (v1.4.0) -- Only for Terraform install

Install for Kind, using manifest files and Terraform

Following this blog post and his repo

Using the present main.tf file to setup

  • k8s cluster
  • Argo CD, from official manifest
  • Load a application.yml to initialize the CD

Run the following

cd terraform_manifest
make install

Install for Kind, without Terraform

Following installation guide

Using the present manifest files

  • k8s cluster
  • Argo CD, from official manifest
  • Load a application.yml to initialize the CD

Run the following

cd manual_install
make install

Using and interacting with Argo

Argo CI/CD UI

Once the pods are up and running, port forward the Argo services and fetch admin credentials to access the UI. There is a UI for both Argo CD and Argo Workflows.

Run the following to start services

make start

To stop the services, run

make stop

If the UI's don't auto start, you will find Argo CD on https://localhost:8080/, and Argo Workflow on https://localhost:2746/. All the commands are placed in the maintenance directories as shell scripts.

Rolling back Argo CD

Since we have our CD application also automatically synced with git, when we ever make any changes, to either an application or Argo CD itself, we can just roll back with git. Use your knowledge of git to choose the appropriate way of doing so; revert, reset, rebase. Here is an example of how to do it with reset to a specific COMMIT id

git log --oneline
git reset --hard <COMMIT>
git push --force

Clean up

To clean up the k8s cluster and all created resources and files, just run

make clean

inside of the chosen installation method's directory.

Our Argo Architecture

Applications are continuously deployed with Argo CD. The applications are deployed using a GitOps structure, where the actual state is compared to the desired state to identify the need for updating the k8s resources.

The Argo infra is using a automatic sync approach, i.e., sync every three minutes while all deployed applications use the EventFlow structure. These apps are deployed using Workflows. These are tightly coupled with Events, using the below architecture.

Events are written to the Event Bus, which are then picked up by the Sensor which triggers the Workflow and does potential tests etc, and finished by deploying to prod env.


TODO:

Setup deployment/CD to be triggered by event: potential guide