Skip to main content

CloudNorth Final Project: Designing a Scalable AWS Infrastructure with Terraform, Jenkins, Docker, K8S, ALB, Blue-Green Deployment and Full Monitoring

Updated 87 min readMarkdown
CloudNorth Final Project: Designing a Scalable AWS Infrastructure with Terraform, Jenkins, Docker, K8S, ALB, Blue-Green Deployment and Full Monitoring

Opening Discussion

Welcome to my CloudNorth Project, This is one of my most detailed project as a Cloud and DevOps Engineer.

In this project, I’m designing, building, and deploying a full, production-grade e-commerce infrastructure, more like a Web E-commerce company called CloudNorth, using AWS as my cloud provider. I chose AWS because it’s the world’s most widely used cloud platform and most companies use it for real-world workloads, which makes this project highly relevant to industry standards.

What This Project Is About

I’m building a complete online store which is an e-commerce website that users can visit, browse products, add items to cart, and check out. But this project is not just about the website and the beauty of the layouts, it is about how that website runs securely without downtime , scales automatically, and stays highly available using real DevOps tools and workflows.

Why This Project Is Industry Grade

This project is not a simple static site, it’s a fully modular, infrastructure-as-code, containerized, CI/CD driven, production-ready setup. It checks all the boxes companies look for when building modern day applications:

i. The whole infrastructure is defined with Terraform, using reusable modules for things like VPC, EC2, ALB, RDS, EKS, S3 and more.

ii. The application (frontend & backend) is containerized with Docker.

iii. It uses Kubernetes (EKS) to orchestrate and run these containers at scale.

iv. We have an Application Load Balancer (ALB) to route traffic and handle incoming user requests smoothly.

v. We’ll plug the ALB into Ingress configurations inside Kubernetes for smart routing.

vi. We’re using Blue-Green to roll out updates with zero downtime and minimal risk.

vii. Jenkins powers the CI/CD pipeline so every code change goes through automated build and deployment.

viii. For monitoring and observability, we are setting up AWS CloudWatch, Prometheus, and Grafana to track metrics, generate alerts, and build clear dashboards that show how the system is running at any moment.

ix. We’re handling secrets and sensitive files with Terraform Cloud + Terraform Cloud Variables for secrets and Jenkins Credentials for pipeline secrets and also .gitignore for local files this is the Best Practice industry standard

Why I Chose AWS

I picked AWS for this project because:

  1. It is more commonly used for DevOps and Cloud Engineer job roles worldwide.

  2. It offers the best documentation and wide community support.

  3. Its services like EKS, ALB, RDS, and IAM are proven at scale.

  4. I’ve already worked with Azure in other smaller projects, so doing this on AWS rounds out my cloud experience.

Why This Project Means So Much To Me

Over the past Years, I’ve built a lot in the cloud , from simple SSH setups to OpenVPN Setups , Terraform, Jenkins pipelines, Docker, Ansible and many more.

This is my chance to put everything together in one real-world simulation, just like companies do it. It’s my proof to myself and to anyone reading, that I can build something big and explain it step by step not just copying codes and pasting them blindly.

How We are Doing this CloudNorth Project. .

We’re building this project in phases:

Phase 1: Provision AWS Infrastructure with Terraform

  1. Write and test your Terraform configs.

  2. Explanation and Modularizing the Infrastructure: Using Reusable Terraform Modules for Scalable Cloud Architecture

  3. Store AWS keys and other secrets in Terraform Cloud Variables (marked Sensitive).

  4. Run terraform init, plan, apply to spin up all resources.

  5. Verify everything in AWS console.

