Skip to content

cloudwithpavan/aks-devops-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ End-to-End DevOps Platform on Azure AKS

CI/CD โ€ข Terraform โ€ข Trivy Security Scanning โ€ข Prometheus โ€ข Grafana โ€ข Kubernetes

This project demonstrates a production-style DevOps platform built on Azure Kubernetes Service (AKS).

It implements a complete CI/CD pipeline, container security scanning, monitoring, autoscaling, and infrastructure provisioning using Terraform.

The platform deploys a Node.js application using Helm through an Azure DevOps pipeline.


๐Ÿ“Š Architecture Diagram

Architecture


๐Ÿงญ System Architecture Overview

The platform follows a CI/CD-driven DevOps workflow.

Workflow

Developer commits code โ†“ Azure DevOps pipeline triggers automatically โ†“ Docker image is built โ†“ Image is scanned using Trivy โ†“ Image is pushed to Azure Container Registry (ACR) โ†“ Helm deploys the application to Azure Kubernetes Service (AKS) โ†“ Prometheus collects system metrics โ†“ Grafana visualizes operational dashboards


๐Ÿงฐ Technology Stack

Category Technology
Cloud Platform Microsoft Azure
CI/CD Azure DevOps
Containerization Docker
Orchestration Kubernetes (AKS)
Deployment Helm
Infrastructure as Code Terraform
Container Registry Azure Container Registry
Monitoring Prometheus
Visualization Grafana
Security Scanning Trivy
Performance Testing k6

๐Ÿ“‚ Repository Structure

aks-devops-project
โ”‚
โ”œโ”€โ”€ app.js
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ azure-pipelines.yml
โ”‚
โ”œโ”€โ”€ helm-chart
โ”‚   โ”œโ”€โ”€ templates
โ”‚   โ”œโ”€โ”€ values.yaml
โ”‚   โ””โ”€โ”€ Chart.yaml
โ”‚
โ”œโ”€โ”€ k8s
โ”‚   โ”œโ”€โ”€ hpa.yaml
โ”‚   โ”œโ”€โ”€ ingress.yaml
โ”‚   โ””โ”€โ”€ secret-provider.yaml
โ”‚
โ”œโ”€โ”€ terraform
โ”‚   โ”œโ”€โ”€ main.tf
โ”‚   โ”œโ”€โ”€ variables.tf
โ”‚   โ””โ”€โ”€ outputs.tf
โ”‚
โ”œโ”€โ”€ docs
โ”‚   โ”œโ”€โ”€ architecture.png
โ”‚   โ””โ”€โ”€ grafana-dashboard.png
โ”‚
โ”œโ”€โ”€ loadtest.js
โ””โ”€โ”€ README.md

โš™๏ธ CI/CD Pipeline

The Azure DevOps pipeline automates the application delivery lifecycle.

Pipeline Stages

  1. Build Docker Image
  2. Run Security Scan using Trivy
  3. Push Image to Azure Container Registry
  4. Deploy to AKS Development Environment
  5. Deploy to AKS Production Environment

Pipeline Flow

Code Commit
   โ”‚
   โ–ผ
Azure DevOps Pipeline
   โ”‚
   โ”œโ”€โ”€ Docker Build
   โ”œโ”€โ”€ Trivy Security Scan
   โ””โ”€โ”€ Push Image to ACR
           โ”‚
           โ–ผ
      Helm Deployment
           โ”‚
           โ–ผ
Azure Kubernetes Service

Pipeline Execution

Below is a successful Azure DevOps pipeline run showing the automated build, security scan, and deployment stages.

Azure DevOps Pipeline

๐Ÿ“ˆ Monitoring and Observability

The platform includes a Kubernetes monitoring stack.

Monitoring Components

Tool Purpose
Prometheus Metrics collection
Grafana Dashboard visualization
Node Exporter Node-level metrics
kube-state-metrics Kubernetes resource metrics

๐Ÿ“Š Monitoring Dashboard

Below is an example Grafana dashboard used to monitor Kubernetes cluster metrics.

Grafana Dashboard

Metrics monitored include:

  • CPU utilization
  • Memory usage
  • Pod health
  • Node performance
  • Kubernetes resource metrics

๐Ÿ”„ Autoscaling

The application supports automatic scaling using Kubernetes Horizontal Pod Autoscaler (HPA).

Example configuration:

minReplicas: 2
maxReplicas: 10
targetCPUUtilizationPercentage: 50

This ensures the system scales dynamically based on workload.


๐Ÿงช Load Testing

Performance testing was conducted using k6.

Example results:

Total Requests: 9600
Requests/sec: ~79
Failures: 0%
Average Latency: ~249ms

This verifies application stability under simulated load.


๐Ÿ— Infrastructure as Code

Infrastructure is provisioned using Terraform.

Terraform provisions:

  • Azure Resource Group
  • Azure Kubernetes Service (AKS)
  • Azure Container Registry
  • Azure Key Vault

Terraform workflow:

terraform init
terraform plan
terraform apply

This allows infrastructure to be recreated consistently.


๐Ÿ” Security

Security practices implemented in this project include:

  • Container vulnerability scanning using Trivy
  • Secrets management with Azure Key Vault
  • TLS certificate automation using cert-manager
  • Security checks integrated into CI/CD pipelines

๐ŸŒ Environment Strategy

Separate Kubernetes namespaces are used for environment isolation.

Environment Namespace
Development dev
Production prod

๐Ÿ›‘ Production Deployment Protection

Production deployments require manual approval gates in Azure DevOps Environments.

Deployment workflow:

Build
 โ†“
Security Scan
 โ†“
Deploy to DEV
 โ†“
Manual Approval
 โ†“
Deploy to PROD

This ensures controlled production releases.


๐Ÿญ Production Readiness

The platform incorporates several practices commonly used in production environments.

CI/CD Automation

  • Automated build and deployment pipelines
  • Image versioning using pipeline build IDs
  • Integrated security scanning

Observability

  • Cluster metrics collection using Prometheus
  • Real-time dashboards using Grafana

Scalability

  • Horizontal Pod Autoscaler for automatic scaling

Reliability

  • Containerized workloads for consistent deployments
  • Kubernetes self-healing capabilities

๐Ÿš€ Running the Application Locally

Build Docker image:

docker build -t aks-devops-app .

Run container:

docker run -p 3000:3000 aks-devops-app

Open application:

http://localhost:3000

๐Ÿ”ฎ Future Improvements

Potential enhancements for this platform:

  • Implement GitOps deployment using ArgoCD
  • Add automated alerting using Prometheus Alertmanager
  • Implement distributed tracing using OpenTelemetry
  • Add service mesh capabilities using Istio

โญ Support

If you find this project useful, consider starring the repository.


๐Ÿ‘จโ€๐Ÿ’ป Author

Pavan Kumar Gummadi

DevOps Engineer | Kubernetes | Azure | Terraform

About

End-to-End DevOps Platform on Azure AKS using Terraform, Azure DevOps CI/CD, Helm, Prometheus, Grafana, Trivy security scanning and production approval gates.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors