Code Monkey home page Code Monkey logo

helloname's Introduction

helloname

Assumptions: Build a 3 tier web app. Build an API to accept json requests and take an action In this case check GET endpoint hello/:somename and return and print the name as well as to lookup the name in a database. If the name exists, increase a counter tracking number of GET requests for that name. If the name doesn't exist then insert the name into a table and increase the names count by 1. To delete the counts on all names post a json request to /counts..(curl -X DELETE -H "Content-Type: application/json" http://104.154.136.98/counts). To return all results outputed in json tupe of the name and count go to http://104.154.136.98/counts. Any undefined route will return a 404. To see system data go to http://104.154.136.98/health which will return disk and memory info.

Tech: Go Docker Kubernetes Helm Terraform Postgres Gcloud CLI

Buckets: nyt-hello-tf //tfvars and state ny-helloname-creds //json creds

Build and Deploy: GKE Cluster can be bootstraped by downloading the .tfvars file to the ./gcp dir of this repo. CloudSQL databases prohibit the reuse of identical db intance names for a fixed period so update the {db_instance_name =} var in tfvars to a uniqe value to launch the db. The Makefile conists of 8 operations.

  1. make plan - Runs terraform plan to see what will be launched in GCE and outputs what will occurr during the run.

  2. make create - Creates a GKE cluster along with a cloud sql postgres instance

  3. make destroy - Destroys all previsouly created GKE clusters and cloud sql instances

  4. make install - Initial install of the chart used for deploying to the cluster

  5. make deploy - Upgrades installed chart of the helloname app

  6. make run - Runs go app in go

  7. make build - Docker builds helloname app

  8. make push - Docker push helloname app to docker hub registry

Enjoy!

helloname's People

Contributors

sreenuyedavalli avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.