https://github.com/wednesday-solutions/multi-cloud-terraform-module
Terraform module that creates and deploys your kubernetes cluster across multiple cloud infrastructure providers like AWS and GCP. It sets up a load balancer that round-robins requests across clusters. Whether it's AWS or others, downtime’s got nothing on you.
https://github.com/wednesday-solutions/multi-cloud-terraform-module
automation aws devops gcp iac infrastructure-as-code k8s kubernetes multi-cloud setup terraform
Last synced: 3 days ago
JSON representation
Terraform module that creates and deploys your kubernetes cluster across multiple cloud infrastructure providers like AWS and GCP. It sets up a load balancer that round-robins requests across clusters. Whether it's AWS or others, downtime’s got nothing on you.
- Host: GitHub
- URL: https://github.com/wednesday-solutions/multi-cloud-terraform-module
- Owner: wednesday-solutions
- Created: 2023-02-22T11:38:22.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-22T07:46:22.000Z (about 3 years ago)
- Last Synced: 2025-02-22T03:18:53.570Z (about 1 year ago)
- Topics: automation, aws, devops, gcp, iac, infrastructure-as-code, k8s, kubernetes, multi-cloud, setup, terraform
- Language: HCL
- Homepage: https://wednesday.is/?utm_source=github&utm_medium=mutli-cloud-terraform
- Size: 63.5 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Terraform Multi-Cloud Module
> Terraform module for multi-cloud infrastructure (EKS/GKE)
The goal here is to provision multi-cloud infrastructure using Kubernetes services from different cloud providers (AWS, GCP) that could bring forth several advantages including high availability, optimal performance and increased flexibility.
## Prequisites
- AWS Account
- GCP Project
- CLI tools
- terraform
- kubectl
- aws
- gcloud
## Modules
- [`aws-eks-vpc`](./modules/aws-eks-vpc/) - EKS compliant VPC
- [`aws-eks-fargate`](./modules/aws-eks-fargate/) - EKS cluster with Fargate profile
- [`aws-eks-lbc-addon`](./modules/aws-eks-lbc-addon/) - AWS load balancer controller add-on
- [`aws-ec2-nginx`](./modules/aws-ec2-nginx/) - NGINX server in EC2 instance
- [`gcp-gke-autopilot`](./modules/gcp-gke-autopilot/) - GKE cluster in autopilot mode
## Example
1. Create EKS cluster with Fargate profile and AWS load balancer controller
```bash
# 1. Go to directory
cd examples/aws-eks-fargate
# 2. Create terraform variables file.
cp terraform.tfvars.sample terraform.tfvars
# 3. Enter AWS credentials in terraform.tfvars
aws_access_key_id = ""
aws_access_secret_key = ""
# 3. Initialize terraform
terraform init
# 4. Apply infrastructure
terraform apply
```
2. Create GKE cluster in autopilot mode
```bash
# 1. Go to directory
cd examples/gcp-gke-autopilot
# 2. Create terraform variables file.
cp terraform.tfvars.sample terraform.tfvars
# 3. Enter GCP project ID in terraform.tfvars
project_id = ""
# 3. Initialize terraform
terraform init
# 4. Apply infrastructure
terraform apply
```
3. Deploy sample application to both EKS and GCP cluster. This will also setup load balancers in respective cloud cluster
```bash
# 1. Go to directory
cd examples/multi-cloud-sample-app
# 2. Create terraform variables file.
cp terraform.tfvars.sample terraform.tfvars
# 3. Enter AWS & GCP credentials in terraform.tfvars
aws_access_key_id = ""
aws_access_secret_key = ""
project_id = ""
# 3. Initialize terraform
terraform init
# 4. Apply infrastructure
terraform apply
```
4. Provision NGINX load balancer in EC2 instance which distributes the traffic to EKS & GKE load balancer
```bash
# 1. Go to directory
cd examples/multi-cloud-nginx-lb
# 2. Create terraform variables file.
cp terraform.tfvars.sample terraform.tfvars
# 3. Enter AWS & GCP credentials in terraform.tfvars
aws_access_key_id = ""
aws_access_secret_key = ""
project_id = ""
# 3. Initialize terraform
terraform init
# 4. Apply infrastructure
terraform apply
```
## Roadmap
- [x] AWS EKS Cluster
- [x] GKE cluster autopilot mode
- [ ] EKS multi-region cluster using Global Accelerator
- [ ] GKE multi-region cluster using MCS (Multi Cluster Service)
- [ ] Multi-cloud load balancing with failover