Skip to content

Get fine-grained Kubernetes + Infrastructure on AWS in 30 mins ๐Ÿš€

Notifications You must be signed in to change notification settings

1ambda/terraform-all-in-one

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

20 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

terraform-all-in-one

Get fine-grained Kubernetes + Infrastructure on AWS in 30 mins ๐Ÿš€


Prerequisite

$ brew install ansible jq terraform kops watch
$ pip install awscli

$ git clone [email protected]:1ambda/terraform-all-in-one.git
$ cd terraform-all-one

# Remove .gitigonre to index generated files
rm .gitignore

Usage

1. Export AWS Key Environment variables

The key should have AdministratorAccess permission.

$ export AWS_ACCESS_KEY_ID={VALUE} AWS_SECRET_ACCESS_KEY={VALUE}

2. Generate SSH Key Pair

# Modify values for `COMPANY`,`PROJECT`, and `EMAIL`
$ COMPANY=github PROJECT=1ambda [email protected] ./create-ssh-key.sh

3. Modify Terraform Variables to Customize

company and project variable should match with values used for the generated ssh key.

4. Applying Terraform Modules

  • root-infra: Create VPC, Bastion, ECS, Stroages and build kops scripts

    cd root-infra;
    
    # build infra using terraform
    terraform init
    terraform apply -var 'rds_username={USERNAME}' -var 'rds_password={PASSWORD}'
    
    # provision non-managed stroages using ansible
    ../script-provision/generated.provision-zookeeper.sh
  • root-kubernetes: Build Kubernetes Cluster and install add-ons

    cd root-kubernetes;
    
    # generate kops files
    $(cat generated.kops-env.sh);
    ./generated.kops-create.sh;
    
    # build kubernetes cluster
    terraform init
    terraform apply
    
    # wait for few minitues until Kube API ELB is ready (`api-kops-*`)
    # then validate the created cluster
    kops export kubecfg --name=$NAME
    ./generated.correct-kubectl-context.sh
    
    # wait for 3-5 mins until kubernetes cluster is ready
    kops validate cluster
    kubectl get pods

Features

Credits

About

Get fine-grained Kubernetes + Infrastructure on AWS in 30 mins ๐Ÿš€

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published