Shipping NodeJS with Docker and CoreOS (No Notes)
-
Upload
ross-kukulinski -
Category
Technology
-
view
630 -
download
5
description
Transcript of Shipping NodeJS with Docker and CoreOS (No Notes)
@RossKukulinski
Shipping NodeJS with Docker and CoreOS
BayNode Talk Night November 20, 2014
@RossKukulinski
@RossKukulinski
SpeakIt.io Founder
BayNode Co-Organizer
Soccer Fanatic
Node-Forward Mentor
@RossKukulinski
What I’m going to Cover
• Our Story
• Background on Docker & CoreOS
• Tips & Tricks / Lessons Learned
@RossKukulinski
The internal tool that wasn’t internal anymore
@RossKukulinski
@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’
@RossKukulinski
Docker
@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
@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’
@RossKukulinski
How do you ship docker containers?
Bash scripts (ugh) Ansible / Puppet / Chef
@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!)
• Scalable
• Fault tolerant
• Run multiple versions of the same app
• Consistent app from dev → test → staging → prod
• Minimize time spent doing ‘devops’
@RossKukulinski
Now for the good stuffLessons Learned / Tips & Tricks
@RossKukulinski
Docker Registry• Public Registry
• Private Registry
• Quay.io / DockerHub
• Run your own
• Take advantage of layering docker images
@RossKukulinski
speakit/nodejs
@RossKukulinski
Node App Dockerfile
@RossKukulinski
Private GitHub Repos
@RossKukulinski
> docker pull image:latest
@RossKukulinski
Local CoreOS Dev
• Can use Vagrant with a single (or multi) node cluster
• Digital Ocean pretty cheap for small cluster
@RossKukulinski
Monitoring
• CLI tools (fleetctl via ssh)
• CoreGI (github.com/astilabs/CoreGI)
• cAdvisor (github.com/google/cadvisor)
@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/
@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
@RossKukulinski
npm install -g coreos-cluser-cli
@RossKukulinski
Things to watch• Kubernetes
• Google Container Engine
• Vulcan Proxy
• Paz (paz.sh)
• Panamax (panamax.io)
• Mesosphere (mesosphere.com)
@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…
@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)
@RossKukulinski
Thanks!Questions?