0% found this document useful (0 votes)
29 views11 pages

CR DevOps

Uploaded by

chaima bouhlel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views11 pages

CR DevOps

Uploaded by

chaima bouhlel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

DevOps

Compte-rendu TP4
Modern Pipeline Creation

Rédigé par:

- CHAIMA BOUHLEL
- NADA KHELIF

GL4
Introduction
In this lab, we delve into Continuous Integration and Continuous Deployment (CI/CD)
pipelines, focusing on their pivotal role in modern software development. We aim to
propose three comprehensive pipelines encompassing the latest concepts and using
open-source tools. Through three different pipeline architectures, we aim to elucidate each
tool's contribution's significance, foster a deeper understanding of CI/CD principles and
practices, and pave the way for seamless software delivery and deployment.

First Pipeline: Continuous Integration / Continuous


Delivery
Diagram:

Link to the diagram:

CI/CDPiprline1.drawio

Detailed view of the diagram:

2
3
Description:

Our pipeline encompasses automated steps that streamline the software engineering
process from code development to delivery.

The CI/CD pipeline typically begins with the source stage, where code is retrieved from a
version control system like GitHub. This stage includes setting up branch protection rules
and implementing linting checks to maintain code integrity and quality.

The subsequent build stage involves compiling code and creating container images, often
using technologies like Docker. Unit tests are run during this stage to verify basic
functionality, and code coverage checks ensure sufficient test coverage.

Moving forward, the testing stage conducts comprehensive testing, such as integration
tests, to validate the application's functionality as a whole. This stage may require an
integrated testing environment to simulate dependencies accurately.

Finally, the release stage deploys the application to the dockerhub for use in various
environments, including QA, staging, and production. Images are shipped to a registry, and
environments pull these images for additional testing and deployment.

Tools Choice:

Source Stage: Git with GitLab

Tool: GitLab

- Explanation: GitLab provides a comprehensive platform for version control, issue


tracking, and CI/CD pipelines. In the source stage, GitLab allows developers to
manage code repositories effectively, enforce branch protection rules, and trigger
CI/CD workflows based on code changes.

Build Stage: Jenkins

4
Tool: Jenkins

- Explanation: Jenkins is a popular automation server that facilitates the build process
in CI/CD pipelines. It supports compiling code, building container images (e.g., using
Docker), and running unit tests. Jenkins' flexibility and extensibility make it suitable
for various build tasks across different technologies.

Testing Stage: Selenium

Tool: Selenium

- Explanation: Selenium is a powerful tool for automated testing of web applications.


In the testing stage of the CI/CD pipeline, Selenium can be used to perform
integration tests, UI tests, and end-to-end testing. Its ability to simulate user
interactions across browsers makes it invaluable for ensuring application
functionality.
-

Second Pipeline: CI/CD + CD


Diagram:

5
CICD.drawio

Detailed View of the diagram:

6
Description:

We will take our previous CI/CD pipeline and then we will trigger a CD pipeline:

Configuration Repository Setup: The deployment pipeline starts by creating a separate


repository specifically for configurations. This repository holds essential files like Docker
compose files or Kubernetes manifests, which are necessary for deploying the application.

Manifest Files Population: Once the configuration repository is set up, it is populated with
manifest files. For example, a Kubernetes deployment manifest is added, referencing the
container image generated in the CI/CD pipeline.

Deployment Models: We have two deployment models: the push model and the pull
model. In the push model, configurations are manually or automatically pushed to
environments. In contrast, the pull model, facilitated by tools like Argo CD, pulls

7
configurations from the repository to synchronize environments automatically. We will be
using the pull model!

Automatic Triggering: The deployment pipeline is designed to be triggered automatically


at the conclusion of the CI/CD pipeline for the staging environment and manually for the
production environment.

Observability and Monitoring: The pipeline incorporates observability tools like


Prometheus and Grafana for monitoring application performance. These tools provide
insights into system metrics, helping teams track and optimize application behavior in
real-time.

Canary Deployments: A crucial aspect discussed is Canary deployments, where traffic is


incrementally shifted from an old version to a new version until full deployment. Tools like
Argo rollouts in Kubernetes facilitate smooth Canary deployments, allowing teams to test
new versions in production with minimal risk.

Tools Choice:

Tool: Kubernetes

Explanation: Kubernetes is a container orchestration platform that simplifies application


deployment and management. Its scalability and declarative configuration make it ideal for
continuous deployment.

ArgoCD:

ArgoCD plays a crucial role in managing application deployments in Kubernetes clusters,


handling tasks like canary deployments, rollbacks, and version control of configurations.

GitOps:

GitOps is the foundation of the deployment pipeline, where configurations and deployment
manifests are stored in Git repositories. Tools like ArgoCD or Flux continuously reconcile
the cluster state with the desired state defined in Git, enabling automated and declarative
deployments.

8
GitLab and GitLab CI/CD:

GitLab provides a comprehensive platform for version control (Git repository hosting),
issue tracking, code review, and CI/CD automation. GitLab CI/CD pipelines are used to
define, build, test, and deploy applications automatically based on code changes.

Terraform:

Terraform is used in the pipeline to define infrastructure configurations as code, ensuring


consistency and reproducibility of deployments across environments. It automates the
provisioning of infrastructure resources, such as virtual machines, networks, and storage,
reducing manual intervention and potential errors.

Prometheus and Grafana (Observability Tools):

Prometheus and Grafana provide real-time monitoring and observability of deployed


applications. They track application metrics, resource utilization, and performance, helping
teams detect and resolve issues quickly.

Docker Hub Container Registry:

Stores Docker images generated during the CI/CD pipeline for deployment.

Second Pipeline: CI/CD pipeline: Continuous Integration /


Continuous Deployment
Diagram:

9
Link to the diagram:

Copy of CICD.drawio

Description and tools to use:


1. Get Source Code:

This stage involves fetching the source code of the application from a version

control system like GitLab.

2. Build Image:

The source code is used to build a container image, which includes all the

dependencies and configurations needed to run the application.

Tools used: Docker (for containerization), GitLab CI/CD (to define and automate the

build process).

3. Test:

Automated tests are run on the built image to ensure that the application functions

correctly and meets quality standards.

10
Tools used: GitLab CI/CD (for defining and executing automated tests), SonarQube

(for code quality analysis and static code analysis).

4. Release Image on Docker Hub:

Once the image passes the tests and is deemed ready for deployment, it is pushed

to a container registry like Docker Hub.

5. Deploy on Kubernetes:

The image stored in the container registry is deployed onto a Kubernetes cluster,

which manages and orchestrates containerized applications.

Tools used: Kubernetes (for container orchestration), GitLab CI/CD (for deploying

to Kubernetes), Ansible (for configuration management and automation tasks

within the Kubernetes environment).

Azure is used as the cloud provider, providing infrastructure services and resources

for hosting the Kubernetes cluster and other cloud-based components.

Conclusion
In conclusion, we have successfully designed and implemented three pipelines: a CI/CD
pipeline, a CD pipeline, and a complete CI/CD pipeline. Each pipeline integrates essential
tools such as GitLab for version control, Jenkins for automation, Docker for
containerization, and Kubernetes for orchestration. This architecture ensures a smooth
workflow from code development to deployment, streamlining the software delivery
process.

11

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy