Home_EN - Dylalva/Project-CI-CD-Pipeline GitHub Wiki
📖 Project Description
In this second part of the Networks Project, we implement a CI/CD pipeline for a Python (Flask) web application, fully containerized and deployed on Azure Kubernetes Service (AKS). The overall flow is:
-
The source code lives in a GitHub repository.
-
A Jenkins server, hosted on an Azure virtual machine, detects each push and:
- Builds the Docker image of the application.
- Pushes it to Docker Hub (or Azure Container Registry).
-
An AKS cluster pulls the new image and automatically deploys the application.
With this pipeline, we achieve faster, more reliable, and reproducible deliveries of our Flask app.
🔍 Workflow
- Push to GitHub →
- Jenkins (Azure VM) detects the change →
- Builds and pushes the Docker image →
- Updates your AKS cluster →
- App Running on Azure.
🧰 Technologies and Tools
- Python 3.x and Flask
- Docker (for building images and containers)
- Jenkins (installed on an Azure VM) / GitHub Actions
- Docker Hub
- Azure Kubernetes Service (AKS)
- Azure CLI and kubectl
📋 Prerequisites
Before getting started, make sure you have:
- An active Azure Subscription.
- An Azure VM with Jenkins installed and accessible.
- A Docker Hub account (or ACR) and credentials ready.
- An AKS Cluster created, with
kubectl
configured on the Jenkins VM. - Azure CLI and kubectl installed wherever you’ll run the commands.
- Access to the GitHub repository containing your Flask code and a ready
Dockerfile
.
🚀 Steps to Set Up the Entire Environment
-
Clone the Repository
git clone https://github.com/Dylalva/Parte2Redes.git cd Parte2Redes
Here you’ll find:
. ├── app.py ├── Dockerfile ├── requirements.txt ├── .dockerignore ├── static/ └── templates/
-
Configure Jenkins on Your Azure VM
Create the Azure VM
Install and Set Up Jenkins on the Azure VM
Jenkins Installation and Configuration
-
Install the Docker, Git, and Azure CLI plugins.
-
Create Credentials for:
- Docker Hub (username/password).
- Azure Service Principal (for
az aks get-credentials
). - GitHub (if your repo is private).
-
-
Define the Pipeline in Jenkins
- Use either a Freestyle Job or a Pipeline Job with a
Jenkinsfile
.
In this repository, you’ll find a
Jenkinsfile
. - Use either a Freestyle Job or a Pipeline Job with a
-
Create the Kubernetes Cluster
-
Final Test
- Make a PUSH to the main branch of your GitHub repo.
- Watch Jenkins trigger the pipeline.
- Once it finishes, go to your Load Balancer or configured domain to see the Flask app running in production.