Project 3: Multi-Cloud Kubernetes (EKS & GKE)
Overview
This project takes the E-Commerce Application from Project 1 and deploys it to Google Kubernetes Engine (GKE) to achieve a High-Availability Multi-Cloud architecture.
Strategy: "Build Once, Deploy Everywhere"
1. The Artifact
We rely on the Amazon ECR image built by the Jenkins pipeline in Project 1:
123456789012.dkr.ecr.us-east-1.amazonaws.com/ecommerce-service:v1
2. GKE Access to ECR
To allow GKE to pull from AWS ECR:
1. Create an IAM User in AWS with ECRReadOnly policy.
2. Generate Access Keys.
3. Create a Kubernetes Secret in GKE:
bash
kubectl create secret docker-registry aws-ecr-login \
--docker-server=123456789012.dkr.ecr.us-east-1.amazonaws.com \
--docker-username=AWS \
--docker-password=$(aws ecr get-login-password)
Implementation (Traffic Routing)
We use DNS Load Balancing via AWS Route 53.
Step 1: Get EKS Endpoint
From Project 1, we have the NLB DNS:
ecommerce-nlb-12345.elb.us-east-1.amazonaws.com
Step 2: Get GKE Endpoint
After deploying the app to GKE (using the same Helm chart from Project 1), get the LoadBalancer IP:
35.200.100.20
Step 3: Route 53 Configuration
We create a Weighted Routing Policy:
- Record 1 (AWS):
- Type:
CNAME - Value:
ecommerce-nlb-12345... - Weight: 50
- Type:
- Record 2 (GCP):
- Type:
A - Value:
35.200.100.20 - Weight: 50
- Type:
Setup Guide
- Deploy to AWS: Complete Project 1 setup.
- Provision GKE: Use the Terraform in
MultiCloud_Kubernetes_Project/gcp/. - Sync App: Use Anthos Config Management (or ArgoCD) to apply the
k8s/manifests/from Project 1 to the GKE Cluster. - Update DNS: Apply the Route 53 changes.