PHASE 3 : SOLUTION DEVELOPMENT AND TESTING
Leveraging Multi-Cloud Strategy using Docker & Kubernetes
College Name : KNS Institute Of Technology
Group Members :
• Name : Sindhu T K
CAN_ID : 32765814
• Name : Krishna Reddy R
CAN_ID : 32892196
SOLUTION DEVELOPMENT
1. AWS & GCP Account Creation
1. Sign up for AWS
○ Go to AWS Signup and create an account.
○ Provide billing details (Free Tier available).
○ Enable IAM and configure CLI access.
2. Create an ECR (Elastic Container Registry) Repository
○ Go to ECR → Create a new repository → Note down the repository URI.
3. Install AWS CLI & Configure Credentials
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /
aws configure
Enter AWS Access Key, Secret Key, Region, and Output Format.
GCP Account & GKE Setup
1. Sign up for Google Cloud
○ Go to Google Cloud and create an account.
○ Enable billing (GCP Free Tier gives $300 credits).
2. Enable Kubernetes Engine API
○ Go to Kubernetes Engine → Enable the API.
Install Google Cloud SDK & Authenticate
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sd441.0.0-
darwin-arm.tar.gz
tar -xvzf google-cloud-sdk-*.tar.gz./google-cloud-sdk/install.sh
gcloud init
3. Select the GCP project, set a region, and authenticate
2. Install Required Tools & Dependencies
Install Docker
brew install --cask docker
open /Applications/Docker.app
Ensure Docker is running:
docker --version
● Install Kubernetes & kubectl
brew install kubectl
kubectl version --client
Install Google Cloud CLI & GKE Auth Plugin
brew install google-cloud-sdk
gcloud components install gke-gcloud-auth-plugin
Install Terraform
brew tap hashicorp/tap
brew install hashicorp/tap/terraform
terraform -version
1. AWS EKS Cluster Creation via AWS Management
Console
Step 1: Sign in to AWS Console
● Go to AWS Management Console
● Navigate to EKS:
○ Search for EKS in the search bar → Click Elastic Kubernetes Service.
Step 2: Create a New EKS Cluster
1. Click Create Cluster.
2. Enter Cluster Name (e.g., flask-eks).
3. Choose Kubernetes Version (latest recommended).
4. Select Cluster Service Role:
○ Click Create IAM Role if you don’t have one.
○ Attach the AmazonEKSClusterPolicy.
○ Choose the created role in Cluster Service Role.
5. Select Networking Configuration:
○ Choose an existing VPC or create a new one.
○ Select Subnets where worker nodes will be placed.
○ Choose a Security Group (allow port 443 for API server access).
Step 3: Configure Compute (Worker Nodes)
1. Choose Compute Type:
○ Managed Node Group (recommended)
○ Self-Managed Nodes (for more control)
2. Create a Node Group:
○ Click Add Node Group → Enter a name (eks-nodes).
○ Choose IAM Role → Attach AmazonEKSWorkerNodePolicy.
○ Select Instance Type: t3.medium (for testing).
○ Set Minimum/Maximum Number of Nodes (e.g., 2 min, 3 max).
Step 4: Review & Create
● Click Next → Review Configuration → Click Create.
● Cluster creation may take 5-10 minutes.
● Once ready, go to Clusters → Click flask-eks → Copy the API Endpoint.
Feature AWS EKS GCP GKE
Access AWS Management Console → EKS GCP Console → Kubernetes Engine
Console
Create Manually configure IAM, Simple UI-based selection of cluster type,
Cluster networking, and node groups region, and node pools
Networking Requires selecting a VPC, Uses default or custom VPC
subnets, and security groups
Worker Requires creating a node group Managed automatically or manually
Nodes with IAM policies configured
Connecting aws eks update-kubeconfig gcloud container clusters get-credentials
Steps for Deployment
Now, let’s go through each step in detail.
Step 1: Dockerize Your Flask App
Since you already have a Dockerfile, ensure it looks like this:
dockerfile
Copy
# Use an official Python runtime as a parent image
FROM python:3.9
# Set the working directory
WORKDIR /app
# Copy project files
COPY . /app
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Expose the application port
EXPOSE 5000
# Command to run the Flask app
CMD ["python", "app.py"]
Step 2: Build & Push Docker Image
Run these commands to build and push your image to Docker Hub or AWS ECR & Azure ACR.
Push to Docker Hub
docker build -t your-dockerhub-username/multi-cloud-app:latest .
docker push your-dockerhub-username/multi-cloud-app:latest
NEXT STEPS :
1. Push Docker Image to container registry.
2. Set up Kubernetes cluster(EKS/AKS/GKE)
3. Create Kubernetes Deployment & service YAML’s
4. Apply Kubernetes configurations
5. Set up Monitoring with Promethesus & Grafana
6. Deploy Infrastructure with Terraform
7. Verify deployment
8. Monitor Logs & Troubleshoot