Top Banner
@RossKukulinski Building a SaaS with NodeJS, Docker, and CoreOS London Node Users’ Group March 25, 2015
34

Building a SaaS with Nodejs, Docker, and CoreOS

Jul 15, 2015

Download

Technology

Ross Kukulinski
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

Building a SaaS with NodeJS, Docker, and

CoreOSLondon Node Users’ Group

March 25, 2015

Page 2: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

@RossKukulinski

Yodlr Founder / CEO

BayNode Co-Organizer

Soccer Fanatic

rossk on Freenode

Page 3: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

What I’m going to Cover

• Our story

• Why Docker & CoreOS

• Tips & Tricks

Page 4: Building a SaaS with Nodejs, Docker, and CoreOS
Page 5: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

The internal tool that wasn’t internal anymore

Page 6: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

12factor.net

Page 7: Building a SaaS with Nodejs, Docker, and CoreOS

@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’

Page 8: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

Docker

Page 9: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

VM vs Docker

https://docker.com/whatisdocker/

Page 10: Building a SaaS with Nodejs, Docker, and CoreOS

@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

Page 11: Building a SaaS with Nodejs, Docker, and CoreOS

@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’

Page 12: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

How do you ship docker containers?

Bash scripts (ugh) Ansible / Puppet / Chef

Docker Swarm (just released)

Page 13: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

Linux for Massive Server Deployments

Page 14: Building a SaaS with Nodejs, Docker, and CoreOS

@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 15: Building a SaaS with Nodejs, Docker, and CoreOS

@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 16: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

Scalable

https://coreos.com/

Page 17: Building a SaaS with Nodejs, Docker, and CoreOS

@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’

Page 18: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

Now for the good stuffLet’s talk tips & tricks

Page 19: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

Dockerizing NodeJS App

Page 20: Building a SaaS with Nodejs, Docker, and CoreOS
Page 21: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

Docker Compose

https://coreos.com/

Page 22: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

Booting CoreOS

Page 23: Building a SaaS with Nodejs, Docker, and 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

Page 24: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

npm install -g coreos-cluster-cli

Page 25: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

Service Discovery “Sidekick Pattern”

http://tinyurl.com/redis-sk

Page 26: Building a SaaS with Nodejs, Docker, and CoreOS

@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

Page 27: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

Monitoring CoreOS with

https://github.com/yodlr/CoreGI

Page 28: Building a SaaS with Nodejs, Docker, and CoreOS

https://github.com/yodlr/CoreGI

Page 29: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

Continuous Deployment with Paz

http://paz.sh

Page 30: Building a SaaS with Nodejs, Docker, and CoreOS

http://www.paz.sh/

Page 31: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

Other Tools

• Kubernetes (Powers Google Container Engine)

• Deis (Open-source heroku clone)

• Vulcan Proxy (https://vulcand.io/)

Page 32: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

etcd is a databasetreat it like one

Page 33: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

Docker & CoreOS are the future for application

development and deployment

Write that down

Page 34: Building a SaaS with Nodejs, Docker, and CoreOS

@RossKukulinski

Thanks!Questions?