Skip to content

All-in-one repository for multi-cloud k8s cluster provisioning using Terraform. Supports GKE, EKS & AKS.

Notifications You must be signed in to change notification settings

ragul28/terraform-mulitcloud-k8s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi cloud k8s provisioning using terraform

Provision k8s cluster in all there major cloud providers using single terraform repository.

  • AWS EKS
  • Azure AKS
  • GCP GKE

Usage

EKS

  • Make sure AWS credentials are configured using aws-cli.

  • Fill with necessary variables in terraform.tfvars file.

  • Run the terraform with necessary variables.

    cd aws/
    terraform init
    terraform apply
    
  • To append kubeconfig file default path

    aws eks update-kubeconfig --name <CLUSTER_NAME>
    
  • To estimate cost using infracost.

    make infracost

AKS

  • Authenticating azure provider using the Azure CLI

    az login
    az account set --subscription="SUBSCRIPTION_ID"
    
  • Clone project & fill the terraform variables in terraform.tfvars.

    cd azure/
    cp terraform.tfvars.sample terraform.tfvars
    terraform init
    terraform apply
    
  • Get kubeconfig using az or export

    az aks get-credentials --resource-group $RESOURCE_GROUP --name $AKS_CLUSTER_NAME
    

    or

    echo "$(terraform output kube_config)" > aks-kube-confg.yml
    export KUBECONFIG="$PWD/aks-kube-confg.yml"
    

GKE

  • Install gcloud cli & auth with gcp account
  • Add your account to the app default credentials.
    gcloud auth application-default login
    
  • Update the tfvars file & init terrform. To enable regonal cluster comment zone in terraform.tfvars.
    cd gcp
    cp terraform.tfvars.sample terraform.tfvars
    terraform init
    terraform apply
    

About

All-in-one repository for multi-cloud k8s cluster provisioning using Terraform. Supports GKE, EKS & AKS.

Topics

Resources

Stars

Watchers

Forks