Skip to content

Okemwag/DevOps101

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DevOps Assessment Solution

This repository contains a complete solution for the DevOps Assessment, provisioning a scalable, secure infrastructure on DigitalOcean using Terraform, Ansible, and GitHub Actions CI/CD pipeline.

Architecture Overview

                                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                    β”‚    GitHub Actions     β”‚
                                    β”‚    CI/CD Orchestrator β”‚
                                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚                       β”‚              β”‚                    β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚            β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Terraform State     β”‚  β”‚  Blue-Green        β”‚   β”‚            β”‚ DigitalOcean    β”‚
    β”‚  (DO Spaces)         β”‚  β”‚  Deployment        β”‚   β”‚            β”‚ API             β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚            β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚                       β”‚             β”‚                    β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”               β”‚             β”‚                    β”‚
β”‚                        β”‚               β”‚             β”‚                    β”‚
β”‚   HashiCorp Vault      β”‚ β—„β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚                    β”‚
β”‚   Secrets Management   │◄─────────────────────────────────────────────┐  β”‚
β”‚                        β”‚                            β”‚                 β”‚  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                            β”‚                 β”‚  β”‚
          β”‚                                           β”‚                 β”‚  β”‚
          β”‚                                           β”‚                 β”‚  β”‚
          β”‚     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚                 β”‚  β”‚
          β”‚     β”‚                                   β”‚ β”‚                 β”‚  β”‚
          └────▢│  Monitoring Stack                 β”‚ β”‚                 β”‚  β”‚
                β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚ β”‚                 β”‚  β”‚
                β”‚  β”‚ Prometheus                β”‚    β”‚ β”‚                 β”‚  β”‚
                β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚ β”‚                 β”‚  β”‚
                β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚ β”‚                 β”‚  β”‚
                β”‚  β”‚ Grafana                   β”‚    β”‚ β”‚                 β”‚  β”‚
                β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚ β”‚                 β”‚  β”‚
                β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚ β”‚                 β”‚  β”‚
                β”‚  β”‚ Uptime-Kuma               β”‚    β”‚ β”‚                 β”‚  β”‚
                β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚ β”‚                 β”‚  β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚                   β”‚  β”‚
                               β”‚                    β”‚                   β”‚  β”‚
                               β”‚                    β–Ό                 β”‚  β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                                                                           β”‚
β”‚                                 DigitalOcean Infrastructure                               β”‚
β”‚                                                                                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                β”‚
β”‚  β”‚     Droplet #1      β”‚  β”‚     Droplet #2      β”‚  β”‚     Droplet #3      β”‚                β”‚
β”‚  β”‚                     β”‚  β”‚                     β”‚  β”‚                     β”‚                β”‚
β”‚  β”‚ - Apache Proxy      β”‚  β”‚ - Apache Proxy      β”‚  β”‚ - Apache Proxy      β”‚                β”‚
β”‚  β”‚ - Laravel           β”‚  β”‚ - Laravel           β”‚  β”‚ - Laravel           β”‚β—€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚  β”‚ - Node.js #1        β”‚  β”‚ - Node.js #1        β”‚  β”‚ - Node.js #1        β”‚
β”‚  β”‚ - Node.js #2        β”‚  β”‚ - Node.js #2        β”‚  β”‚ - Node.js #2        β”‚
β”‚  β”‚ - Docker Runtime    β”‚  β”‚ - Docker Runtime    β”‚  β”‚ - Docker Runtime    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚                                                                                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚     Droplet #4      β”‚  β”‚     Droplet #5      β”‚  β”‚       Kubernetes Cluster (DOKS)   β”‚  β”‚
β”‚  β”‚                     β”‚  β”‚                     β”‚  β”‚                                   β”‚  β”‚
β”‚  β”‚ - Apache Proxy      β”‚  β”‚ - Apache Proxy      β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚  β”‚
β”‚  β”‚ - Laravel           β”‚  β”‚ - Laravel           β”‚  β”‚  β”‚ Laravel Helm Charts         β”‚  β”‚  β”‚
β”‚  β”‚ - Node.js #1        β”‚  β”‚ - Node.js #1        β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  β”‚
β”‚  β”‚ - Node.js #2        β”‚  β”‚ - Node.js #2        β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚  β”‚
β”‚  β”‚ - Docker Runtime    β”‚  β”‚ - Docker Runtime    β”‚  β”‚  β”‚ Node.js #1 Helm Charts      β”‚  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  β”‚
β”‚                                                    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚  β”‚ Node.js #2 Helm Charts      β”‚  β”‚  β”‚
β”‚  β”‚          Managed PostgreSQL Cluster        β”‚    β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  β”‚
β”‚  β”‚          High Availability Database        β”‚    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚  β”‚ Ingress Controller          β”‚  β”‚  β”‚
β”‚                                                    β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  β”‚
β”‚                                                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                                                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Solution Components

