Upload
pfremm
View
293
Download
0
Embed Size (px)
Citation preview
Presentation Prep (sorry, macs only…)Follow the instructions here:
https://github.com/pfremm/kube-demo
References:We will be playing a cloned Facebook React todo application:
https://github.com/williamsbg03/todomvchttps://hub.docker.com/r/williamsbg03/todomvc/
Highly Available Node.jsBryan Pfremmer / Brad Williams
April 4th, 2016
March 25, 2015
The GoalIntegrate the distinct LearnVest digital client experience with Northwestern Mutual’s financial planning and products.
• In the cloud, highly available
• Lightweight web runtimes with latest modern frameworks
• Automated infrastructure• Application and
infrastructure design built for failure
• Single data center with many maintenance windows
• Heavy server runtimes for large batch consumption
• Classic infrastructure builds• Application and infrastructure
design built to try to prevent failure
The Key PrincipleBe Available
Brett Favre9/27/1992 - 12/5/2010
100% Availability
http://dailysnark.com/wp-content/uploads/2016/04/131.jpg
• Split your application into small services that can be reused, remixed and shared.
• Enables smaller, nimble, decoupled teams and processes.
• Lightweight runtime, starts in seconds
• Stateless and backwards compatible.
Microservices
http://martinfowler.com/articles/microservices.htmlhttp://slides.eightypercent.net/kubernetes-101/kubernetes-101.html#7
• Modules cannot be blocking, we are looking for async I/O• Module pattern encourages lightweight packages with small
footprint• Seconds to initialize• Excellent performance• Express.js, async, bunyan, mysql, body-parser, config,
memwatch-next, underscore, and util
Node.js
• Log important activities and errors (bunyan, winston, log4js)• Handle SIGTERM for graceful shutdown• Select and review NPM modules carefully• Lock down NPM dependencies (shrinkwrap)• Test, Test, Test (supertest, proxyquire)• NODE_ENV = production
Node.js Production Considerations
The number of deployable artifacts increase to the point at which automated testing, building, deploying, and monitoring becomes essential.
But, they come at a cost…
http://techblog.netflix.com/2013/01/announcing-ribbon-tying-netflix-mid.html
How do we make microservices easier to build and deploy?
Wrap up a piece of software in a complete filesystem that contains everything it needs to run.• Guaranteed to always run the same,
regardless of the environment• Start/stop almost instantly• Efficient use of system resources• Portable• Easy to configure
Containers
https://www.docker.com/what-docker
Provides an implementation of containers that is actively used in the software community. Docker illustrates how containers differ from the traditional VM hypervisor.
Docker
https://www.docker.com/what-docker
A sea of containers…While containers provide us with a stable build and deploy platform, we still have many artifacts to deploy and maintain.
KubernetesAn open-source system for automating deployment, operations, and scaling of containerized applications.• Ensures containers stay running• Abstracts port managements away from the developer• Schedules containers based on cluster health metrics• Provides lightweight deployment and horizontal scaling• Stores application configuration and secrets outside the
container• Deploy a set of grouped containers as a single deployable unit
We are ready to run, but where?With a solid application framework we can scale our application quite easily. Without the same capability in our infrastructure we are going nowhere fast.
Automated & Immutable InfrastructurePublic cloud providers provide APIs to create infrastructure of all types. By leveraging infrastructure as code tools we can script our entire environment.Guidelines to code by:• No manual changes• Replace containers, VM’s instead of fixing them• Rebuilds and re-deploys should take minutes• Goal is idempotent scripts. Rerun to ensure a known working state.
Demo
Tech Stack
Lessons Learned• Architect for failure• Tag your releases for prod, run current development in non-
production• Different purchasing considerations for vendor tools when you
need to orchestrate its install and configuration• Orchestration can make security easier
Thank You