2016-06-07 19:45:25 +00:00
|
|
|
## Kubernetes on AWS with Terraform
|
|
|
|
|
|
|
|
**Overview:**
|
|
|
|
|
2017-03-01 17:25:58 +00:00
|
|
|
This project will create:
|
|
|
|
* VPC with Public and Private Subnets in # Availability Zones
|
|
|
|
* Bastion Hosts and NAT Gateways in the Public Subnet
|
|
|
|
* A dynamic number of masters, etcd, and worker nodes in the Private Subnet
|
|
|
|
* even distributed over the # of Availability Zones
|
|
|
|
* AWS ELB in the Public Subnet for accessing the Kubernetes API from the internet
|
2016-06-07 19:45:25 +00:00
|
|
|
|
2017-03-01 17:25:58 +00:00
|
|
|
**Requirements**
|
|
|
|
- Terraform 0.8.7 or newer
|
2016-06-07 19:45:25 +00:00
|
|
|
|
|
|
|
**How to Use:**
|
|
|
|
|
2017-03-01 17:25:58 +00:00
|
|
|
- Export the variables for your AWS credentials or edit credentials.tfvars:
|
2016-06-07 19:45:25 +00:00
|
|
|
|
|
|
|
```
|
2017-03-01 17:25:58 +00:00
|
|
|
export aws_access_key="xxx"
|
|
|
|
export aws_secret_key="yyy"
|
|
|
|
export aws_ssh_key_name="zzz"
|
2016-06-07 19:45:25 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
- Update contrib/terraform/aws/terraform.tfvars with your data
|
|
|
|
|
2017-03-01 17:25:58 +00:00
|
|
|
- Run with `terraform apply -var-file="credentials.tfvars"` or `terraform apply` depending if you exported your AWS credentials
|
|
|
|
|
|
|
|
- Once the infrastructure is created, you can run the kargo playbooks and supply inventory/hosts with the `-i` flag.
|
2016-06-07 19:45:25 +00:00
|
|
|
|
2017-03-01 17:25:58 +00:00
|
|
|
**Architecture**
|
2016-06-07 19:45:25 +00:00
|
|
|
|
2017-03-01 17:25:58 +00:00
|
|
|
Pictured is an AWS Infrastructure created with this Terraform project distributed over two Availability Zones.
|
2016-06-07 19:45:25 +00:00
|
|
|
|
2017-03-01 17:25:58 +00:00
|
|
|
![AWS Infrastructure with Terraform ](docs/aws_kargo.png)
|