This repository contains the backend component for the multicloud platform. The backend is responsible for handling deployment requests, managing DNS, and interacting with cloud providers. It is built using Python and deployed using Docker and Kubernetes.
- Project Structure
- Prerequisites
- Getting Started
- Building the Docker Image
- Deploying to Kubernetes
- Configuration
Root Directory
.
├── src/ # Source code for the backend application
├── backend-configMap.yaml # Kubernetes ConfigMap for backend configuration
├── backend-deployment.yaml # Kubernetes Deployment for the backend
├── backend-service.yaml # Kubernetes Service for exposing the backend
├── Dockerfile # Dockerfile for building the backend image
├── LICENSE # License file for the project
├── README.md # Project documentation
└── requirements.txt # Python dependencies
src/ Directory
src/
├── archive/ # Archived files
├── auth.py # Authentication and authorization logic
├── config.py # Configuration settings for the backend
├── deployment.py # Deployment logic for cloud providers
├── dns_manager.py # DNS management logic
├── main_app.py # Main application entry point
├── models.py # Database models (if applicable)
└── Notes.txt # Some notes
Before you begin, ensure you have the following installed:
- Python (v3.8 or higher)
- Docker (v20 or higher)
- Kubernetes (optional, for deployment)
- kubectl (optional, for Kubernetes deployment)
-
Clone the repository:
git clone https://github.com/dbd311/backend-multicloud.git cd backend-multicloud
-
Install Python dependencies:
pip install -r requirements.txt
-
Build and Run the backend application locally: docker build -t backend-multicloud:latest . docker run -p 5000:5000 backend-multicloud:latest
-p 5000:5000: Maps port 5000 on your local machine to port 5000 in the container. backend-multicloud:latest: The name and tag of the Docker image to run.
-
Access the Application:
Once the container is running, open your browser and navigate to:
http://localhost:5000
The application should now be accessible from your local machine.
The Kubernetes manifests provided in this repository can be used to deploy the backend application to a Kubernetes cluster.
-
Apply the Kubernetes manifests:
kubectl apply -f backend-configMap.yaml
kubectl apply -f backend-deployment.yaml
kubectl apply -f backend-service.yaml
-
Verify the deployment:
kubectl get pods kubectl get services
-
Access the backend through the Service endpoint.
Kubernetes Manifests
backend-configMap.yaml: Contains environment-specific configuration for the backend.
backend-deployment.yaml: Defines the Kubernetes Deployment for the backend application.
backend-service.yaml: Exposes the backend application as a Kubernetes Service.
Open PowerShell as Administrator and run to enable HyperV:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
Install Chocolatey (Package Manager for Windows)
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco --version
Install kubectl (Kubernetes CLI)
choco install kubernetes-cli
kubectl version --client
Install Minikube
choco install minikube
minikube version
Start Minikube
Launch PowerShell (Admin) and run:
minikube start --driver=hyperv
(If using VirtualBox, replace hyperv with virtualbox.)
Verify Installation
minikube status
kubectl get nodes
minikube dashboard
Troubleshooting
Delete and recreate the K82 cluster again
minikube delete && minikube start --driver=hyperv
Allocate more CPU and RAM
minikube config set cpus 4
minikube config set memory 8192
Alternative: Start minikube with Docker Desktop
minikube start --driver=docker
Check minikube and kubectl version
minikube version
kubectl version --client