Giter Site home page Giter Site logo

gonodeorchestr8's Introduction

orchestration for goNodeNetwork

To run this:

  • Make sure that your docker pulls from dockerhub...idk how to ensure that.
  • Clone this repo and run make init make up to start the app, run make end make down to teardown the app
  • If you have kubernetes, kind, and helm installed:
    • make install to startup pods and service
    • make reveal to expose the service (and app) at localhost:6060
    • make uninstall to teardown pod and service

Send a GET Request

  • Send a request to http://localhost:6060/monkeys
  • This will contact goDocker container which will return "Hi there, I love monkeys! and hello boy, 3:44PM" (or whatever current time is)
  • The Go container will contact the nodeDocker container which will add logs with the time in src/log/access.log
    • view the log by entering the container with docker exec -it nodeDocker bash and navigate to the log

Comments

  • Made some changes to each server's docker image to make it smaller
    • nodeDocker now uses node:alpine base over node:latest
      • original: >1GB using node:latest
      • current: ~220MB using node:alpine
    • goDocker now uses multistage docker with final image just being the server as binary in alpine
      • original: 700MB -> golang:onbuild
      • current: 12MB -> golang:alpine to build binary in stage 1, copy binary into alpine base stage 2
  • Added docker-compose which can be implemented with make up and torn down with make down
  • Working on running this in kubernetes
    • Done:
      • Deployment.yaml for JUST the node app and go app
      • Service.yaml for JUST the node app and go app
      • Contact the app via kubectl proxy
      • Can I contact the app outside of kubectl proxy?
        • kubectl port-forward svc/go-node-kube 6060:80
        • This will forward the service to be exposed at localhost:6060
      • Modified GoApp so that it checks the HOST env variable to determine target URL.
        • localhost nodeapp in Kubernetes
          • Moved Golang container and NodeJS container into separate pods with corresponding services
        • nodedocker in Docker-Compose

Links

Go App

Node App

gonodeorchestr8's People

Contributors

grebnesorbocaj avatar

Watchers

James Cloos avatar  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.