An open API service indexing awesome lists of open source software.

https://github.com/gfechio/tiny_infra

Terraform infra
https://github.com/gfechio/tiny_infra

Last synced: 7 months ago
JSON representation

Terraform infra

Awesome Lists containing this project

README

          

# Project
Project assignment for infra using K8S and terraform.

![Diagram](project.png)

## Understandment

- Create an scalabe Kubernetes deploy of a given tomcat. Setup ingress and autoscale.
- Create an EC2 instance using terraform, the EC2 must be able to query Google, using curl.

# Disclaimer

This project was built using the following versions:
- Packer v1.6.0
- Terraform v0.12.16
- Kubectl v1.18.2
- EKS v1.16.8-eks-e16311
- Docker 19.03.11

# Execution Plan

- Generate an K8S cluster to deploy the tomcat application.
- Deploy Tomcat 8 app using provided resources.
- Create ingress for tomcat service.
- Open application to be queried externally ( this will also include VPC changes to allow ingress connection). Use Port 8080
- Scale solution accordingly - [here](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/)
- Use multiple AZs

# Getting Started

- Have [jq](https://stedolan.github.io/jq/) installed.

- Export you credentials for AWS:

Ex:
`aws configure`

- Create Key Pair:

`aws ec2 create-key-pair --key-name project | echo "$(jq -r .KeyMaterial)" > ~/.ssh/project.pem`
`cmod 400 ~/.ssh/project.pem`

- Create a environment var file:

``` bash
cat > aws_export.env <