@RossKukulinski Building a SaaS with NodeJS, Docker, and CoreOS London Node Users’ Group March 25, 2015
@RossKukulinski @RossKukulinski Yodlr Founder / CEO BayNode Co-Organizer Soccer Fanatic rossk on Freenode
@RossKukulinski What I’m going to Cover • Our story • Why Docker & CoreOS • Tips & Tricks
@RossKukulinski The internal tool that wasn’t internal anymore
@RossKukulinski 12factor.net
@RossKukulinski Our Goals • Reduce application complexity (do one thing well!) • Run multiple versions of the same app • Consistent app from dev → test → staging → prod • Scalable • Fault tolerant • Minimize time spent doing ‘devops’
@RossKukulinski Docker
@RossKukulinski VM vs Docker https://docker.com/whatisdocker/
@RossKukulinski • Containers start quickly • Containers have small footprint • “Dockerized” applications run anywhere • Fast builds via cached images • Registry for storing images from build pipeline • Images can be stacked • Abstracts app networking from system networking
@RossKukulinski Our Goals • Reduce application complexity (do one thing well!) • Run multiple versions of the same app • Consistent app from dev → test → staging → prod • Scalable • Fault tolerant • Minimize time spent doing ‘devops’
@RossKukulinski How do you ship docker containers? Bash scripts (ugh) Ansible / Puppet / Chef Docker Swarm (just released)
@RossKukulinski Linux for Massive Server Deployments
@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/
@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/
@RossKukulinski Scalable https://coreos.com/
@RossKukulinski Goals • Reduce application complexity (do one thing well!) • Run multiple versions of the same app • Consistent app from dev → test → staging → prod • Scalable • Fault tolerant • Minimize time spent doing ‘devops’
@RossKukulinski Now for the good stuff Let’s talk tips & tricks
@RossKukulinski Dockerizing NodeJS App
@RossKukulinski Docker Compose https://coreos.com/
@RossKukulinski Booting CoreOS
@RossKukulinski Booting CoreOS Cluster • Most frustrating part of the whole experience • RTFM re: cloud_config.yml • Use Ansible for easy provisioning • Great resources: • https://coreos.com/docs/ • https://www.digitalocean.com/community/ tutorial_series/getting-started-with-coreos-2
@RossKukulinski npm install -g coreos-cluster-cli
@RossKukulinski Service Discovery “Sidekick Pattern” http://tinyurl.com/redis-sk
@RossKukulinski Confd • https://github.com/kelseyhightower/confd • Monitors etcd for changes to key:value pairs • Writes updated config file based on Go template • We use with nginx, could be anything! http://tinyurl.com/redis-sk
@RossKukulinski Monitoring CoreOS with https://github.com/yodlr/CoreGI
https://github.com/yodlr/CoreGI
@RossKukulinski Continuous Deployment with Paz http://paz.sh
http://www.paz.sh/
@RossKukulinski Other Tools • Kubernetes (Powers Google Container Engine) • Deis (Open-source heroku clone) • Vulcan Proxy (https://vulcand.io/)
@RossKukulinski etcd is a database
 treat it like one
@RossKukulinski Docker & CoreOS are the future for application development and deployment Write that down
@RossKukulinski Thanks! Questions?

Building a SaaS with Nodejs, Docker, and CoreOS