CosmicLoad is a cloud infrastructure project designed to explore and implement π Google Cloud Platform's (GCP) Global Load Balancer. This project demonstrates how to effectively distribute user requests across multiple regions and availability zones, ensuring:
- β High Availability
- π Fault Tolerance
- β‘οΈ Minimal Latency
by leveraging Google's global infrastructure.
- Global Load Balancing π: Distributes traffic between two regions (US Central & Asia Southeast).
- Instance Templates π₯οΈ: Built with Ubuntu OS.
- Instance Groups π οΈ:
- us-central (Iowa): Includes 4 availability zones.
- asia-southeast1 (Singapore): Includes 3 availability zones.
- Cloud Armour π‘οΈ: Blocks requests originating from India to improve security and control access.(Due to free-account gcp restricts cloud-armour quota)
- Auto Scaling π: Dynamically scales instances based on CPU utilization:
- us-central: Min 4 instances, max 8 instances.
- asia-southeast1: Min 3 instances, max 6 instances.
- Traffic Distribution π: Uses the global load balancer to distribute traffic and ensure low-latency access to users worldwide.
- Configured GCE Ubuntu instances running Apache web server in:
- us-central-a (Iowa)
- asia-southeast1-a (Singapore)
- us-central: Autoscaled group across 4 availability zones (a, b, c, f) with 4 minimum and 8 maximum instances.
- asia-southeast1: Autoscaled group across 2 availability zones (a, b) with 3 minimum and 6 maximum instances.
- Configured a Global Load Balancer to distribute incoming traffic across the instance groups in both regions. This ensures:
- π High Availability: Continues serving traffic even if a region fails.
- β‘οΈ Low Latency: Directs users to the region closest to them for faster response times.
- Implemented Cloud Armour to block traffic from India. This helps:
- π οΈ Filter out requests from unwanted regions.
- π§βπ» Maintain security by controlling access based on geographical locations.
- Autoscaling based on CPU utilization to optimize resource usage and reduce costs:
- us-central: Scales between 4 to 8 instances.
- asia-southeast1: Scales between 3 to 6 instances.
- GCP Account with billing enabled.
- Knowledge of GCP services like Compute Engine, Load Balancer, and Cloud Armour.
- Optional: Familiarity with Terraform or gcloud CLI for resource management.
- Use the GCE Ubuntu image and install the Apache web server on the instances in both regions.
- Create an instance group for each region:
- us-central with autoscaling (min 4, max 8).
- asia-southeast1 with autoscaling (min 3, max 6).
- Configure a GCP Global Load Balancer to route incoming traffic across the instance groups in both regions.
- Set up Cloud Armour to block requests from India or any other unwanted geographic location.
- Send user traffic from different locations to verify:
- β Traffic distribution across regions.
- π« Requests from blocked regions are denied.
- π Instances are auto-scaling based on load.
- Google Cloud Platform (GCP):
- π Compute Engine
- β‘οΈ Global Load Balancer
- π Cloud Armour
- Ubuntu: Operating system on the instances.
- Apache Web Server: Hosting web services on each instance.
- Terraform: Optional, for automating infrastructure provisioning.