1. Infrastructure as Code (Terraform)

  • 5 DigitalOcean droplets (Ubuntu 22.04+)
  • Managed PostgreSQL database with high availability
  • DigitalOcean Kubernetes Cluster (DOKS) for bonus tasks
  • DigitalOcean Spaces for Terraform state storage
  • SSH key management and security groups configuration

2. Configuration Management (Ansible)

  • Server setup for each droplet:
    • PHP 8.2+ with Composer
    • Node.js 18+
    • Apache as reverse proxy
    • Docker runtime
    • SSL certificates via Let's Encrypt
  • Application deployment:
    • 1 Laravel application per droplet
    • 2 Node.js applications per droplet

3. CI/CD Pipeline (GitHub Actions)

  • Testing of Laravel and Node.js applications
  • Code scanning with:
    • SonarCloud for quality analysis
    • Snyk for vulnerability detection
    • GitHub CodeQL for security analysis
  • Infrastructure provisioning via Terraform
  • Configuration application via Ansible
  • Blue-Green deployment for zero downtime updates

4. Secrets Management (HashiCorp Vault)

  • Centralized secrets storage outside of the GitHub repository
  • Dynamic credentials for database access
  • Integration with CI/CD pipeline
  • Secure access for applications and services

5. Bonus Tasks

  • Docker containerization of all applications
  • Kubernetes orchestration via DigitalOcean Kubernetes Service
  • Comprehensive monitoring with:
    • Prometheus for metrics collection
    • Grafana for visualization and alerting
    • Uptime-Kuma for status monitoring

Getting Started

Prerequisites

Setup Steps

  1. Configure HashiCorp Vault for Secrets Management:

    # Initialize Vault
    vault operator init
    
    # Unseal Vault (you'll need the unseal keys from the init step)
    vault operator unseal <unseal-key-1>
    vault operator unseal <unseal-key-2>
    vault operator unseal <unseal-key-3>
    
    # Login to Vault
    vault login
    
    # Enable secrets engines
    vault secrets enable -path=digitalocean kv
    vault secrets enable -path=database kv
    vault secrets enable -path=certificates kv
    
    # Store DigitalOcean API token
    vault kv put digitalocean/api token=your_do_api_token
    
    # Store database credentials
    vault kv put database/postgres \
      username=dbuser \
      password=securepassword \
      host=db-postgresql-nyc3-12345.db.digitalocean.com \
      port=25060 \
      dbname=defaultdb
    
    # Create policies for access control
    vault policy write terraform terraform-policy.hcl
    vault policy write github-actions github-actions-policy.hcl
    vault policy write applications applications-policy.hcl
  2. Configure GitHub Repository:

    Add the following secrets to your GitHub repository:

    • VAULT_ADDR: URL of your Vault instance
    • VAULT_TOKEN: Token with appropriate permissions to read secrets
    • TERRAFORM_CLOUD_TOKEN: If using Terraform Cloud (optional)
  3. Deploy Infrastructure using Terraform:

    # Initialize Terraform
    cd terraform
    terraform init -backend-config="access_key=DO_SPACES_KEY" -backend-config="secret_key=DO_SPACES_SECRET"
    
    # Plan infrastructure changes
    terraform plan -var-file="terraform.tfvars"
    
    # Apply infrastructure changes
    terraform apply -var-file="terraform.tfvars"
  4. Configure Servers with Ansible:

    # Update inventory with Terraform outputs
    cd ansible
    
    # Run Ansible playbook
    ansible-playbook -i inventory.yml playbooks/main.yml
  5. Trigger CI/CD Pipeline:

    # Push code to GitHub to trigger the workflow
    git add .
    git commit -m "Initial deployment"
    git push origin main

Accessing Applications

Once deployed, the applications can be accessed at:

  • Laravel Application: https://api.okemwag.com
  • Node.js App 1: https://app1.okemwag.com
  • Node.js App 2: https://app2.okemwag.com
  • Grafana Dashboard: https://monitoring.okemwag.com
  • Prometheus: https://metrics.okemwag.com
  • Uptime-Kuma: https://status.okemwag.com

Blue-Green Deployment Strategy

This solution implements a blue-green deployment strategy to ensure zero downtime during updates:

How It Works

  1. Initial State:

    • All traffic is directed to the "blue" environment (original version)
    • The "green" environment is inactive or doesn't exist yet
  2. Deployment Process:

                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                       β”‚   Ingress     β”‚
                       β”‚   Controller  β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β”‚
                               β–Ό
                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                       β”‚    Service    β”‚
                       β”‚  (selector)   β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                  β”‚                         β”‚
                  β–Ό                         β–Ό
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚      Blue       │◄──────      Green      β”‚
         β”‚   Deployment    β”‚      β”‚   Deployment    β”‚
         β”‚   (active)      β”‚      β”‚   (staging)     β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
  3. Deployment Steps:

    • The new version is deployed to the "green" environment
    • Automated tests are run against the green environment
    • Once tests pass, traffic is gradually shifted from blue to green
    • When all traffic is on green, blue becomes inactive
  4. Rollback Process:

    • If issues are detected, traffic can be immediately shifted back to blue
    • The problematic green deployment can be debugged without affecting users
  5. Next Deployment Cycle:

    • The roles are reversed, with green becoming the active environment
    • The next update is deployed to blue (which is now the staging environment)

