![Page 1: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/1.jpg)
@RossKukulinski
Shipping NodeJS with Docker and CoreOS
BayNode Talk Night November 20, 2014
![Page 2: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/2.jpg)
@RossKukulinski
@RossKukulinski
SpeakIt.io Founder
BayNode Co-Organizer
Soccer Fanatic
Node-Forward Mentor
![Page 3: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/3.jpg)
@RossKukulinski
What I’m going to Cover
• Our Story
• Background on Docker & CoreOS
• Tips & Tricks / Lessons Learned
![Page 4: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/4.jpg)
![Page 5: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/5.jpg)
@RossKukulinski
The internal tool that wasn’t internal anymore
![Page 6: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/6.jpg)
@RossKukulinski
![Page 8: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/8.jpg)
@RossKukulinski
Our Goals• Reduce application complexity (do one thing well!)
• Scalable
• Fault tolerant
• Support running multiple versions of the same app
• Consistent app from dev → test → staging → prod
• Minimize time spent doing ‘devops’
![Page 9: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/9.jpg)
@RossKukulinski
Docker
![Page 11: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/11.jpg)
@RossKukulinski
• Containers start quickly
• Containers have small footprint
• Dockerized applications run anywhere
• Really fast builds via cached images
• Registry for storing images from build pipeline
• Images can be layered
• Abstracts app networking from system networking
![Page 12: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/12.jpg)
@RossKukulinski
Our Goals• Reduce application complexity (do one thing well!)
• Scalable
• Fault tolerant
• Run multiple versions of the same app
• Consistent app from dev → test → staging → prod
• Minimize time spent doing ‘devops’
![Page 13: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/13.jpg)
@RossKukulinski
How do you ship docker containers?
Bash scripts (ugh) Ansible / Puppet / Chef
![Page 14: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/14.jpg)
@RossKukulinski
Linux for Massive Server Deployments
![Page 15: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/15.jpg)
@RossKukulinski
• Minimal Operating System
• Automated software updates
• Runs docker containers
• Supported by all major cloud providers
• Can also run on bare metal
https://coreos.com/
![Page 16: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/16.jpg)
@RossKukulinski
Fault Tolerant
• Clustered by default
• Support for multiple HA zones
• Distributed tools like etcd & fleet
• HTTP Key-Value Store
• Service Discovery
• Application Scheduling
https://coreos.com/
![Page 17: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/17.jpg)
@RossKukulinski
Scalable
https://coreos.com/
![Page 18: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/18.jpg)
@RossKukulinski
Goals• Reduce application complexity (do one thing well!)
• Scalable
• Fault tolerant
• Run multiple versions of the same app
• Consistent app from dev → test → staging → prod
• Minimize time spent doing ‘devops’
![Page 19: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/19.jpg)
@RossKukulinski
Now for the good stuffLessons Learned / Tips & Tricks
![Page 20: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/20.jpg)
@RossKukulinski
Docker Registry• Public Registry
• Private Registry
• Quay.io / DockerHub
• Run your own
• Take advantage of layering docker images
![Page 21: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/21.jpg)
@RossKukulinski
speakit/nodejs
![Page 22: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/22.jpg)
@RossKukulinski
Node App Dockerfile
![Page 23: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/23.jpg)
@RossKukulinski
Private GitHub Repos
![Page 24: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/24.jpg)
@RossKukulinski
> docker pull image:latest
![Page 25: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/25.jpg)
@RossKukulinski
Local CoreOS Dev
• Can use Vagrant with a single (or multi) node cluster
• Digital Ocean pretty cheap for small cluster
![Page 26: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/26.jpg)
@RossKukulinski
Monitoring
• CLI tools (fleetctl via ssh)
• CoreGI (github.com/astilabs/CoreGI)
• cAdvisor (github.com/google/cadvisor)
![Page 27: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/27.jpg)
@RossKukulinski
Service Discovery• Don’t hardcode the
host port of your container
• Sidekick pattern -> Write to etcd
• Confd (github.com/kelseyhightower/confd)
• Vulcan (vulcanproxy.com)
https://coreos.com/
![Page 28: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/28.jpg)
@RossKukulinski
Cloud Load Balancers
• How do your users access services in CoreOS?
• Could run Global service with proxy on 80/443
• Or update cloud lbs dynamically based on etcd
• Soon: github.com/astilabs/CoreOS-Cloud-LB
![Page 29: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/29.jpg)
@RossKukulinski
npm install -g coreos-cluser-cli
![Page 30: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/30.jpg)
@RossKukulinski
Things to watch• Kubernetes
• Google Container Engine
• Vulcan Proxy
• Paz (paz.sh)
• Panamax (panamax.io)
• Mesosphere (mesosphere.com)
![Page 31: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/31.jpg)
@RossKukulinski
Resources• Example cloud_config
• https://gist.github.com/rosskukulinski/9ddff8e5f67a24cc7bb7
• Full example of sidekick pattern for Redis • https://gist.github.com/rosskukulinski/
96f7709fa20d7def6b9e
• PXE Booting CoreOS Post coming soon…
![Page 32: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/32.jpg)
@RossKukulinski
Other Resources• CoreOS Docs: https://coreos.com/docs/
• CoreOS User Google Group
• #coreos & #docker on FreeNode (I’m ‘rossk’)
• SpeakIt GitHub (https://github.com/astilabs)
• SpeakIt Blog (https://blog.speakit.io)
![Page 33: Shipping NodeJS with Docker and CoreOS (No Notes)](https://reader034.vdocument.in/reader034/viewer/2022042715/559b56bc1a28ab26298b46b3/html5/thumbnails/33.jpg)
@RossKukulinski
Thanks!Questions?