{"id":21332516,"url":"https://github.com/gfechio/tiny_infra","last_synced_at":"2026-01-02T21:55:55.102Z","repository":{"id":69226954,"uuid":"271514879","full_name":"gfechio/tiny_infra","owner":"gfechio","description":"Terraform infra","archived":false,"fork":false,"pushed_at":"2020-06-26T08:43:00.000Z","size":292,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-22T14:08:42.704Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gfechio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-11T10:15:19.000Z","updated_at":"2020-06-26T08:52:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"1180f00a-ee6a-4df9-8768-fecda8fae925","html_url":"https://github.com/gfechio/tiny_infra","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfechio%2Ftiny_infra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfechio%2Ftiny_infra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfechio%2Ftiny_infra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfechio%2Ftiny_infra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gfechio","download_url":"https://codeload.github.com/gfechio/tiny_infra/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243809883,"owners_count":20351407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T22:51:58.833Z","updated_at":"2026-01-02T21:55:55.047Z","avatar_url":"https://github.com/gfechio.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project\nProject assignment for infra using K8S and terraform.\n\n![Diagram](project.png)\n\n## Understandment\n\n- Create an scalabe Kubernetes deploy of a given tomcat. Setup ingress and autoscale.\n- Create an EC2 instance using terraform, the EC2 must be able to query Google, using curl.\n\n\n# Disclaimer\n\nThis project was built using the following versions:\n- Packer v1.6.0\n- Terraform v0.12.16\n- Kubectl v1.18.2\n- EKS v1.16.8-eks-e16311\n- Docker 19.03.11\n\n# Execution Plan\n\n- Generate an K8S cluster to deploy the tomcat application.\n- Deploy Tomcat 8 app using provided resources.\n- Create ingress for tomcat service.\n- Open application to be queried externally ( this will also include VPC changes to allow ingress connection). Use Port 8080\n- Scale solution accordingly - [here](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/)\n- Use multiple AZs\n\n# Getting Started\n\n- Have [jq](https://stedolan.github.io/jq/) installed.\n\n- Export you credentials for AWS:\n\n\tEx:\n\t`aws configure`\n\n- Create Key Pair:\n\n\t`aws ec2 create-key-pair --key-name project | echo \"$(jq -r .KeyMaterial)\" \u003e ~/.ssh/project.pem`\n\t`cmod 400 ~/.ssh/project.pem`\n\n- Create a environment var file:\n\n``` bash\ncat \u003e aws_export.env \u003c\u003cEOF\nexport access_key=\"\u003cYOUR_ACCESS_KEY\u003e\"\nexport secret_key=\"\u003cYOUR_SECRET_KEY\u003e\"\nexport private_key=\"~/.ssh/project.pem\"\nEOF\n```\n- Define AWS policies for you user, following docs in [here](aws/policy/README.md)\n\n- To generate your Kubeconfig :\n\n```\nexport KUBECONFIG=/my/dir/config\naws eks --region region-code update-kubeconfig --name cluster_name\n```\n\nExecuting `run.sh` the following should happen:\n- Download and install AWS cli/ Docker / packer / terraform\n- Create a ECR repo named `tomcat_project` for EKS use.\n- Deploy an EKS cluster to test tomcat K8S config.\n- Generate and AMI and upload it to AWS to later use.\n\t\"Most of AWS default AMIs already has curl installed, but packer process is making sure this is true\"\n- Instantiate EC2 on public subnet to access google and have project.pem to be accesible by SSH with ingress and egress rules.\n\n\n# Tomcat non-Terraform in EKS\n\nTo deploy Tomcat K8S service not using the provided EKS follow this.\n- `cd k8s` *where you can see the k8s yaml config*\n- `deploy.sh` * applying the config step by step on the available K8S on you current config\n\n# Improvements ( To Do )\n\n- At the moment Packer is handling the build of images `in loco` since **AWS Image Builder** needs to be supported as Terraform provider.\n  https://github.com/terraform-providers/terraform-provider-aws/issues/11084\n- For this project it wasn't deployed any sidecars for aplication logging.\n- Implement canary/(blue/green) deployment.\n- Create Helm Chart to deploy service.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfechio%2Ftiny_infra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgfechio%2Ftiny_infra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfechio%2Ftiny_infra/lists"}