This README provides a comprehensive explanation of the updated GitOps workflow diagram, which visualizes the deployment process across different environments and clusters, utilizing GitHub Actions, ArgoCD, ApplicationSets, and Continuous Integration (CI) processes.
This diagram represents a sequence of steps initiated by a Pull Request being merged to either dev
or main
branches, leading to deployments in different Kubernetes clusters. The workflow is divided into several stages, each representing a specific task or process in the deployment pipeline.
-
Continuous Integration (CI) Process
- Triggered when a PR is merged to
dev
ormain
. - It lints, tests, builds, pushes, and tags the image.
- Triggered when a PR is merged to
-
Code Change Trigger
- A change is made to the codebase, triggering the
Gitops-trigger
GitHub Actions workflow. - This workflow generates a token and dispatches another workflow in the
gitops-applications
repository, passing relevant information such as commit_id, repo_name, and environment.
- A change is made to the codebase, triggering the
-
Argo CD Application Commit
- Triggered by the
workflow_dispatch
event, this workflow generates another token and checks out the code in thedev
branch. - It updates the image tag in the
values-<repo_name>.yaml
file and commits the changes. - If the commit fails, it retries the commit and sends a failure notification to Slack if the retry also fails.
- Triggered by the
-
ApplicationSet Configuration
- The ApplicationSet, defined in the
zenith-appset-prod
, watches for changes in thegitops-applications
repository and deploys applications based on the configurations in the*.yaml
files located in theprod/config/pilotgab-appset/
directory. - It deploys to the specified namespace in the
prod
project of the ArgoCD, located in the Kubernetes cluster.
- The ApplicationSet, defined in the
- Sandbox and Staging Clusters: Triggered by merging and pushing to the
dev
branch. - Prod Cluster: Triggered by merging and pushing to the
master
branch.
This process is initiated by any Pull Request being merged to dev
or main
. It is responsible for linting, testing, building, pushing, and tagging the image.
This workflow is initiated by any code change in the repository. It is responsible for generating a GitHub token and triggering the Argo CD application commit
workflow in the gitops-applications
repository with the necessary inputs.
This workflow is responsible for:
- Generating a token for checking out the code and committing changes.
- Installing
yq
for YAML processing. - Updating the image tag in the respective
values-<repo_name>.yaml
file. - Committing and pushing the changes to the
dev
branch. - Sending a notification to Slack in case of failure.
The ApplicationSet object, pilotgab-appset-prod
, is configured to watch the gitops-applications
repository for changes and deploy applications based on the YAML configurations in the specified path. It deploys the applications to the prod
project in ArgoCD, which is located in the Kubernetes cluster.
- Prod Cluster: Deployments are triggered by merging and pushing to the
master
branch. - Sandbox and Staging Clusters: Deployments are triggered by merging and pushing to the
dev
branch.