Implementation

The blue-green deployment is implemented through:

  • Apache Virtual Hosts: Using mod_proxy to route traffic between environments
  • Docker Containers: Using tagged images for versioning
  • Kubernetes (Bonus): Using service selectors to direct traffic between deployments

Secrets Management Flow

The solution uses HashiCorp Vault for secure secrets management, avoiding the use of GitHub Secrets for sensitive information:

  1. Secret Storage:

    • All secrets (API tokens, credentials, certificates) are stored in Vault
    • Secrets are organized by type and environment (dev, staging, prod)
  2. Secret Access:

    • The CI/CD pipeline authenticates to Vault using a dedicated token
    • Applications access secrets using AppRole authentication
  3. Secret Flow:

    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚                β”‚      β”‚               β”‚      β”‚               β”‚
    β”‚ HashiCorp Vaultβ”œβ”€β”€β”€β”€β”€β–Ίβ”‚ GitHub Actionsβ”œβ”€β”€β”€β”€β”€β–Ίβ”‚ Terraform     β”‚
    β”‚                β”‚      β”‚               β”‚      β”‚               β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚                                             β”‚
            β”‚                                             β”‚
            β”‚                                             β–Ό
            β”‚                                      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚                                      β”‚               β”‚
            └──────────────────────────────────────► Applications  β”‚
                                                   β”‚               β”‚
                                                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
  4. Secret Rotation:

    • Database credentials can be rotated automatically
    • API tokens and other secrets can be rotated manually with minimal downtime

Project Structure

devops-assessment/
β”œβ”€β”€ terraform/
β”‚   β”œβ”€β”€ main.tf
β”‚   β”œβ”€β”€ variables.tf
β”‚   β”œβ”€β”€ outputs.tf
β”‚   β”œβ”€β”€ providers.tf
β”‚   β”œβ”€β”€ modules/
β”‚   β”‚   β”œβ”€β”€ droplets/
β”‚   β”‚   β”œβ”€β”€ database/
β”‚   β”‚   β”œβ”€β”€ kubernetes/
β”‚   β”‚   └── monitoring/
β”‚   └── terraform.tfvars.example
β”œβ”€β”€ ansible/
β”‚   β”œβ”€β”€ inventory.yml
β”‚   β”œβ”€β”€ playbooks/
β”‚   β”‚   β”œβ”€β”€ main.yml
β”‚   β”‚   β”œβ”€β”€ prerequisites.yml
β”‚   β”‚   β”œβ”€β”€ docker.yml
β”‚   β”‚   β”œβ”€β”€ apache.yml
β”‚   β”‚   β”œβ”€β”€ certbot.yml
β”‚   β”‚   β”œβ”€β”€ apps.yml
β”‚   β”‚   └── monitoring.yml
β”‚   β”œβ”€β”€ roles/
β”‚   β”‚   β”œβ”€β”€ common/
β”‚   β”‚   β”œβ”€β”€ docker/
β”‚   β”‚   β”œβ”€β”€ apache/
β”‚   β”‚   β”œβ”€β”€ certbot/
β”‚   β”‚   β”œβ”€β”€ laravel/
β”‚   β”‚   β”œβ”€β”€ nodejs/
β”‚   β”‚   └── monitoring/
β”‚   └── templates/
β”‚       β”œβ”€β”€ apache/
β”‚       β”œβ”€β”€ docker-compose/
β”‚       └── monitoring/
β”œβ”€β”€ kubernetes/
β”‚   β”œβ”€β”€ manifests/
β”‚   β”‚   β”œβ”€β”€ laravel/
β”‚   β”‚   β”œβ”€β”€ nodejs/
β”‚   β”‚   └── ingress/
β”‚   └── helm/
β”‚       β”œβ”€β”€ laravel-app/
β”‚       └── nodejs-app/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ laravel-app/
β”‚   β”‚   └── [Laravel application code]
β”‚   └── nodejs-app/
β”‚       └── [Node.js application code]
β”œβ”€β”€ vault/
β”‚   β”œβ”€β”€ config/
β”‚   └── policies/
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       β”œβ”€β”€ ci.yml
β”‚       β”œβ”€β”€ provisioning.yml
β”‚       β”œβ”€β”€ laravel-deploy.yml
β”‚       └── nodejs-deploy.yml
└── README.md

Future Improvements

  • Implement autoscaling for applications based on metrics
  • Add network policies for enhanced security
  • Set up distributed tracing with Jaeger
  • Implement GitOps with ArgoCD or Flux
  • Add disaster recovery procedures and regular backup testing

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Devops project demostrating how to create an end to end CI/CD, Provisioning and Monitoring

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published