You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

At EED we have two k8s cluster accel-webapp-dev and accel-webapp respectively for testing and production deployment. In this article we are going to describe how CD/CD has been implemented to achieve CI/CD (Continuous Integration and Continuous Delivering). each one environment is identified by his hostname accel-webapp-dev.slac.stanford.edu and accel-webapp.slac.stanford.edu.

Overview

This document outlines the continuous deployment pipeline for Project A. The pipeline is designed to manage deployments from development through to production using Kubernetes clusters, with human intervention required for promotion to the production environment.

Pipeline Stages

Development Stage

- **Source**: The source code resides in `Project repository` hosted on GitHub/GitLab, this i where the developer push change request for updating software functionality, the "main branch is portected" force the creation of merge request, that will be merged when all check will be verified with static error checking and dynamic error checking give by the unit tests.
- **Compile**: The code is compiled in this stage.
- **Test**: Automated tests are run to ensure code quality and functionality.
- **Build Docker Image**: A Docker image is created from the compiled code.
- **Promote Pre**: The image is then tagged for the pre-production stage.

Pre-Production Stage

- **Automated Deployment**: Using Argo CD, the Docker image is automatically deployed to the Kubernetes (K8s) Pre-Production Cluster (accel-webapp-dev.slac.stanford.edu).
- **Components**:
  - **ProjectA Artifact**: Deployed application artifact.
  - **MongoDB**: The pre-production database instance.
  - **MariaDB**: Another pre-production database instance.
  - **Argo CD**: The continuous deployment tool that synchronizes the cluster state with the repository state.

Production Stage

- **Wait Promotion**: Deployment to production requires human intervention for approval.
- **Promotion**: Once approved, the configuration from the pre-production is promoted to the production Git repository.
- **Automated Deployment**: Argo CD automatically deploys the promoted configuration to the Kubernetes (K8s) Production Cluster (accel-webapp.slac.stanford.edu).
- **Components**:
  - **ProjectA Artifact**: Deployed application artifact in production.
  - **MongoDB**: The production database instance.
  - **MariaDB**: Another production database instance.
  - **Argo CD**: Manages the deployment and ensures the production cluster state is in sync with the production repository.

Deployment Flow

1. Code changes are pushed to `Project A GitRepo`.
2. A CI pipeline compiles the code and runs tests.
3. Upon successful testing, a Docker image is built.
4. The image is tagged for pre-production and deployed to the pre-production cluster using Argo CD.
5. After successful deployment and testing in pre-production, a human promotes the configuration for production deployment.
6. Argo CD synchronizes the production cluster with the changes from the production Git repository.

Sync State

- Both pre-production and production clusters have a sync state to ensure the deployed applications are in sync with their respective Git repositories.
- The sync process is managed by Argo CD, which continuously monitors the repositories for changes and applies them to the clusters.


  • No labels