Phase 2: Version Control with Git & GitHub

  1. Initialize Git in your project folder.

  2. Create and link your remote GitHub repo (https://github.com/stillfreddie/cloudnorth-final-project.git).

  3. Push your entire folder structure: Terraform code, modules, .gitignore, README.md.

  4. Keep commits clean: push changes as you work on other phases.

  5. Use branches (main, dev, feature/*) for safe workflow.

  6. Use pull requests for merging feature branches to dev/main to practice clean code reviews.”

Phase 3: Install & Configure Jenkins for CI/CD

  1. SSH into Jenkins EC2 instance.

  2. Install Jenkins, unlock it, install needed plugins.

  3. Bind Jenkins to 0.0.0.0:8081 for remote access.

  4. Create your pipeline job linked to your GitHub repo.

  5. Store secrets in Jenkins Credentials Manager.

  6. We will Include linting and basic unit tests in the Jenkins pipeline for quality checks.

Phase 4: Build & Containerize the Frontend & Backend with Docker

  1. Write Dockerfiles for both backend (Go) and frontend (static or with a simple web server).

  2. Build the Docker images locally on the Jenkins EC2 instance.

  3. Test the images on the EC2 to confirm they run properly.

  4. Build Docker images for frontend and backend via Jenkins pipeline, push to Docker Hub, and deploy to EKS via Helm.

  5. Manually upload frontend assets Folder (images, CSS, JS) to an S3 bucket for use with the application.

Phase 5: Deploy to Kubernetes (EKS)

  1. Use Helm charts or raw YAML to deploy containers to EKS.

  2. Plug the ALB into your cluster using Ingress.yaml for routing.

  3. Verify services, and external access of Webapp.

Phase 6: Implement Blue-Green Deployments

  1. Write separate YAMLs for blue, green Deployments.

  2. Apply them carefully.

  3. Switch traffic between versions with minimal downtime.

  4. Document the switch process step by step.

Phase 7: Monitoring & Observability

  1. Set up AWS CloudWatch for instance and log monitoring.

  2. Deploy Prometheus & Grafana on EKS.

  3. Build basic dashboards to visualize cluster health.

Phase 8: Final Testing, Scaling Checks & Clean Documentation

  1. Perform scale tests for EC2, EKS pods, and ALB.

  2. Test autoscaling with Kubernetes HPA.

  3. Verify the system handles scale smoothly.

  4. We ll Include architecture diagram, Git workflow diagram, and CI/CD flowchart.”

  5. Final tidy up: destroy test workloads if needed.

  6. Final Hashnode write-ups: each phase, step-by-step, Theory Corner, folder structure images, and the closing disclaimer.

Modular Structure

We’re not just writing all resources in one big file so that we don't clamp codes together, instead, I’m using a modular structure. Each module (VPC, EC2, ALB, EKS, RDS, Monitoring) has its own main.tf, variables.tf, and outputs.tf. This makes the setup reusable and clean exactly, like real companies do when managing infrastructure for multiple apps or clients.

I’ll also share an image of my project folder structure below, so you can see how everything is organized, including where to find Terraform modules, Jenkinsfiles, Helm charts, and monitoring configs.

How I am Building This

This is a note for future employers and partners who may want to work with me:

This project is fully mine, every decision, every line of Terraform, every YAML configuration is written by me. I am using AI (ChatGPT) as an assistant to help me generate clean, reusable code, explain tricky parts, and keep me on track. But every command is run, tested, and customized by me, nothing is copied blindly.

Who This Is For

I want this project to be a solid guide for other beginners who want to see how real-world DevOps looks in practice. No shortcuts, no fake screenshots, just real AWS resources, real Jenkins pipelines, real Kubernetes deployments.

When you finish reading this series, you 'll have a clear picture of what it takes to build, deploy, scale, and monitor a modern cloud application, with no secrets left unexplained.

Stick with me.

This is the CloudNorth Project.

This is how we build "industry-grade DevOps step by step."

Prerequisites Corner

To complete this CloudNorth Project from start to finish, you need to have the following tools, accounts, and configurations ready before you begin:

Before Provisioning your AWS Infra via Terraform.

  1. AWS CLI: To interact with AWS resources from your local machine.

  2. Terraform (v1.5+): To provision all infrastructure as code.

  3. kubectl: To manage your Kubernetes (EKS) cluster.

  4. eksctl: Optional, to help configure or update EKS if needed.

  5. Helm (v3+): To deploy Kubernetes charts for the frontend and backend.

  6. Git: For managing and pushing your project code.

  7. SSH Client (e.g., Termius, Git Bash, Linux/Mac terminal): To SSH into your EC2 instances.

  8. IAM User with programmatic access or an EC2 Role with proper permissions for EC2, EKS, S3, IAM, RDS, etc.

  9. Terraform Cloud Account: To store your remote backend state securely (optional but recommended).

  10. SSH Key Pair (.pem and .pub): To access your EC2 servers.

  11. Docker Compose: To test your containers locally before deploying.

  12. Diagram Tool (e.g., draw.io, Lucidchart): To design and share your cloud architecture, Git workflow, and CI/CD flowchart.

  13. Hashnode Account: To write and publish your project documentation.

After EC2 Provisioning

Backend EC2 (Jenkins + CI/CD Host)

  1. Jenkins

  2. Java (for Jenkins)

  3. Docker (to build and run containers)

  4. AWS CLI

  5. kubectl

  6. Helm

  7. Git

  8. unzip (optional, for zip files or Terraform binary)

  9. Go (for building the backend app)

Frontend EC2 (Optional for testing)

  1. Git (optional for pulling project repo)

  2. curl/wget (optional for testing endpoints)

Other Post-Provision Steps

  1. Expose Jenkins on port 8081 by binding it to 0.0.0.0.

  2. Open required ports (8081, 3000, 9090, 9093, etc.) in your EC2 security groups.

  3. Connect Jenkins to your GitHub repo and set up Jenkins Credentials Manager for secrets.

  4. Configure kubeconfig on the Jenkins host to communicate with your EKS cluster.

Important Note

In a real-life production environment, we do not expose applications and services to 0.0.0.0 because it makes them open to the entire internet, which is a security risk.

However, for this project, since we’re simulating a production-grade workflow and need easy remote access for learning and testing, we’ve exposed Jenkins and other services on 0.0.0.0.

This is not an industry security standard, it’s done here purely for educational purposes.

Lets Dive into this Project now.

Phase 1: Provision AWS Infrastructure with Terraform

Step 1: Write and test your Terraform configs

After generating all the Terraform and configuration files according to the folder structure I shared earlier, the next step is to open the project in VS Code. To do this, launch Visual Studio Code, click on: File → Open Folder, Then navigate to the directory where your cloudnorth-final-project folder is located. In my case, it’s sitting in my Downloads folder.

Once the folder is opened, your VS Code should display a structure similar to the image below:

Step 2. Modularizing the Infrastructure: Using Reusable Terraform Modules for Scalable Cloud Architecture

Now we will discuss How the Folders , files and Modules in this project folder works how they connect to each other for a better understanding of what we are doing in this project.

Root-Level Files

i. main.tf : Calls all Terraform modules (VPC, EC2, EKS, SG, RDS, S3, EKS, MONITORING, ALB, etc.) for infrastructure provisioning

ii.. variables.tf: Declares variables passed into modules (e.g., instance type, region etc.)

iii. outputs.tf : Outputs important resource data like VPC ID, ALB DNS, EKS Cluster name abnd so on.

iv. terraform.tfvars: Supplies actual values for the variables (e.g., CIDRs, instance type, AMI ID).

v. .gitignore: Excludes sensitive files like .pem, .tfvars, and keys from Git commits

vi. README.md : Project overview and instructions.

modules/ – Reusable Terraform Components

Each module contains::

i. main.tf : The resource logic

ii: variables.tf : Inputs

iii. outputs.tf: Return values

Modules:

vpc/ : Creates a custom VPC, public/private subnets, and route tables.

ec2/ : Launches EC2 instances (e.g., Frontend EC2, and Backend EC2).

sg/ : Defines Security Groups for EC2, ALB, and EKS

rds/ : Provisions an RDS database

alb/ : Creates an Application Load Balancer with listeners and target groups.

s3/ : Creates an S3 bucket for artifact or log storage.

eks/ : Provisions the EKS cluster, node groups, and IAM roles.

monitoring/ : Sets up CloudWatch alarms or metrics (via cloudwatch.tf).

frontend/

Static website code:

index.html : This is the homepage, typically showcasing featured products or main navigation links

products.html: Displays a list of all products available for users to browse

cart.html: Displays all items the user has added to their shopping cart.

checkout.html : The final step for a purchase; users enter details and confirm their order.

contact.html: Contains a contact form or email links for customer support or inquiries.

about.html: Provides background information about the company or project.

assets/:

css/styles.css : The main stylesheet that controls the look and feel (layout, colors, fonts) of the frontend pages.

js/scripts.js: Handles basic client-side interactivity like toggling views or validating forms.

images/placeholder.png : A default image used as a placeholder for product images or banners.

backend/

This is the Go-based backend server that handles API requests or dynamic logic.

main.go: The main Go application file, defining HTTP routes and logic for handling requests.

Dockerfile: Contains instructions to build a Docker image for the Go backend service.

go.mod: Declares the Go module and its dependencies, required to manage and build the project properly.

jenkins/

Jenkinsfile: Defines the Jenkins pipeline steps such as building, testing, and deploying the backend app automatically via CI/CD.

jenkins-setup.md: A setup guide explaining how Jenkins was installed and configured for the project (e.g., plugins, ports, access).

keys/ and aws_keys/

id_rsa.pub → Public SSH key (used in EC2 key pairs)

id_rsa.pem → Private key (used for SSH into EC2s)

Note: These are added to .gitignore.

helm/ – Helm Charts for Kubernetes

helm/frontend/

Chart.yaml : Metadata file describing the frontend Helm chart (name, version, etc.).

values-blue.yaml: Contains configuration values (like replica count or image tag) for the blue version of the frontend used in blue-green deployments.

values-green.yaml : Similar to the above but for the green version, enabling smooth production switchover.

templates/deployment.yaml: A templated Kubernetes Deployment that uses values from the values files to deploy the frontend pods.

templates/service.yaml :Creates a Kubernetes Service that exposes the frontend deployment to internal or external traffic.

templates/hpa.yaml : Configures Horizontal Pod Autoscaling for the frontend, allowing it to scale based on CPU/memory usage.

templates/ingress.yaml: Manages HTTP routing via Ingress rules, forwarding traffic to the frontend service.

templates/configmap.yaml : Defines configuration settings (like environment variables or app configs) that the frontend pods can use.

helm/backend/

Chart.yaml: Metadata file for the backend Helm chart.

values-blue.yaml: Backend blue deployment configuration (replica count, image version, etc.).

values-green.yaml: Backend green deployment configuration used for safe rollout strategies.

templates/deployment.yaml: Backend Kubernetes Deployment template for spinning up backend pods.

templates/service.yaml :Defines the backend service endpoint used by frontend or other services to connect.

templates/hpa.yaml : Sets up auto-scaling for backend pods based on resource usage metrics.

templates/configmap.yaml: Backend-specific configuration data passed into the pods via ConfigMap.

monitoring/

Prometheus and Grafana manifests:

prometheus/

prometheus-deployment.yaml: Deploys Prometheus

prometheus-configmap.yaml: Scrape configs

grafana/

grafana-deployment.yaml: Deploys Grafana

grafana-datasource-config.yaml: Connects to Prometheus

docs/

tf_cloud_setup.md: Step-by-step for setting up Terraform Cloud backend

deployment_guide.md: Full deployment steps for infrastructure + app

diagrams/

cloud_architecture.drawio: Visual diagram of CloudNorth infrastructure

Step 3: Store AWS Keys and Secrets in Terraform Cloud Variables

Goal: Securely store your AWS credentials and sensitive environment variables in Terraform Cloud so you don’t hardcode them or keep them locally in your .tfvars or main.tf.

How To Store Secrets in Terraform Cloud

Prerequisites:

You must have a Terraform Cloud account

A workspace already created and linked to your project

Here’s how I set it up:

  1. Logged into Terraform Cloud

  2. Selected my workspace: cloudnorth-final-project

  3. Navigated to the Variables tab

Then I added the following:

Environment Variables (for AWS authentication):

  • AWS_ACCESS_KEY_ID → non-sensitive

  • AWS_SECRET_ACCESS_KEY → marked as Sensitive

By doing this, I ensured that no secrets are stored in my codebase, and Terraform Cloud handles everything securely during plan and apply.

Step 4: Run terraform init, plan, and apply to Spin Up All Resources

After finalizing all the Terraform configuration files and modules, the next step was to "initialize Terraform" , preview the infrastructure changes, and apply them to provision all cloud resources.

Firstly i will run the command " terraform init "

This command does the following:

i. Downloads all required provider plugins (in this case, AWS)

ii. Connects to Terraform Cloud (since I’m using remote state)

iii. Prepares the working directory for use

A successful init will show: Terraform has been successfully initialized!

Then next i will run the command to Preview the Infrastructure Plan " terraform plan "

This command shows you what Terraform is about to create without making any actual changes.

I use it to double-check:

Which modules are being triggered

To Catch any error before terraform apply.

What AWS resources will be added/changed/destroyed

That no unintended changes are about to happen

then Clean plans mean I can proceed safely.

To apply the configuration and Provision our Infrastructure on AWS , we ll run “ terraform apply —auto-approve “

with this command i skipped the Terraform prompts: “Do you want to perform these actions?”

Terraform Provisions my infrastructures like VPC, Subnets, and Route Tables, 2 EC2 instances, Deployed the ALB and Security Groups, an Elastic IP , Spun up the EKS Cluster, Set up CloudWatch and other AWS services

Step 5: Verify Everything in AWS Console

Goal:

Double-check that every resource Terraform created is correctly visible and running in your AWS Console.

This step helps confirm that your Infrastructure as Code (IaC) actually matches what’s deployed live on AWS.

Once terraform apply completed successfully, I moved to the AWS Console to visually confirm that all resources were provisioned correctly.

Here’s how I verified everything, step by step:

  1. VPC

Go to: VPC → `Your VPCs

  1. EC2 Instances

Go to: EC2 → Instances

Why 4 EC2 Instances Were Created?

After I ran terraform apply, I noticed that 4 EC2 instances were launched on AWS, even though I only defined two directly (frontend and backend servers).

3rd & 4th EC2 instances EKS Node Group EC2s (Autoscaling Configuration)

The remaining two EC2 instances were not directly defined

They were automatically created by "Amazon EKS Node Group " , which I configured using this block:

" desired_capacity = 2 "

This tells AWS to launch 2 worker nodes (EC2 instances) that will form the Kubernetes cluster’s node pool.

These EC2s are managed by EKS, and Kubernetes pods will be scheduled on them when I deploy containers in later phases.

In conclusion: So even though I wrote Terraform code for just 2 EC2s, the EKS Node Group’s autoscaling logic added 2 more, giving me a total of 4 running EC2 instances.

3. Application Load Balancer (ALB)

Go to: EC2 → Load Balancers

4. S3 Bucket

Go to: S3 → Buckets

5. AutoScaling Group

Go to Instances → Auto Scaling Groups

6. CloudWatch

Go to: CloudWatch → Logs

7. Security Groups

Go to Security Groups to view all the Security Groups that was created for this Cloud North project, A total of 6 SGs were created for this Project.

8. EKS

AWS Services search bar, type “EKS → Elastic Kubernetes Service

9. RDS

In the AWS Services search bar, type “Aurora and RDS →Databases

Theory Corner for Phase 1: AWS Infrastructure Provisioning with Terraform

What We Did in Phase 1:

In this phase, I used Terraform to build and deploy a full production-ready infrastructure stack on AWS, modularly and securely.

Here’s a summary of the major components:

i. Modularized Terraform Code: Created reusable modules for vpc, ec2, alb, sg, rds, s3, eks, and monitoring

ii. Remote State Management: Used Terraform Cloud to store the backend .tfstate file safely and collaborate securely

iii. Secure Secrets Handling: Stored sensitive AWS credentials in Terraform Cloud Variables (marked as Sensitive)

iv: Infrastructure Deployment: Ran terraform init, plan, and apply to spin up live infrastructure on AWS

v. AWS Console Verification: Manually verified all resources, VPC, EC2, ALB, S3, EKS, and RDS to ensure proper deployment

Security Best Practices Followed

i. No hardcoded secrets or keys in code

ii. .tfvars and .pem files are gitignored

iii. Sensitive environment variables are securely stored in Terraform Cloud

iv. Public and private subnets were used for network isolation

Challenges Faced and How I Solved Them

i. EC2 count mismatch (4 instead of 2): Realized 2 came from EKS Node Group autoscaling, this is expected

ii. EKS cluster showing “not active: Waited for node group creation to complete (Terraform is async)

What I Learned

Terraform modules make infrastructure scalable, not messy

Always verify live infra via AWS Console, don’t assume success from Terraform output

EKS automatically creates EC2 worker nodes from the Node Group

Load balancers + security groups can cause silent issues if not properly linked

Remote state and secrets management with Terraform Cloud are non-negotiable for production-level DevOps.

With all infrastructure successfully provisioned and verified, I'm now ready to move to Phase 2, where I'll set up Version Control with Git and GitHub.

Phase 2 Version Control with Git & GitHub

Step 1: Initialize Git in Your Project Folder

We will need to Initialize Git for Version Control , With the entire infrastructure provisioned and verified, the next phase is to set up version control using Git. This allows me to track changes, collaborate effectively, and push my code to GitHub for visibility and deployment automation.

To begin, I initialized Git inside my cloudnorth-final-project folder by running this command "git init "

This created a hidden .git/ folder which allows Git to start tracking all file changes inside the directory

Why This Matters

Initializing Git at this stage sets the foundation for:

  1. Tracking code changes across all phases

  2. Committing each step of my DevOps process

  3. Connecting to GitHub for CI/CD with Jenkins later in this project

  4. Rolling back if something breaks

Git Status Check : After initializing, I confirmed the tracking status with: command “ git status “

This showed all the untracked files (my Terraform code, Jenkinsfile, Helm charts, etc.), which I’ll start committing in the next steps.

Step 2: Create and Link Your Remote GitHub Repository

With Git already initialized in my project folder, the next step was to create a remote repository on GitHub and connect it to my local project. This sets the stage for pushing updates, syncing changes, and triggering CI/CD builds later.

i already created a remote GitHub repo named: (https://github.com/stillfreddie/cloudnorth-final-project.git)

Then to link it to my local Git setup i will run this commands

git remote add origin https://github.com/stillfreddie/cloudnorth-final-project.git

git remote -v

Next thing i will do is stage, commit, and pushed everything to my GitHub Repository called cloudnorth-final-project so i will run this commands.

“ git add . “

git commit -m "Initial commit - Terraform infra and modules"

git branch -M main

git push -u origin main

At this point, all code, Terraform, modules, backend, frontend, Helm, Jenkinsfile, is live on GitHub.

Next thing is head to GitHub GUI and verify the Push . Screenshot Below.

Git Branching & Workflow Strategy

To maintain a clean and professional development process throughout this project, I’ve implemented a Git branching strategy commonly used in real-world DevOps teams:

main: This branch will remain stable and production-ready at all times. Only tested and approved code will be merged here.

dev: Active development takes place in this branch. All new features and phase changes will be pushed here first.

feature/*: For each specific task or module (e.g., EKS setup, Jenkins integration), I will create a dedicated feature branch such as feature/add-eks, feature/setup-monitoring, etc. These will later be merged into dev.

Note: For now, only the dev branch will be created because we are still in Phase 2 (Version Control Setup). Feature branches will come into play as development progresses into module-specific implementations in future phases like backend setup, CI/CD, Helm deployments, and monitoring.

Here’s how I created the dev branch from the command line:

“ git checkout main “

This switches your working directory to the main branch.

Why? We start from main because it’s the default base branch created when you initialize a Git repo. It holds production-ready code, so any new branches (like dev or feature/*) should stem from it.

“ git checkout -b dev “

This creates a new branch named dev and immediately switches to it. Now you’re working inside the dev branch and can start making changes without affecting the main branch.

“ git push -u origin dev “

This pushes the new dev branch to GitHub and sets it as the upstream tracking branch.

This sets the stage for collaborative development, better testing, and safer deployments.

Note on Git Workflow Steps 4 to 6

As development continues across the next phases, the following Git best practices will be applied:

i. Clean, regular commits as changes are made

ii. Feature branching using the dev and feature/* strategy for modular updates

iii. Pull Requests to merge from feature/* into dev, and finally from dev into main after testing

These practices reflect industry-standard Git workflows and will help me simulate a real CI/CD lifecycle as part of this project.

Theory Corner for Phase 2

What We Did in Phase 2:

  • Initialized Git in the root of our project directory

  • Created and linked a remote GitHub repository:
    https://github.com/stillfreddie/cloudnorth-final-project.git

  • Committed our full folder structure including Terraform files, modules, frontend/backend, Helm charts, Jenkinsfile, monitoring configs, and diagrams

  • Set up a .gitignore to exclude sensitive file.

    Why This Matters:

    i. Git is the foundation of modern DevOps workflows. Using version control:

    ii. Keeps our infrastructure-as-code clean and trackable

    iii. Helps teams collaborate safely without overwriting each other’s work

    iv. Enables pull requests, code reviews, and rollbacks

    v. Pushing everything to GitHub makes our work transparent, portable, and ready for CI/CD

    vi. ntegration (which we'll tackle in later phases).

    Git Workflow Strategy:

    We’ve adopted an industry-style branching workflow:

    i. main → stable, production-ready code

    ii. dev → active development

    iii. feature/* → isolated module or phase-level changes (to be created in later phases)

    We’ve already created and pushed the dev branch.

    Feature branches will be created when specific tasks (e.g. monitoring, backend deployment) begin.

Challenges Faced:

  1. git commit was initially slow due to heavy assets like frontend images and diagrams

Fix: We confirmed .gitignore was clean, validated files, and committed correctly

  1. Learned how to properly push a new dev branch with upstream tracking.

What’s Next:

As we move forward:

i. All feature work will happen in feature/* branches

ii. Clean commits and pull requests will be made from feature/* to dev

iii. When fully stable, dev will be merged into main

This version control setup ensures the CloudNorth project remains clean, collaborative, and deployment-ready.

Phase 3 : Install & Configure Jenkins for CI/CD

Step 1 : SSH into Jenkins/Backend EC2 instance.

To begin setting up Jenkins for our CI/CD pipeline, the first task is accessing the EC2 instance where Jenkins will run. We provisioned this EC2 instance earlier via Terraform and tagged it Backend Ec2

SSH Access Steps

  1. Locate the Backend EC2 Instance

Go to your AWS Console → EC2 → Instances → Find the EC2 tagged with Name = cloudnorth-backend-ec2

2. Copy the Public IP Address

You’ll find it under the "Public IPv4 address" column

3. Open Your Terminal i.e Window Power Shell

Use the following SSH command to access the instance: "C:\Users\fred4\Downloads\cloudnorth-final-project\aws_keys\cloudnorth-key.pem"ubuntu@ec2-54-87-242-40.compute-1.amazonaws.com

Step 2: Install Jenkins, unlock it, install needed plugins.

Run the following commands after you have SSH into your EC2 Backend Instance:

Step 1: Update packages

sudo apt update

Step 2: Install Java (Jenkins requires Java to run)

sudo apt install openjdk-17-jdk -y

Step 3: Add Jenkins repository key and source

curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee </mark>

/usr/share/keyrings/jenkins-keyring.asc > /dev/null

echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] </mark>

https://pkg.jenkins.io/debian-stable binary/ | sudo tee </mark>

/etc/apt/sources.list.d/jenkins.list > /dev/null

Step 4: Update again and install Jenkins

sudo apt update

sudo apt install jenkins -y

Step 5: Start and enable Jenkins

sudo systemctl start jenkins

sudo systemctl enable jenkins

sudo systemctl status Jenkins

Step 3: Bind Jenkins to 0.0.0.0:8081 for remote access.

By default, Jenkins binds to localhost:8080. Let’s change that.

We will Open Jenkins systemd config by running this command “ sudo nano /lib/systemd/system/jenkins.service “

Look for this line: Environment="JENKINS_PORT=8080"

Replace with : Environment="JENKINS_PORT=8081"

Environment="JENKINS_LISTEN_ADDRESS=0.0.0.0"

Screenshot Below.

Reload Systemd and Restart Jenkins:

sudo systemctl daemon-reexec

sudo systemctl daemon-reload

sudo systemctl restart jenkins

Confirm Jenkins is listening to port 8081: run command " sudo netstat -tulnp | grep 8081 "

Access Jenkins with http://:<your-ec2-public-ip:8081

Get Initial Admin Password

Run command “ sudo cat /var/lib/jenkins/secrets/initialAdminPassword “

Then create a Login and password , Once done Download the necessary Plugins on Jenkins GUI to complete this Project i.e go, Docker etc.

Step 4: Create Jenkins Pipeline and Link to GitHub (With Secure AWS Credential Setup)

With Jenkins up and running on my Ubuntu EC2 instance (bound to 0.0.0.0:8081), it's time to create a Pipeline job and connect it to my GitHub repository. This will enable automatic builds and deployments as I push updates throughout the CloudNorth project phases.

To avoid hardcoding secrets in the Jenkinsfile, we securely pass them using Jenkins Credentials Manager.

In my case, the Jenkinsfile uses:

environment {

AWS_ACCESS_KEY_ID = credentials('aws-access-key')

AWS_SECRET_ACCESS_KEY = credentials('aws-secret-key')

}

This means we must add two separate secrets in Jenkins as Secret text and secret file

We will Now add AWS Access Key to Jenkins Credentials, Go to your Jenkins UI , Click "Manage Jenkins" Click "Credentials"

Choose the global scope: Jenkins > Global credentials (unrestricted)

This means we must add two separate secrets in Jenkins as Secret text

How to Add AWS Credentials (Secret Text):

From the Jenkins dashboard, go to

Manage Jenkins → Credentials → (Global) → Add Credentials

Credential 1: AWS Access Key ID

Kind: Secret text

Scope: Global ( Jenkins ,nodes,items,all child items etc)

Secret: Your actual AWS_ACCESS_KEY_ID

ID: aws-access-key

Description: AWS access key for Terraform/Docker builds

Credential 2: AWS Secret Access Key

Kind: Secret text

Secret: your actual AWS Secret Access Key

ID: aws-secret-key ← (must match your Jenkinsfile exactly)

Description: AWS Secret Access Key for CloudNorth

Click Create to save

So Your Credentials Should look like this.

This method ensures secrets aren’t hardcoded into Jenkinsfiles or logs, which is a DevOps best practice for security.

Next thing thing on our to-do list is to add our DockerHub Credentials to Jenkins.

We will Create a New Credential for our DockerHub by following this steps.

On Jenkins home, click:

Manage Jenkins → Credentials → (Global) → Add Credentials

Fill the Credential Form

Kind: Username with password

Scope: Global

Username: Your DockerHub username

Password: Your DockerHub account password or access token

ID: dockerhub-creds

(This MUST match what your Jenkinsfile is using — exact match!)

Description: DockerHub login for pushing images

Click Create to Save.

Fixing Docker Permission Denied in Jenkins on Ubuntu EC2

After successfully setting up my Jenkins pipeline and linking it to GitHub, I encountered a classic DevOps error when the build reached the Docker image build stage:

ERROR: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

This error was triggered during the docker build step inside my Jenkins pipeline.

What Caused the Error?

On Ubuntu, only users that belong to the docker group can run Docker commands without using sudo.

However, Jenkins runs under its own user (named jenkins), which by default is not added to the docker group. As a result, when Jenkins tried to build Docker images, it was denied access to the Docker engine.

The Fix: Add Jenkins to the Docker Group

Here’s how I resolved it step-by-step:

i. SSH into the Jenkins Backend EC2 instance (Ubuntu):

ssh -i <your-key.pem> ubuntu@<EC2_PUBLIC_IP>

ii. Add the Jenkins user to the docker group:

sudo usermod -aG docker jenkins

iii. Run Daemon Reload

sudo systemctl daemon-reload

iv. Restart the Jenkins service to apply the new group membership:

sudo systemctl restart jenkins

v. Logout and login back to your Backend EC2 Instance

logout

vi. Verify that Jenkins is now part of the Docker group:

groups jenkins

Now go Back to the Jenkins UI and Click on New item.

Name: cloudnorth-build-pipeline

Select “Pipeline”

Click OK.

Now Scroll to the general Tab

Add a description like: CI/CD pipeline for CloudNorth final DevOps project using Jenkins and GitHub”

Then Pipeline Tab Settings:

Definition: Pipeline script from SCM

SCM: Git

Repository URL: https://github.com/stillfreddie/cloudnorth-final-project.git

Branch Specifier: */main

Script Path: jenkins/Jenkinsfile

Click Save.

Next thing is to Finalize & Trigger Build

On the job screen, click Build Now

Jenkins will:

Pull from your GitHub repo: https://github.com/stillfreddie/cloudnorth-final-project.git

Locate the jenkins/Jenkinsfile

Start running the defined pipeline stages.

Screenshot Below shows Build Successful after 13 Attempts.

Step 5: Store secrets in Jenkins Credentials Manager.

As part of our mission to simulate a secure, production-grade CI/CD pipeline, I implemented secret management using Jenkins Credentials Manager. Instead of hardcoding sensitive values like database credentials or API keys in plaintext YAML files or pipeline scripts, I used Jenkins’ built-in credential store to inject these values safely at runtime.

This step ensures our secrets are never exposed in version control and aligns with DevSecOps best practices

Secrets Used

Here are the secrets I needed for the backend microservice:

DB_USERNAME : Username for the backend database

DB_PASSWORD : Password for the backend database

API_KEY : External service API key

How I Stored the Secrets in Jenkins

i. Logged into Jenkins UI (http://:8081)

ii. Navigated to:

Manage Jenkins → Credentials → (Global) → Add Credentials

Credential 1: DB_USERNAME

Kind: Secret

Scope: Global (Jenkins,nodes,items, all child items etc)

Secret: Actual DB_USERNAME

ID: DB_USERNAME

Description: Database username for backend app

Credential 2: DB_PASSWORD

Kind: Secret text

Scope: Global (Jenkins, nodes, items, all child items etc)

Secret: (your actual DB password)

ID: DB_PASSWORD

Description: Database password for backend app

Credential 3: API_KEY

Kind: Secret text

Scope: Global (Jenkins, nodes, items, all child items etc)

Secret: (your actual API key)

ID: API_KEY

Description: API key for backend app authentication

Final Output looks like this from the Screenshot.

Why This Matters:

  • Secrets are now safely stored and encrypted within Jenkins.

  • They can be injected into build pipelines as environment variables without exposing them in GitHub or logs.

  • This aligns with DevSecOps best practices..

After creating the necessary secrets in the Jenkins Credentials Manager and updating our Jenkinsfile to securely inject them into our pipeline, we pushed these changes to the dev branch on GitHub.

With the updated credentials and Jenkinsfile in place, we then triggered a fresh manual build via the Jenkins UI. This build pulls the latest code, builds and pushes our Docker images, and deploys our Helm charts to the Kubernetes cluster, now fully integrated with the new secrets setup.

This process ensures that everything from secret injection to deployment runs securely and smoothly.

Please Note: Why We Skipped RDS and Docker Compose in the CloudNorth Final Project.

During the planning and execution of the CloudNorth Final Project, our tutor’s brief included infrastructure components like RDS (AWS-managed relational database) and Docker Compose (for local container orchestration). However, as we progressed and aligned our implementation with DevOps best practices and realistic CI/CD goals, we made the intentional decision to exclude these two components.

Here’s a breakdown of why we skipped RDS and Docker Compose, and what we used instead

Why We Skipped RDS (Amazon Relational Database Service)

Although RDS is a great managed database service on AWS, we decided not to implement it in this project because:

1. Project Scope & Simplicity

We wanted to focus on the CI/CD pipeline, Kubernetes deployments, Helm packaging, and monitoring stack.

Adding RDS would introduce extra complexity, like VPC peering, subnet groups, security group whitelisting, and DB initialization scripts, which weren’t core to the CI/CD learning goals.

2. Backend Didn't Require a Real DB

Our backend app was a sample containerized service that didn’t depend on a live database connection for its build or deployment.

Using Kubernetes Secrets to simulate DB credentials (DB_USERNAME, DB_PASSWORD) was enough for our current use case.

3. Cost & Time Constraints

Provisioning and maintaining RDS incurs AWS costs.

We needed to deliver a complete CI/CD and Kubernetes pipeline within the bootcamp timeline.

If this project was going into production or had real data storage needs, RDS would definitely be the preferred solution.

Why We Skipped Docker Compose

Docker Compose is often used for local development, where you want to spin up multiple containers (e.g., frontend, backend, DB) on your laptop or workstation.

In our case, we didn’t use it because:

1. We Went Straight to Kubernetes

Our focus was cloud-native orchestration using Kubernetes + Helm, not local setups.

Helm allowed us to deploy containers as scalable services directly into EKS (or simulated EKS via EC2-hosted K8s), skipping the need for Compose.

2. CI/CD Already Orchestrates Everything

Our Jenkins pipeline handles image building, pushing to Docker Hub, and Helm-based deployment.

No need to run docker-compose up when we already have a full pipeline deploying to Kubernetes.

3. Docker Compose is Optional (Per Tutor's Brief)

The tutor’s outline listed Docker Compose as a local setup option — not mandatory.

Since we were deploying to a real or simulated cluster, Compose would have been redundant.

What We Did Instead

Dockerfiles for each app (frontend + backend)

Jenkins CI/CD pipeline with Docker image build + push

Helm charts for production-style K8s deployments

Jenkins Credentials Manager for secret injection

Prometheus & Grafana for monitoring

Full Kubernetes-based infrastructure for cloud-native simulation.

This decision helped us stay focused, move faster, and align with real-world DevOps practices without over complicating things. We may revisit RDS or Docker Compose in future advanced projects if needed.

Step 6: Linting and Basic Unit Tests in Jenkins Pipeline

What We're Doing

In this step, we’ll update the Jenkinsfile to:

i. Lint our code to catch syntax and formatting issues early.

ii. Run basic unit tests (especially for the backend, assuming it’s a Go app).

Tools We’re Using

i. golangci-lint: For Go code linting

ii. go test: For running unit tests

iii. Jenkins Pipeline

Objective

In this step, we improved code quality and reduced the risk of bugs by introducing:

i. Linting: To enforce clean, consistent Go code

ii. Unit testing: To verify our application logic before deployment

What is Linting and Unit Testing?

Linting: Checks your source code for style and syntax issues before runtime errors happen.

Unit Tests: Small tests written to check individual functions of your codebase.

Jenkinsfile Update (Final Version with Lint & Test)

Here's our updated jenkins/Jenkinsfile:

Step-by-Step Setup

Linting Setup:

We used golangci-lint for our Go backend.

It was installed inside the Jenkins pipeline during the build phase.

Testing Setup:

We ran go test ./... to trigger all unit test files in the backend directory.

This stage fails the pipeline if any test fails, enforcing stability before deployments.

Test Results

Jenkins console logs showed linter passed

All Go unit tests completed without errors

No flaky code shipped to production

Benefits

Higher confidence in the code before deployment

Saves debugging time post-deployment

Makes Jenkins pipeline production-ready

Reminder

“This project was designed and implemented by me using real DevOps workflows. I used AI as an assistant for infrastructure generation and syntax accuracy, but I customized, deployed, and documented everything manually as part of my learning and real-world simulation.”

Next Steps After Updating Jenkinsfile (Lint + Test)

Next Steps After Updating Jenkinsfile (Linting + Unit Tests + Jenkins Fixes)

After setting up linting and basic unit testing in our Jenkins pipeline, we followed these final steps to complete the integration and verify success.

1. Push the Updated Jenkinsfile to GitHub

Inside your cloudnorth-final-project folder in VS Code, ensure you are on the dev branch, then run

git add jenkins/Jenkinsfile

git commit -m "Add linting and unit tests to Jenkins pipeline"

git push origin dev

This pushes your updated pipeline logic (with linting and testing stages) to your GitHub repo.

2. Fix Jenkins PATH (Important)

Initially, our build failed because Jenkins could not find the go command. This is a common issue when Jenkins is installed on a fresh EC2 instance.

To fix it, we added the Go binary path to the Jenkins environment.

We edited the Jenkins default config file:

sudo nano /etc/default/jenkins

And added this line at the bottom: PATH=$PATH:/usr/local/go/bin

We also updated Jenkins to run on a custom port (8081) and made sure it listens on all interfaces:

HTTP_PORT=8081

HTTP_HOST=0.0.0.0

Then we restarted Jenkins:

sudo systemctl daemon-reexec

sudo systemctl restart jenkins

3. Trigger a New Jenkins Build Manually

From your Jenkins dashboard:

Open your cloudnorth-build-pipeline

Click on “Build Now”

Then click on the build number under Build History

Check the Console Output

If everything is configured correctly, the pipeline will:

I. Checkout code from the dev branch

II. Run golangci-lint inside the backend/ folder to check for code quality

III. Run go test ./... to ensure your unit tests pass

IV. Build and push Docker images for frontend & backend

V. Deploy both services using Helm charts (values-blue.yaml for Blue deployment)

When it all passes, you'll see green checkmarks in Jenkins.

What We Learned

  1. Jenkins doesn't inherit system $PATH variables unless explicitly told. We fixed that manually.

  2. Running Go-based linters requires proper installation and executable visibility.

  3. Unit tests give instant feedback during the pipeline.

  4. This step builds developer confidence and enforces clean code automatically.

Theory Corner for Phase 3: Install & Configure Jenkins for CI/CD

In this phase, we turned a fresh EC2 instance into a fully functional Jenkins CI/CD server. Here's what we did and why it matters:

1. SSH Access:

Connected to the Jenkins EC2 via .pem to install and configure everything manually.

2. Port Configuration:

Changed Jenkins default port from 8080 to 8081 in /etc/default/jenkins for better flexibility and external access.

3. Plugin Setup:

Installed key Jenkins plugins like Git, Go, Docker, and Credentials to support our tech stack.

4. Pipeline Project Creation:

We Provisioned Pipeline-as-Code using Jenkinsfile stored in GitHub. This gives us version-controlled automation.

5. Secure Secrets Handling:

Stored AWS and DockerHub credentials in Jenkins’ Credentials Manager — no secrets in code.

6. Linting + Unit Testing:

Added a code quality gate by installing golangci-lint and running Go unit tests in Jenkins before building and deploying.

Result:

Jenkins is now fully set up to automate our Go app’s build, test, and deployment stages, securely and reliably.

Phase 4: Build & Containerize the Frontend & Backend with Docker

Before we dive into Dockerfiles and image builds, it's time to lock in our Git branching strategy, just as outlined by our tutor for this final CloudNorth project.

Why This Matters

In a real-world CI/CD workflow, we never work directly on the main or even dev branches when adding new features. Instead, we create a feature branch dedicated to a single task or phase. This keeps our code clean, trackable, and easier to roll back or review during team collaboration or CI/CD automation.

For this phase, we’re introducing Docker into our project, which is a huge milestone, i believe it deserves its own neatly isolated branch.

Creating the Feature Branch for Dockerization

We’ll call this branch: feature/phase4-dockerization

This branch will be used exclusively to:

i. Write Dockerfiles for both the backend (Go app) and frontend (static web app)

ii. Test and validate Docker builds locally

iii. Push built Docker images to Docker Hub

iv. Prepare for deployment in Kubernetes (in later phases)

Since I'm already in my project folder on VSCODE and currently on the dev branch, all I have to do now is to run the command below to create and switch to the new feature branch:

" git checkout -b feature/phase4-dockerization "

Then to Verify the Branch Switch i will run " git branch "

This confirms that I’ve successfully created and switched to my new feature branch.

What Happens Next?

In the next steps of Phase 4, I’ll:

i. Write and explain the Dockerfile for the Go backend

ii. Do the same for the frontend (served via NGINX )

iii. Test both locally

iv. Push the images to Docker Hub

v. Automate it later with Jenkins

Quick Tip:

If you're collaborating in a team or working in a CI/CD pipeline, using feature/ prefixes helps structure your Git history clearly. This makes Pull Requests, testing, and deployment much easier to manage.

Step 1. Write Dockerfiles for both backend (Go) and frontend (static or with a simple web server).

Inside my backend/ folder, I’ve already created a Dockerfile that builds and packages the Go backend. Here’s what it looks like this from the screenshot.

What This Dockerfile Does

This is a multi-stage Docker build, which is a standard best practice to keep your final image clean and lightweight. Let’s break it down:

Build Stage (Using Golang Image)

FROM golang:1.24.5 as builder: Uses the official up to date Go image to compile the app.

WORKDIR /app: Sets the working directory inside the container.

COPY go.mod ./: Copies go.mod first to take advantage of Docker layer caching for dependencies.

COPY . ./: Copies all other backend files.

RUN go build -o main .: Builds the Go app into a binary named main.

Run Stage (Using Ubuntu Image)

FROM ubuntu:22.04: Uses a fresh, minimal Ubuntu image for running the binary.

COPY --from=builder /app/main . : Copies the compiled Go binary from the first stage.

EXPOSE 8080 : Declares that the container will listen on port 8080.

CMD ["./main"] : Runs the compiled Go binary when the container starts

So Once we have Written the Dockerfile for our Backend, now we will Write the Dockerfile for our Frontend.

Dockerizing the Frontend (Static Website)

Now that the backend is containerized using Go and Ubuntu, it’s time to do the same for the frontend. Since our frontend is a fully static website with HTML, CSS, JS, and images, we’ll use NGINX as the web server.

Frontend Project Structure

Screenshot Below shows what the frontend folder contains:

This is a standard structure for a client-side e-commerce frontend. Now let’s look at the Dockerfile that will serve this using NGINX.

Dockerfile for Frontend (Using NGINX)

frontend/Dockerfile

Explanation

nginx:alpine: A lightweight version of the NGINX web server.

COPY . /usr/share/nginx/html: Moves all your static files — HTML, images, CSS, and JS — into the directory where NGINX looks for content.

EXPOSE 80: Informs Docker and users that this container listens on port 80.

There’s no need for CMD because NGINX runs automatically using its default configuration to serve the contents of /usr/share/nginx/html.

Why Use Docker + NGINX for Static Frontends?

1.Portability: You can run your frontend on any server with Docker installed.

2.Performance: NGINX is one of the fastest web servers out there.

3.Zero config: You don’t need to write any NGINX config for a basic static site, it just works.

Step 2: Build the Docker images locally on the Jenkins EC2 instance

Now that both the frontend and backend Dockerfiles are ready, it’s time to build the Docker images locally on the Jenkins EC2 instance.

This step is all about testing our container builds manually before we automate them with Jenkins in the next phase.

Why Build Locally First?

Before handing things off to Jenkins and Kubernetes, it’s important to make sure:

i. Your Dockerfiles are valid

ii. The builds complete without errors

iii. The images run as expected

We’ll do this manually on the Jenkins EC2 instance, which is acting as our CI server.

Step-by-Step: Building Backend and Frontend Images

1. SSH into the Jenkins EC2 Instance : " ssh -i /path/to/your-key.pem ubuntu@<JENKINS_EC2_PUBLIC_IP> "

Make sure you have Docker installed and running (docker --version to check).

2. Navigate to Your Project Directory : “ cd cloudnorth-final-project “

Assuming you’ve cloned your project repo on the Jenkins EC2 instance.

3. Build the Backend Docker Image:

Add User to Docker Group : " sudo usermod -aG docker $USER "

Then log out and log back in to apply the group change

Run command “ cd cloudnorth-final-project “ then immediately run “ cd backend “

Then Run command to Build " docker build -t stillfreddie/cloudnorth-backend:phase4 . "

This command tells Docker to:

Use the backend/Dockerfile

Compile the Go app

Build a tagged image for the backend API

Once Build is Successful , we will move onto the FrontEnd Dockerfile.

4. Build Frontend Image:

Run Command “ cd ../frontend “ Takes you into the frontend folder

Run “ docker build -t stillfreddie/cloudnorth-frontend:phase4 . “

This uses the frontend/Dockerfile, which packages our static HTML/CSS/JS into a lightweight NGINX container.

Step 3: Test the images on the EC2 to confirm they run properly.

Run Backend: “ docker run -p 8080:8080 stillfreddie/cloudnorth-backend:phase4 “

Verify Backend Is Running: “ docker ps “

Visit: http://<JENKINS_EC2_PUBLIC_IP>:8080

Run Frontend: “ docker run -p 80:80 stillfreddie/cloudnorth-frontend:phase4 “

Verify Frontend Is Running: “ docker ps “

Visit: http://<JENKINS_EC2_PUBLIC_IP>

Note: Make sure your EC2 security group allows inbound access on ports 80 and 8080.

Step 4: Deploy these images directly to Kubernetes (EKS) through your Jenkins pipeline

After successfully building our Docker images for both the frontend and backend, the next crucial step is to prepare them for deployment to Kubernetes (EKS).

But before we proceed, we need to push these updates to the dedicated GitHub branch we created earlier “ feature/phase4-dockerization. “

To do that, run the following Git commands:

git status # Confirm you're on the correct branch and all changes are staged

git add .

git commit -m "Phase 4: Dockerization – Updated backend app, Dockerfile, and Jenkinsfile"

git push origin feature/phase4-dockerization

This step ensures we adhere to our tutor’s Git branching and version control strategy, keeping our project history clean and well-organized

Once we've pushed our latest updates to GitHub, the next crucial step is to prepare our Frontend and Backend Docker builds for deployment to EKS. To do this, we'll push the built images to DockerHub, which acts as our public container registry.

This step simulates a real-world CI/CD workflow where Jenkins is responsible for building the images, while DockerHub stores them for easy pulling and deployment by Kubernetes (EKS).

Prerequisites

Before automating this process in Jenkins, make sure the following are in place:

  1. You have a DockerHub account.

  2. The images are properly tagged (done in Step 3).

3. Jenkins has Docker and the necessary credentials installed and running

4. DockerHub credentials have been securely stored in Jenkins Credentials Manager (already completed earlier).

What We Updated in the Jenkinsfile.

Below are the new sections and improvements I made in the Jenkinsfile to enable this Docker push and prepare for Helm-based deployment:

  1. Code Quality: Linting

    2. Unit Testing

Confirms the backend logic works as expected before we containerize it.

3. Docker Build & Push to DockerHub

This block securely logs into DockerHub using Jenkins credentials and pushes both the frontend and backend images.

4. Helm Deployment to Kubernetes (EKS)

This is where Jenkins automatically deploys the pushed images to your EKS cluster using Helm charts.

5. Helm Chart Structure

Your project now includes the following Helm chart folders:

These charts define the Kubernetes manifests for each service and support Blue-Green deployments

6. Post Build Messaging

Just for polish: keeps your Jenkins output clear on success or failure

Final Outcome of Step 4

I. By the end of this step, Jenkins is now able to:

II. Lint and test your backend Go code

III. Build Docker images for frontend and backend

IV. Push them to DockerHub

V. Deploy them to Kubernetes (EKS) using Helm

All from a single automated CI/CD pipeline!

The next step is to trigger a build in Jenkins to reflect the recent updates made to our Jenkinsfile. To do this, navigate to the Jenkins UI, click on the cloudnorth-build-pipeline, and then select Build Now.

Once you get a green checkmark, the job is complete and your app is live on EKS via LoadBalancer.

Step 5: Manually upload frontend assets folder (images, CSS, JS) to an S3 bucket for use with the application.

In this step, we manually uploaded the assets/ folder (containing frontend CSS, JavaScript, and image files) to an AWS S3 bucket. This allows our static files to be globally accessible and cacheable, while the dynamic frontend is served from Kubernetes. This is a common pattern used in modern web architectures for performance and scalability.

First thing we have to do is to login to AWS Console then in the Search Bar , Search for S3 then lockate your bucket, Terraform Provisioned my bucket and named it " cloudnorth-static-site-bucket " in Region us-east-1 (N. Virginia), click on the bucket.

Upload the Frontend assets/ Folder

The Front end Folder contains Subfolder called assets and inside assets we have images folder, css, js .

Instructions:

  1. Inside the bucket, click “Upload”

  2. Click “Add folder”

Then The Output Should Show like this from the Screenshot .

Next Upload Successful.

Hosting Static Assets on Amazon S3 for Scalable Delivery

In this step, I moved all static image assets (used in index.html and products.html) from my local frontend project to an S3 bucket named: cloudnorth-static-site-bucket

This approach offloads image hosting from Kubernetes and enables global, cacheable, and cost-effective access to product images — a pattern widely adopted in real-world production systems.

Why Host Static Assets on S3?

By default, HTML pages in the frontend reference images using local paths (e.g., assets/product1.jpg). This is fine for development but not scalable or performant in production.

To fix this:

I uploaded the entire assets/ folder to an AWS S3 bucket.

I updated the <img> tags in index.html and products.html to reference the public S3 URLs instead of local paths.

This results in:

i. Faster image load speeds

ii. Reduced load on the Kubernetes frontend pod

iii. Easy cache control and public access

Steps I Took

  1. Locate the assets folder

This folder contained all product images, CSS, and JS used in the frontend.

2. Upload to S3

Logged in to AWS Console → Opened S3 → Navigated to cloudnorth-static-site-bucket → Clicked Upload → from frontend/assets/.

I ensured all uploaded files were publicly accessible via Object URL

3. Verify Image URLs

I clicked on any uploaded image to copy its Object URL, e.g .: https://cloudnorth-static-site-bucket.s3.amazonaws.com/product1.png

I tested a few of them in my browser to make sure they loaded correctly

4. Update HTML References

Inside frontend/index.html and frontend/products.html, I replaced all relative image paths with the full S3 URLs.

For example:

<!-- Before -->

<img src="assets/product1.png" />

<!-- After -->

<img src="https://cloudnorth-static-site-bucket.s3.amazonaws.com/product1.png" />

I repeated this for all 30+ product images across both HTML files.

5. Push to GitHub + Rebuild via Jenkins

After confirming the updates, I:

i. Committed changes to products.html and index.html

ii. Pushed to the feature/phase4-dockerization branch

Then i Manually rebuilt Jenkins pipeline→ Built new frontend Docker image → Pushed to Docker Hub → Redeployed frontend on Kubernetes

Final Result

After deployment, I visited my frontend app URL and confirmed:

  1. All product images now load from S3

2. The HTML structure and styling remained intact

3. Load times improved slightly due to S3 optimization.

Theory Corner for Phase 4 Build & Containerize the Frontend & Backend with Docker

Phase 4 of the CloudNorth Final Project was all about building a full CI/CD pipeline using Jenkins, Docker, and AWS S3, with a goal of making our frontend and backend code production-ready and cloud-scalable. Here’s the breakdown of what each step taught and implemented in theory:

Step 1: Dockerize Backend and Frontend Applications

We wrote clean and optimized Dockerfiles for both the backend Go application and the frontend static site. This allowed us to package both apps into portable, production-ready Docker images.

Step 2: Build Docker Images Locally on Jenkins EC2

Using the Docker CLI on our Jenkins EC2 instance, we built both frontend and backend images locally to verify that the Dockerfiles worked correctly and produced valid images.

Step 3: Run and Test Images Locally on EC2

We manually ran the Docker containers on the Jenkins server to test their functionality. This confirmed that the apps worked as expected before pushing them to Docker Hub or deploying to Kubernetes.

Step 4: Automate Build & Push with Jenkins CI/CD

We configured two Jenkins pipelines — one for frontend and one for backend. These pipelines:

Automatically build the Docker images

Push them to Docker Hub

Then deploy to EKS via Helm when triggered by GitHub webhooks on every push

This setup gave us a full CI/CD pipeline, from code to live Kubernetes deployment.

Step 5: Upload Static Assets to S3 for Global Delivery

We manually uploaded the assets/ folder (containing CSS, JavaScript, and product images) to an AWS S3 bucket named cloudnorth-static-site-bucket.

All HTML files were updated to reference the public S3 URLs, improving load time, global accessibility, and separation of static and dynamic content — a best practice in modern web architecture.

Together, these steps reflect real-world DevOps practices: automation, containerization, and cloud-native architecture.

Final Git Workflow: Merging Phase 4 Code to dev Branch

After completing all tasks for Phase 4 (Dockerization + CI/CD + S3 Static Assets), I wrapped up the workflow by following a clean Git strategy. Here's a breakdown of how I safely merged all working code and infrastructure into the dev branch:

Active Branch:

I was already working on: feature/phase4-dockerization

Step-by-Step Git Flow:

I ran the following commands to ensure a safe and clean merge into dev:

Pull latest updates on the feature branch: git pull origin feature/phase4-dockerization

Switch to dev branch: git checkout dev

Pull latest updates on dev branch (just in case) :git pull origin dev

Merge feature branch into dev : git merge feature/phase4-dockerization

Push merged dev branch to remote: git push origin dev

Why This Matters

Using a dedicated feature branch allowed me to:

i. Safely isolate Phase 4 work without breaking the main development flow.

ii. Collaborate and test without affecting shared environments.

iii. Keep a clean history before starting Phase 5.

Phase 5: Deploy to Kubernetes (EKS)

Following the branching strategy outlined by my tutor (and which we've consistently followed since Phase 4), we’ll begin this new phase by creating a dedicated feature branch. This helps keep our codebase clean, modular, and easy to track across each phase of the CloudNorth project.

For this phase, we’re focusing entirely on Helm-based deployments to EKS, so we'll create a new feature branch and name it: phase5-helm-deployment

This branch will house all the work specific to Helm chart templating, values management, and rolling out our services to Kubernetes using Helm. Once completed, we’ll follow the same process as before:

Merge this feature branch into the dev branch after testing,

Then prepare for final integration into main in Phase 8.

This structured Git workflow ensures that every phase remains isolated, reviewable, and easy to debug, just like it would be in a real-world DevOps team.

So we ll start by running this command to create a new Branch and switch to it : " git checkout -b feature/phase5-helm-deployment "

Then Push the new branch to GitHub : git push -u origin feature/phase5-helm-deployment

Step 1: Use Helm charts to deploy containers to EKS.

Before anything else, connect to the EC2 instance where Helm and kubectl are installed and configured to access your EKS cluster that would be my Backend Ec2 Instance.

“ ssh -i "your-key.pem" ec2-user@your-ec2-public-ip> “

Verify kubectl Context is Pointing to Your EKS Cluster Run the following command to confirm you're connected to the right cluster: " kubectl config current-context "

Then, check if your target namespace cloudnorth-ns exists and has running workloads: " kubectl get all -n cloudnorth-ns "

This output shows that our EKS cluster and namespace are ready Pods are running and everything is good to go.

Next thing is to Navigate to the Helm Backend Folder on our Control Node EC2 Instance.

Run this command : cd ~/cloudnorth-final-project/helm/backend

Once inside the Backend folder run this command to verify folder structure : ls -R , this will show all expected files and folders eg , Chart.yaml , values-blue.yaml, values-green.yaml, templates/ etc.

Next thing we have to do is to Install Backend Blue Deployment via Helm, we run this command : " helm upgrade --install cloudnorth-backend . -f values-blue.yaml -n cloudnorth-ns "

But Before running the command, We made sure to Edit our values-blue.yaml to reflect the following: Set replica count to 2, Set the image tag to phase4.1 , then set Set environment secrets:

Running " helm upgrade --install cloudnorth-backend . -f values-blue.yaml -n cloudnorth-ns " deploys our backend app into the EKS cluster using Helm. It reads the templates (like deployment, service, secrets), fills them with values from values-blue.yaml, and creates a release named backend-blue. This sets up 2 pods, injects our secrets, exposes the service, and makes the app upgradeable via Helm. Quick, reusable, and Kubernetes-native.

Next is Backend Deployment Using values-green.yaml (Green Environment – Blue/Green Strategy)

After successfully deploying our backend-blue release using Helm, it was time to proceed to the green deployment phase. This is part of our Blue/Green deployment strategy, where we maintain two parallel versions of our backend (blue and green) to enable safe upgrades, testing, or traffic switching with zero downtime.

Open and Review values-green.yaml , to open the values-green.yaml file we will run this command : nano values-green.yaml

This file defines how the green version of the backend should behave, including replica count, image tag, environment variables, secret references, and any override values specific to this deployment.

Then run command " helm upgrade --install cloudnorth-backend-green . -f values-green.yaml -n cloudnorth-ns " to deploy the Green Release using Helm.

Deploy the frontend container to EKS using Helm with Blue-Green support

Since we have Already Deployed the Backend Containers using Helm to EKS , we will do same for the frontend containers.

So we will Inspect our Values-gree.yaml , values-blue.yaml deployment.yaml and service.yaml, if every configuration is good to go , then we deploy the Containers to EKS using Helm

We run command to deploy Blue Frontend Release:

" helm upgrade --install frontend-blue . -n cloudnorth-ns -f values-blue.yaml "

Check frontend pods are running :

“ kubectl get pods -n cloudnorth-ns -l app=cloudnorth-frontend “

To check service exposure:

kubectl get svc -n cloudnorth-ns

And confirm ingress:

kubectl get ingress -n cloudnorth-ns

Deploy the Green Frontend Release

Run the following command to deploy the Green version of your frontend application using Helm:

helm upgrade --install frontend-green . -n cloudnorth-ns -f values-green.yaml

If the deployment is successful and you receive a "deployed" confirmation, it means your Green Frontend release has been successfully deployed to EKS via Helm.

Step 2: Plug the ALB into Your Cluster Using Ingress.yaml for Routing

What’s the Goal Here?

Now that we’ve deployed both the frontend and backend containers using Helm, it’s time to expose them to the outside world using an Ingress Controller. The Ingress resource will plug our AWS Application Load Balancer (ALB) into the cluster and route incoming requests to the correct service (frontend/backend)

What We Did:

i. Edited the Helm ingress.yaml file to use ALB-specific annotations and removed the placeholder domain.

ii. Specified ingressClassName: alb so AWS knows to route this through the ALB Controller.

iii. Removed the host: block since we’re not using a custom domain.

iv. Deployed using Helm and verified the Ingress.

then we applied changes with this command : helm upgrade frontend-green . -n cloudnorth-ns

This redeploys the frontend-green release with the updated Ingress configuration.

Install AWS Load Balancer Controller with Helm

For us to successfully plug our ALB using the ingress.yaml routing , we will have to first createan AWS Load balancer controller with helm , so

We ran this command :

helm install aws-load-balancer-controller eks/aws-load-balancer-controller \

-n kube-system \

--set clusterName=cloudnorth-eks-cluster \

--set serviceAccount.create=false \

--set region=us-east-1 \

--set vpcId=vpc-0e5b14be82acaaa50 \

--set serviceAccount.name=aws-load-balancer-controller

Then we confirmed the Controller is Running

Output showed two pods in Running state.

Verify Ingress and Get ALB DNS

We checked if the ALB was provisioned and attached to our ingress:

we ran command : kubectl get ingress -n cloudnorth-ns -w

After a few seconds, the ADDRESS field was populated with the ALB DNS:

Step 3: Verify services, and external access of Webapp

Verify on the Internet

We pasted the URL in the browser, and our frontend web app was live.

Live URL Example: http://k8s-cloudnorthfronten-6414df20f8-401020231.us-east-1.elb.amazonaws.com

Why AWS Load Balancer Controller?

The AWS Load Balancer Controller integrates directly with EKS to manage ALBs as Kubernetes ingress resources. It translates Kubernetes Ingress definitions into real AWS ALBs, handling all the routing, security groups, and DNS behind the scenes. This allows you to expose your Kubernetes workloads publicly with full scalability and native AWS support.

Disclaimer

This project was designed and implemented by me using real DevOps workflows. I used AI as an assistant for infrastructure generation and syntax accuracy, but I customized, deployed, and documented everything manually as part of my learning and real-world simulation.

Theory Corner – Phase 5: Ingress + ALB Controller and Helm Deployment to EKS

Purpose of Phase 5

This phase focused on exposing our Kubernetes-based frontend app to the internet using an Application Load Balancer (ALB) managed natively by Kubernetes.

Why We Installed the AWS Load Balancer Controller

Kubernetes doesn’t create ALBs on its own. To expose services via Ingress, we needed the AWS Load Balancer Controller, which:

i. Automatically creates and manages an ALB based on Ingress resources

ii. Connects the ALB to Kubernetes Services as targets

iii. Handles routing and path rules in sync with Kubernetes configs

This controller bridges AWS infrastructure with Kubernetes-native networking.

Why We Didn’t Use the ALB Provisioned via Terraform

Although earlier in this project we provisioned an ALB earlier with Terraform, it wasn’t usable in this context because:

i. It targets EC2 instances, not Kubernetes Services

ii. It’s static and not aware of Kubernetes changes

iii. Kubernetes Ingress requires a K8s-native ALB, which the controller creates dynamically

So, we let the controller handle ALB creation the Kubernetes way.

Issues we faced :

Issue 1: ALB Controller not visible in kubectl get deployments

Fix: Re-installed Helm chart with correct vpcId, clusterName, and service account

Issue 2: ALB ADDRESS field was blank initially

Fix: Gave it time to provision, then confirmed via kubectl get ingress

Issue 3 : ALB URL not loading on phone

Fix: Likely DNS cache, ISP block, or propagation lag” we confirmed its working via curl and laptop browser.

Final Outcome

1. ALB was provisioned successfully by the controller

2. App was exposed using Ingress with class alb

3. Web app became publicly accessible via the ALB URL

Phase 5 of the CloudNorth project has now been successfully completed. With our web application publicly accessible via an AWS ALB managed by the AWS Load Balancer Controller, we’ve achieved a major milestone.

As part of our structured Git branching strategy, it's time to commit these changes and prepare for the next development phase. We'll now create a new feature branch for Phase 6, which focuses on implementing Blue-Green Deployments. This new branch will be named: " feature/blue-green-deployments "

Git Commands for Branch Creation:

Make sure you're on the dev branch first, and that all changes from Phase 5 have been committed and pushed. Then run:

Make sure you're on the dev branch

git checkout dev

Pull the latest updates

git pull origin dev

Create and switch to the new feature branch for Phase 6

git checkout -b feature/blue-green-deployments

Phase 6 – Blue-Green Deployment in Kubernetes

What is Blue-Green Deployment?

Blue-Green Deployment is a powerful DevOps strategy used in production environments to minimize downtime and reduce risk when releasing new versions of an application.

In a Blue-Green Deployment, there are always two environments running:

Blue Environment: This is the currently running and stable version of your application that users are actively interacting with.

Green Environment: This is a clone of the blue environment but with the updated application version.

The idea is to deploy changes to the green environment and run all necessary tests and validation without affecting users . Once the green version is verified to be working properly, production traffic is switched to the green environment.

If any issues are encountered, you can quickly roll back by directing traffic back to the blue environment, all with zero downtime.

Like i said earlier Zero downtime , is the first attribute of Blue-Green Deployment.

Lets Give Real-Life Example:

Let’s say you run an e-commerce website. You’re preparing to launch a new checkout feature. Instead of replacing your existing version (blue), you deploy the new version (green) to a separate environment.

You test the green version, ensure it works well, and once ready, flip a switch (via DNS, load balancer, or service selector) to send users to the green version.

If errors are reported, you can immediately roll back to the blue version by flipping the switch back again no downtime.

Lets Relate it to How We Did It in CloudNorth Final Project.

In the CloudNorth final project, we implemented Blue-Green Deployment using:

i. Kubernetes Deployments

ii. Kubernetes Services with label selectors

iii. Separate YAML files for blue and green versions

iv. AWS ALB Ingress Controller

v. A single ALB handling both deployments

We focused on the frontend of our web app, creating:

i. values-blue.yaml : runs the existing version of the frontend

ii. values-green.yaml : holds the new version we want to test and promote.

iii. service.yaml : manages traffic direction by selecting which deployment (blue or green) to expose to users

iv. deployment.yaml :

We focused on the frontend of our web app, creating:

  1. values-blue.yaml : points the Ingress to cloudnorth-frontend-blue-svc

2. values-green.yaml : points the Ingress to cloudnorth-frontend-green-svc

We deployed both Blue and Green deployments using these 2 commands :

helm upgrade --install cloudnorth-frontend frontend/ -f frontend/values-green.yaml

helm upgrade --install cloudnorth-frontend frontend/ -f frontend/values-blue.yaml

Traffic Switching Strategy (Using Ingress)

Our Ingress controller handles routing traffic to either green or blue. We used a shared ALB group so both deployments reuse the same AWS Load Balancer.

To check where traffic is currently going:

we ran command " kubectl get ingress cloudnorth-frontend-ingress -n cloudnorth -o yaml "

From the screenshot above, it shows us traffic is routing thru the Frontend Blue Deployment.

And if we need to Switch to Green Deployment by editing the Ingress We run this command :

kubectl edit ingress frontend-blue-ingress -n cloudnorth-ns

Under the Backend block switch from cloudnorth-frontend-blue-svc to cloudnorth-frontend-green-svc

After a few seconds, the ALB will route traffic to the new deployment. zero downtime.

Key Concepts Recap

deployment.yaml:

We used a dynamic Helm-based configuration, not hardcoded values.

Instead of hardcoding names like "blue" or "green", we used placeholders like:

metadata:

name: {{ .Values.deployment.name }}

This means we can switch between blue and green deployments just by passing a different values.yaml file (e.g., values-blue.yaml or values-green.yaml).

The same applies for the image tag, configMap name, replica count, and namespace — all dynamically injected for flexibility and reuse.

service.yaml:

Just like the deployment, the service configuration also uses dynamic values:

name: {{ .Values.service.name }}

namespace: {{ .Release.Namespace }}

spec:

type: {{ .Values.service.type }}

selector:

This ensures the service routes to the correct set of pods (blue or green), without editing the YAML file directly.

We simply update the value file, and Helm takes care of the rest.

Summary:

We didn't hardcode blue/green values inside our YAML files.

We made the deployment and service reusable using dynamic Helm templates, which makes switching between blue and green smooth, clear, and scalable.

Theory Corner – Phase 6: Blue-Green Deployment (EKS + Helm + ALB)

In this phase, we implemented a Blue-Green Deployment strategy using Helm, Kubernetes, and AWS ALB Ingress Controller. The goal was to enable zero-downtime app updates and easy rollback by running two identical frontend environments side by side: blue and green.

What We Did:

Two Helm Releases:

Deployed frontend-blue and frontend-green using separate values.yaml files.

Dynamic Config (No Hardcoding):

Our deployment.yaml and service.yaml used dynamic placeholders like i explained above.

ALB Ingress Group for Traffic Switching:

We used:

alb.ingress.kubernetes.io/group.name: cloudnorth-frontend

to allow both blue and green Ingresses to share one ALB.

Manual Traffic Control:

To switch between blue and green, we simply edited the active Ingress to point to the target service:

service:

name: cloudnorth-frontend-blue-svc or cloudnorth-frontend-green-svc

How We Verified:

we Used:

kubectl describe ingress frontend-blue-ingress -n cloudnorth-ns to see which service (blue or green) the ALB was routing traffic to.

Opened the ALB DNS in a browser to confirm the active deployment.

With this setup, we achieved safe, testable deployments, fast switching, and instant rollback capability, all powered by dynamic Helm templating and Kubernetes best practices.

Now that we’ve completed Phase 6 of this project, the next steps are to:

Commit and push all updated code to GitHub.

Ensure our Jenkins EC2 instance is synced with the latest changes pushed to the feature/blue-green-deployments branch.

Create a new feature branch to begin work on Phase 7.

Phase 7: Monitoring & Observability

In this phase, we’re elevating the CloudNorth platform with Monitoring & Observability by integrating the following tools:

Prometheus – for real-time metrics scraping and alerting across our Kubernetes workloads

Grafana – for beautiful, actionable dashboards to visualize metrics

AWS CloudWatch – for deep infrastructure-level insights, log collection, and alert simulation from our EC2 instances

To maintain clean, professional version control, we’ve followed our locked-in branching strategy and created a new feature branch for this phase:

git checkout dev

git pull origin dev

git checkout -b feature/phase7-monitoring

git push origin feature/phase7-monitoring

This ensures that all monitoring-related files — including Helm charts, ConfigMaps, dashboard configs, and CloudWatch setup scripts — stay isolated in this branch while under development.

Branch Integration for Jenkins Pipeline

To complete Phase 7: Monitoring & Observability, we updated our Jenkins pipeline configuration to pull code directly from the newly created branch: feature/phase7-monitoring

By syncing Jenkins with this dedicated feature branch, we maintain a clean CI/CD workflow, minimize deployment conflicts, and keep all monitoring logic encapsulated within its own pipeline context.

Once all components have been tested and verified, the branch will be merged into dev, and later into main for production rollout.

What We’ll Implement in Phase 7

  1. Prometheus deployed via Helm to collect metrics from our EKS cluster

2. Grafana for visualizing key metrics and dashboards (e.g., CPU, memory, pod health)

3. CloudWatch Agent installed on EC2 instances for OS-level metrics and logs

4. Custom Dashboards and Alerts set up in both Grafana and CloudWatch

5. Clear folder structure: all observability configs stored under /monitoring

This phase bridges DevOps and SRE principles this ensuring that both infrastructure and application health are continuously observable, and any anomaly can be detected early.

Phase 1 : Set up AWS CloudWatch for instance and log monitoring.

To set up AWS cloudwatch for our Backend EC2 running our Infrastructures , we need to set up an IAM role with CloudWatch Permissions:

Go to AWS Console → IAM → Roles → Click Create role

Select Trusted entity type: AWS service

Choose Use Case: EC2

Click Next to permissions

Attach Required Policy:

Search for and select: CloudWatchAgentServerPolicy

Click Next, then give the role a name like: cloudwatch-agent-role CLICK fINISH.

Attach IAM Role to EC2

Go to EC2 Dashboard and Click your Jenkins EC2 instance then Under Actions → Security → Modify IAM Role,

Select the cloudwatch-agent-role you just created, Click Update IAM Role.

Now your EC2 has the right permissions to talk to CloudWatch.

Since we did not configure Terraform in Phase 3 to Create CloudWatch Agent, The next thing we have to do now is to install the CloudWatch Agent on our Backend Ec2 Instance Housing our configurations Manually via CLI .

we ll run this command to install CloudWatch , make sure you elevate to root access first with sudo -i to avoid authentication headaches

Run : " cd /tmp

wget https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb

sudo dpkg -i -E ./amazon-cloudwatch-agent.deb "

Once Installedrun this command to validate the Installation was sucessfull.

“ /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a status “

This Shows installation was sucessful and waiting for configurations.

Now we will Create the CloudWatch Agent Configuration File:

Navigate to the CloudWatch Agent Config Directory by running this command " cd /opt/aws/amazon-cloudwatch-agent/etc/ "

Create the CloudWatch Agent Config File

Now we’ll create the file called amazon-cloudwatch-agent.json , This config collects CPU, memory, and disk metrics, Syslog and Jenkins logs, Sends everything to cloudnorth-app-logs (already created by Terraform) in phase 3

Run this Command in full to create the Agent Config File.

cat > amazon-cloudwatch-agent.json << 'EOF'

{

"agent": {

"metrics_collection_interval": 60,

"logfile": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",

"run_as_user": "root"

},

"metrics": {

"namespace": "CloudNorth/EC2Monitoring",

"append_dimensions": {

"InstanceId": "${aws:InstanceId}",

"InstanceType": "${aws:InstanceType}"

},

"metrics_collected": {

"cpu": {

"measurement": ["cpu_usage_idle", "cpu_usage_user", "cpu_usage_system"],

"metrics_collection_interval": 60,

"totalcpu": true

},

"mem": {

"measurement": ["mem_used_percent"],

"metrics_collection_interval": 60

},

"disk": {

"measurement": ["disk_used_percent"],

"metrics_collection_interval": 60,

"resources": ["*"]

}

}

},

"logs": {

"logs_collected": {

"files": {

"collect_list": [

{

"file_path": "/var/log/syslog",

"log_group_name": "cloudnorth-app-logs",

"log_stream_name": "{instance_id}/syslog",

"timestamp_format": "%b %d %H:%M:%S"

},

{

"file_path": "/var/log/jenkins/jenkins.log",

"log_group_name": "cloudnorth-app-logs",

"log_stream_name": "{instance_id}/jenkins",

"timestamp_format": "%Y-%m-%d %H:%M:%S"

}

]

}

}

}

}

EOF

Once you run that full command , the CloudWatch Agent Config File will be created with no output from the Server, It creates silently , to confirm it was created successfully run this command “ cat amazon-cloudwatch-agent.json “ If the content looks correct, shows it was created successfully.

Apply the CloudWatch Agent Config and Start the Agent.

Now that the config file is created and sitting in /opt/aws/amazon-cloudwatch-agent/etc/, let’s tell the agent to use it and start monitoring.

to Apply the config Still as root , run this command : " /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl \

-a fetch-config \

-m ec2 \

-c [file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json](file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json) \

-s

So now we will confirm the CloudWatch Agent is running fine as expected, run this command “ /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a status “

Verify Logs and Metrics in AWS Console

Now that the CloudWatch Agent is up and running, it’s time to confirm that everything is working by checking:

i. Custom metrics (CPU, memory, disk)

ii. Log ingestion (syslog, Jenkins logs)

Verify Custom EC2 Metrics in CloudWatch

We 'll head to the AWS CloudWatch Console → Metrics → In the left sidebar, click on All metrics, Under Custom namespaces, select:CloudNorth/EC2Monitoring

After clicking CloudNorth/EC2Monitoring, you’ll see 3 main metric categories:

InstanceId, InstanceType, device, fstype, path

InstanceId, InstanceType, cpu – CPU metrics

InstanceId, InstanceType – Memory metrics

Click on anyone of these Metrics you want to View .

Once every of the Metrics are confirmed good to go , Verify Logs and Metrics in AWS Console.

We will confirm CloudWatch Logs Are Flowing In, by checking whether the EC2 log (syslog) are being pushed into CloudWatch.

Go to CloudWatch → Logs → Log groups click on cloudnorth-app-logs under Log streams you will see our i-040c6dd93f9941cba/syslog click on it to view logs for our Backend EC2 instance.

Phase 2 : Deploy Prometheus on EKS.

Before deploying Prometheus, I already had the following in place: EKS cluster fully configured and running, kubectl access configured from my Jenkins EC2 instance and Prometheus YAML files organized in this structure:

cloudnorth-final-project/

└── monitoring/

├── prometheus/

│ ├── prometheus-configmap.yaml

│ ├── prometheus-deployment.yaml

│ └── prometheus-service.yaml

└── grafana/ # (for next step)

The prometheus-configmap.yaml file : This defines how Prometheus scrapes metrics from itself, Kubernetes nodes, and pods, This config ensures Prometheus can discover and scrape metrics from both nodes and pods using native Kubernetes service discovery.

Under the prometheus-deployment.yaml file, We also made sure Prometheus listens on 0.0.0.0:9090 so it can be accessed externally, this is not usuaully an industry standard , but to ease our workflow for this project, we decided to expose prometheus outside our localhost.

The prometheus-service.yaml file: Originally, we planned to use: type: LoadBalancer so AWS would automatically provision an ELB to expose Prometheus via a public DNS. However, we later decided to replace the LoadBalancer with: type: NodePort

This allowed us to manually access Prometheus using the EC2 node’s public IP and NodePort, like so: http://: This simplified the setup while still making the Prometheus UI accessible in the browser.

After that we run this commands " kubectl apply -f prometheus-configmap.yaml

kubectl apply -f prometheus-deployment.yaml

kubectl apply -f prometheus-service.yaml

What this commands does :

kubectl apply -f prometheus-configmap.yaml : Creates a ConfigMap in your Kubernetes cluster., in this case, the ConfigMap contains your prometheus.yml configuration, it tells Prometheus what to scrape, how often, and from where (nodes, pods, itself, etc).

kubectl apply -f prometheus-deployment.yaml: Creates a Deployment in Kubernetes that runs the Prometheus container, It pulls the Prometheus Docker image, mounts the ConfigMap into /etc/prometheus/, and runs the container on port 9090.

kubectl apply -f prometheus-service.yaml: Creates a Service object in Kubernetes that exposes Prometheus., Exposes Prometheus using a NodePort service so you can reach it externally.

Then we will run this command " kubectl get svc cloudnorth-prometheus " To get the actual NodePort and verify exposure.

We then accessed Prometheus from a browser using:

http://:31908

Once the Prometheus UI loaded successfully, we confirmed everything was working.

Step 2.1: Deploy Grafana on EKS

In this step, we deployed Grafana on our EKS cluster to visualize metrics collected by Prometheus. Grafana runs inside Kubernetes, just like Prometheus, and is configured to talk to Prometheus via a service DNS.

Folder Structure:

Inside our monitoring/ directory, we already have a grafana/ subfolder containing the following YAML files:

grafana-datasource-config.yaml — ConfigMap to define Prometheus as a data source

grafana-deployment.yaml — Deployment file to run the Grafana container

grafana-service.yaml — Exposes Grafana using a NodePort (no LoadBalancer used)

We mounted the ConfigMap to /etc/grafana/provisioning/datasources so Grafana boots up with the correct Prometheus config.

Deployment Commands

We applied the files in the following order:

kubectl apply -f grafana-datasource-config.yaml

kubectl apply -f grafana-deployment.yaml

kubectl apply -f grafana-service.yaml

Then verified the pod and service:

kubectl get pods -o wide -l app=cloudnorth-grafana

kubectl get svc cloudnorth-grafana

Accessing Grafana

Since we exposed Grafana using a NodePort on 31909, we accessed the dashboard via: http://:31909

Please note: Before Grafana can be accessed over the internet, you must open port 31909 in the security group attached to the Node EC2 instance in your EKS cluster (the same way we did for Prometheus).

Once the port is open and Grafana is live, visit it in your browser using your EC2 public IP and login with the default credentials:
Username: admin
Password: admin

You’ll be prompted to change the password after your first login.

Step 3: Build basic dashboards to visualize cluster health

Now that Prometheus and Grafana are successfully deployed and accessible externally, the next step is to create insightful dashboards in Grafana to monitor the health of our Kubernetes cluster.

We'll do this in three focused steps:

  1. Verify Prometheus is correctly configured as a data source

2. Import Node Exporter dashboard (for EC2 and pod CPU/memory monitoring)

3. Import Kubernetes Cluster Monitoring dashboards

Step 3.1: Verify Prometheus as the Data Source:

Why this matters: Grafana needs to know where to pull metrics from. Prometheus should be auto-configured via the grafana-datasource-config.yaml, but we must confirm.

Login to your Grafana Dashboaard and On the left sidebar, click Settings" → "Data Sources"

Confirm that you see:

Name: Prometheus

URL: http://prometheus-server.monitoring.svc.cluster.local

Type: Prometheus

Next, we added a new Prometheus data source because the default one is locked and cannot be edited.

For the new data source, we set the URL to:http://44.222.95.194:31908

This points directly to Prometheus via the NodePort exposed on the NODE EC2 instance’s public IP.

After entering the URL, we clicked "Save & Test". Once Grafana successfully connected to Prometheus, we got a confirmation that everything is working — and just like that, we’re good to go!

Step 3.2: Import Node Exporter dashboard (for EC2 and pod CPU/memory monitoring)

Now that Prometheus is set up as a verified data source in Grafana, the next step is to bring our cluster to life with real-time EC2 and pod metrics. We’ll do this by importing the official Node Exporter Full dashboard from Grafana Labs.

Step-by-Step:

  1. Login to Grafana using your Node EC2 public IP and port

2. From the left sidebar, click on Dashboards → + Import

3. In the Import via grafana.com field, paste this dashboard ID: 1860

4. Click Load

5. Under Prometheus data source, select: Prometheus

6**.** Hit Import, and you’ll instantly see your cluster’s health and resource usage visualized on the dashboard, as shown in the screenshot below.

Confirm Prometheus is Scraping Node Exporter Targets

Once you’ve imported the Node Exporter dashboard, the next step is to confirm that Prometheus is actually discovering and scraping metrics from the node exporter pods running inside your Kubernetes cluster.

Here's how to verify this:

  1. Run the following command to see if Prometheus has detected the node exporter job: kubectl get pods -n monitoring -o wide | grep node-exporter

You should see your node exporter pods running and scheduled to your EC2 worker nodes.]

2. Also check that the corresponding Kubernetes service is up and exposing port 9100 run : kubectl get svc -n monitoring | grep node-exporter

Check Prometheus Targets Page

To double-check that Prometheus is successfully scraping metrics from Node Exporter, you can try visiting the Prometheus Targets page : http://:31930/targets

Theory Corner: Phase 7 Monitoring & Observability

In this phase, we brought observability into our Kubernetes cluster using industry-standard tools:

Setup AWS CloudWatch Agent on EC2

I. Installed CloudWatch agent to monitor logs and instance-level metrics like CPU and memory.

II. Installed CloudWatch agent to monitor logs and instance-level metrics like CPU and memory.

III. Used a basic CloudWatch config file for metrics collection.

Deploy Prometheus & Grafana on EKS

Our monitoring/ folder kept all monitoring manifests clean and modular.

Applied raw YAML files for both tools (no Helm used):

prometheus-deployment.yaml

prometheus-service.yaml

prometheus-configmap.yaml

grafana-deployment.yaml

grafana-service.yaml

grafana-datasource-config.yaml

Exposed both apps using Kubernetes NodePort services for browser access.

Add Node Exporter for EC2 Metrics

To get EC2-level insights into Prometheus (like CPU, disk usage, etc.), we added Node Exporter:

Createda new folder inside monitoring which is called node-exporter

Added two files:

node-exporter.yaml → Defines the DaemonSet that deploys one Node Exporter pod per EC2 node

node-exporter-service.yaml → Exposes the DaemonSet internally in the cluster

Confirmed deployment with: kubectl get pods -n monitoring -o wide | grep node-exporter

Configure Prometheus to Scrape Node Exporter

We Edited prometheus-configmap.yaml and added the following scrape_config:

- job_name: 'kubernetes-nodes'

kubernetes_sd_configs:

- role: node

relabel_configs:

- source_labels: [__address__]

regex: '(.*):10250'

replacement: '${1}:9100'

target_label: address

Re-applied the ConfigMap and restarted the Prometheus pod: " kubectl delete pod -n monitoring -l app=prometheus "

Grafana Dashboard

Added Prometheus as a data source in Grafana

Imported Node Exporter Full Dashboard (ID: 1860) from grafana.com

Result: Full EC2 metrics + cluster health shown in real-time dashboards

This monitoring stack gives us multi-layered visibility:

CloudWatch → EC2-level system & logs

Prometheus → Cluster + pod-level metrics

Grafana → Clean visualizations & dashboards for both

To wrap up Phase 7, we’ll version control all updated monitoring files and push the changes to a dedicated feature branch named:
feature/phase7-monitoring

Once confirmed, this branch will be merged into the dev branch, keeping our Git workflow clean and structured.

Phase 8: Final Testing, Scaling Checks & Clean Documentation

For this final phase, we created a dedicated feature branch named feature/phase8-final-scaling-docs, in line with the branching strategy established in Phase 4. This ensures consistency across all development phases and allows us to isolate final testing, scaling checks, and documentation updates in a clean, trackable workflow.

Step 1. Perform scale tests for EC2, EKS pods, and ALB.

Before we wrap up the CloudNorth project, we must prove our infrastructure can scale smoothly under load. This means we’re testing the full scaling chain:

Pods scale up via the Kubernetes Horizontal Pod Autoscaler (HPA)

Nodes scale up automatically when pods can’t fit on existing nodes

ALB continues to route traffic correctly as backend targets change

Why This Step Matters

Scaling tests are not just a checkbox, they’re the proof that your setup is production-ready. Without them, you’re essentially shipping an app without knowing if it will handle real-world demand.

Our Plan for Step 1

We’ll follow this simple flow:

Baseline Check

Confirm our EKS Node Group is configured for autoscaling (min, max, desired capacity)

Confirm HPA exists and is tied to our workload in cloudnorth-ns namespace

Load Simulation

Deploy a CPU stress test pod to simulate heavy workload

Watch HPA scale pods beyond current node capacity

Node Group Scaling

Verify EKS Managed Node Group scales up automatically to host the extra pods

ALB Behavior Check

While scaling is in progress, ensure ALB target health updates dynamically and traffic still flows without downtime.

CLI-Only Testing

We’ll run everything from the terminal, no AWS Console clicks.

Commands we’ll use include:

Check HPA status: “ kubectl get hpa -n cloudnorth-ns “

Baseline HPA Status Check – Before initiating the scaling test, we first inspect all Horizontal Pod Autoscalers (HPAs) in the cloudnorth-ns namespace. This gives us the current CPU usage, target thresholds, and min/max pod limits for each workload. At this stage, our backend HPAs are showing <unknown> CPU metrics (common when idle or when metrics-server hasn’t recently polled data), while the frontend HPA shows a low 1% CPU usage. All HPAs are configured to maintain a minimum of 2 pods and scale up to 5 pods when demand increases.

Next command is Watch pods scaling in real-time: “ kubectl get pods -n cloudnorth-ns -w “

Live Pod Scaling Watch – With the -w (watch) flag, we monitor all pods in the cloudnorth-ns namespace in real time. This view is crucial during a scaling test because it lets us see new pods being created (Pending → Running) or terminated instantly as the Horizontal Pod Autoscaler reacts to load. In this baseline snapshot, most pods are already in the Running state, with a few in Pending as Kubernetes prepares additional capacity.\

Then we run command to Watch nodes scaling: “ kubectl get nodes -w “

Live Node Scaling Monitor Using kubectl get nodes -w, we watch our EKS worker nodes in real time. This view is key during a scaling test, as it shows when the Kubernetes Cluster Autoscaler provisions new EC2 nodes or terminates unused ones. At this moment, our cluster is steady with 2 nodes in Ready state, but during load tests we expect to see new nodes appear here, confirming that infrastructure-level scaling is happening in sync with pod scaling.

Next thing is to Check node group scaling in AWS we will run this command :

aws autoscaling describe-auto-scaling-groups </mark>

--region us-east-1 </mark>

--query "AutoScalingGroups[?contains(AutoScalingGroupName, 'eks-cloudnorth')].[AutoScalingGroupName, DesiredCapacity]"

Checking Node Group Scaling in AWS

While Kubernetes shows us the number of nodes inside the cluster, AWS keeps track of the actual EC2 instances powering those nodes. To confirm scaling at the infrastructure level, we query the Auto Scaling Group that EKS uses.

This screenshot above .confirms that our node group is currently running 2 nodes as per the de.sired capacity. When a scaling event occurs, this number will increase or decrease automatically.

Next is to Check ALB target health, we run command:

aws elbv2 describe-target-health </mark>

--target-group-arn arn:aws:elasticloadbalancing:us-east-1:491085400228:targetgroup/k8s-cloudnor-cloudnor-1a1e8ad06b/74ca84274c70c67e </mark>

--region us-east-1

Checking ALB Target Health

Once we’ve identified the ALB linked to our Kubernetes service, the next step is to verify that its registered targets (pods running behind the ALB) are healthy.
We can use the AWS CLI describe-target-health command with each Target Group ARN to check the status.

In this example above, the ALB target is in the healthy state, which confirms that our ALB is successfully routing traffic to active pod in its Availability Zone.

Step 2. Test autoscaling with Kubernetes HPA.

Horizontal Pod Autoscaling (HPA) in Kubernetes automatically adjusts the number of pod replicas in a deployment based on observed CPU utilization or other select metrics. The goal here is to simulate high load on our application so that the HPA triggers and scales the pods up, then back down when the load is gone.

In this step, we will:

Identify which HPA to test (we’ve chosen cloudnorth-frontend-blue-hpa because it’s already reporting CPU metrics).

Generate continuous traffic to the service it points to (cloudnorth-frontend-blue-svc) to force CPU usage above the threshold defined in the HPA.

Monitor the HPA in real-time to watch it scale the pods up and down.

Why Are We Doing This?

Autoscaling is critical in production to ensure that applications handle sudden spikes in traffic without manual intervention. This test helps confirm that:

The HPA is properly configured.

Metrics from the cluster are flowing to the HPA.

The deployment is able to scale up and down as expected.

Test Plan

Generate Load

We’ll create a one-off BusyBox pod in the same namespace (cloudnorth-ns) that will repeatedly send HTTP requests to the frontend service. This will simulate many concurrent users hitting our app.

Watch the HPA in Action

While the load is running, we’ll monitor the HPA to see if CPU usage rises above the target (50%), and watch the number of replicas increase automatically.

we will run this command “ kubectl get hpa cloudnorth-frontend-blue-hpa -n cloudnorth-ns -w “

Observation:
The HPA shows the CPU utilization of the cloudnorth-frontend-blue-deploy deployment rising from 1% up to around 33% under load. This confirms that HPA is actively monitoring pod CPU usage and can trigger scaling.

Why it didn’t scale up to 50%:

  • The load generator we used (busybox loop with wget) produces only minimal CPU demand.

  • HPA scales pods based on CPU thresholds, and since the load is light, the CPU never reached the configured 50% target.

  • In a real-world scenario, higher traffic or a more CPU-intensive workload would trigger the HPA to scale pods fully.

Key takeaway:
Even though the CPU didn’t hit 50%, the autoscaling mechanism is correctly configured and actively monitoring metrics. The node group scaling (adjusted in AWS EKS) also works, ensuring the cluster can handle more pods if needed.

Step 3: Verify the system handles scale smoothly

In a typical HPA workflow, this step confirms that:

  1. Pods are added or removed automatically in response to CPU or memory metrics.

  2. Services remain available without downtime.

  3. New pods are correctly registered with the load balancer and start serving traffic immediately.

Why we couldn’t fully perform this step:

  1. The load generator used in our tests produced minimal CPU usage.

  2. The Horizontal Pod Autoscaler never reached its scaling threshold (50% CPU).

  3. As a result, no new pods were created, and the system remained at its baseline pod count.

Real-Life DevOps Practice: Git Feature Branching & Keeping Jenkins EC2 in Sync (Phase 4–8)

In my CloudNorth final DevOps project, I followed a structured, real-life Git workflow that mirrors how teams operate in production environments. As the project progressed from Phase 4 to Phase 8, I implemented a clean and consistent branching strategy, paired with tight synchronization between GitHub and my Jenkins EC2 instance.

Here’s a breakdown of the full process and why it’s important.

Branching Strategy: Phase-Based Feature Branches:

Each major phase of the project had its own dedicated feature branch, following this pattern:

feature/phase4-dockerization

feature/phase5-helm-deployment

feature/blue-green-deployments

feature/phase7-monitoring

feature/phase8-final-scaling-docs

Why feature branches?

i. Isolate changes per phase

ii. Avoid breaking the dev or main branches

iii. Allow better testing and review before merging

Once a phase was complete and all tests passed, we merged the feature branch into dev, and later from dev into main in the final phase, Keeping Jenkins EC2 in Sync with GitHub

Here’s the key part:

Every time we finished a phase and pushed updates to GitHub, we made sure to sync the Jenkins Control EC2 instance with the latest code.

How?

Whenever we moved to a new phase, we did the following on the Jenkins Control Host EC2 instance:

git checkout feature/(whatever current Phase we are in)

git pull origin feature/(whatever current Phase we are in)

This ensured our JENKINS EC2 was always referencing the most up-to-date version of the project, ready for deployments or tests.

Why This Matters (Real-World DevOps)

In production DevOps environments, syncing your CI/CD server (e.g. Jenkins, GitHub Actions, GitLab CI) with your Git repository is non-negotiable.

If your Jenkins server runs outdated code:

  1. You risk deploying the wrong version

  2. Tests might pass or fail incorrectly

  3. It breaks the trust in your automation pipeline

That’s why we pull from GitHub after every phase:

  1. Keeps Jenkins aligned with your latest work

  2. Enables clean deployments from CI/CD pipelines

  3. Mirrors how real engineering teams deliver software in the industry

Wrapping Up

This structure—phase-based branching, clean merges, and syncing Jenkins with GitHub—is a true reflection of how DevOps works in production.

By following this disciplined approach, I was able to:

i. Keep my Jenkins EC2 in perfect sync with my repo

ii. Build clean CI/CD pipelines per phase

iii. Maintain a high-quality deployment flow from start to finish

iv. This is the DevOps life. Clean, predictable, and production-ready.

Finalizing Git Version Control for CloudNorth Project

As we wrap up Phase 8 of the CloudNorth project, it’s critical to ensure all our work is safely stored in Git before tearing down the infrastructure. This preserves our project history and allows us to showcase the final version without losing any progress.

Step 1: Merge Feature Branch into dev

All active development should first be consolidated in the dev branch. our feature branch for Phase 8 is feature/phase8-final-scaling-docs

Switch to dev branch

git checkout dev

Ensure dev is up-to-date

git pull origin dev

Merge the feature branch

git merge feature/phase8-autoscaling

Push merged dev to remote

git push origin dev

Step 2: Merge dev into main

Once dev is stable and reviewed, we consolidate all development into main:

Switch to main branch

git checkout main

Pull latest changes

git pull origin main

Merge dev into main

git merge dev

Push main to remote

git push origin main

Now main contains a complete and final snapshot of the project, ready for deployment or archival.

Key Takeaways

Consolidating feature branches into dev ensures active work is preserved.

Merging dev into main creates a stable, production-ready branch.

After this, we can confidently run terraform destroy to remove all test infrastructure without fear of losing our code.

With Git fully finalized, our CloudNorth project is documented, versioned, and ready for archiving, sharing, or showcasing.

Conclusion

The CloudNorth project has been an immersive, end-to-end exploration of modern DevOps practices and cloud-native engineering. Each phase built on the previous, allowing us to progressively construct a robust, scalable, and observable system.

Phase 1: Provision AWS Infrastructure with Terraform

We began by defining and deploying the foundational cloud infrastructure using Terraform. This ensured that all resources—EC2 instances, VPCs, subnets, and IAM roles—were provisioned in a consistent, repeatable, and version-controlled manner.

Phase 2: Version Control with Git & GitHub

Next, we implemented disciplined version control workflows using Git and GitHub. Feature branches, pull requests, and merges were used to maintain code integrity, enforce collaboration best practices, and provide a clear audit trail of all changes.

Phase 3: Install & Configure Jenkins for CI/CD

Jenkins was installed and configured as our CI/CD engine. Pipelines were designed to automatically build, test, and deploy code changes, ensuring that every commit was validated and production-ready without manual intervention.

Phase 4: Build & Containerize the Frontend & Backend with Docker

With Docker, we containerized both frontend and backend applications, creating isolated, reproducible environments. This step allowed for seamless deployment across local, staging, and production environments while eliminating dependency conflicts.

Phase 5: Deploy to Kubernetes (EKS)

The containerized applications were deployed to AWS EKS using Kubernetes. Helm charts simplified management and versioning of the deployments, while ClusterIP and Load Balancer services provided internal and external access.

Phase 6: Implement Blue-Green Deployments

To ensure zero-downtime releases, blue-green deployment strategies were implemented. This allowed us to safely validate new versions while minimizing risk, giving confidence in production rollouts.

Phase 7: Monitoring & Observability

We integrated monitoring solutions, including Prometheus and Grafana, to provide real-time metrics and dashboards. Horizontal Pod Autoscalers and AWS node scaling were configured to maintain responsiveness and ensure the cluster could dynamically adjust to load.

Phase 8: Final Testing, Scaling Checks & Clean Documentation

In the final phase, we tested system behavior under simulated load, observed pod scaling with HPA, and verified cluster responsiveness. Despite limitations in synthetic load, we confirmed autoscaling mechanisms and node group configurations were functioning. Temporary test workloads were cleaned up, and final documentation, architecture diagrams, and CI/CD flowcharts were consolidated.

Key Takeaway:

Across all eight phases, CloudNorth exemplifies modern DevOps best practices: infrastructure as code, automated CI/CD, containerization, orchestration, resilient deployment strategies, observability, and version-controlled documentation. The project demonstrates a complete, real-world DevOps lifecycle from infrastructure provisioning to final testing and cleanup.

With this workflow, I, Tech Bro, officially sign out of the CloudNorth Final Project in style and with full flexibility. Thank you all for taking the time to follow my blog, this remains one of my finest production-grade projects to date.

Signature Motto:

“I push code, I scale clouds, and I eat Amala.”

About the author

  • I’m a Cloud and DevOps Engineer who loves building scalable infrastructure and automating deployments. My journey began a few years ago. Since then, I have completed several hands-on projects using AWS, Azure, Terraform, Jenkins, Ansible, Kubernetes, and various monitoring tools. I share what I learn to track progress, motivate other learners, and showcase practical DevOps workflows that reflect real-world situations. My long-term goal is to create cloud solutions that are reliable, cost-effective, and easy to scale. When I’m not coding or working on cloud projects, I spend my time learning, writing, and connecting with fellow tech enthusiasts.

A lot of effort was put into this. Great job.

1

Thanks very much Karimot, appreciate

More from this blog