coreos at carnival

9
CoreOS at Carnival @tobcox

Upload: toby-cox

Post on 06-Aug-2015

157 views

Category:

Internet


2 download

TRANSCRIPT

Page 1: CoreOS at Carnival

CoreOS at Carnival @tobcox

Page 2: CoreOS at Carnival

Overview

Web App

API App

JS App

Sidekiq App

CoreOS cluster

Docker RepositoryDrone

• Staging and production envs

• Micro(ish) services

• CI server

• Private docker repository

Page 3: CoreOS at Carnival

Drone

• Self-hosted (http://drone.io)

• Runs tests in containers

• If successful on master branch, pushes image to private Docker repository

Page 4: CoreOS at Carnival

CD to Staging

• When Drone is successful on master:

• Staging pulls successful container

• Restarts systemd service

Page 5: CoreOS at Carnival

Production DeployStep #1: Tag the image to deploy

Page 6: CoreOS at Carnival

Production DeployStep #2: Alter etcd version value

Page 7: CoreOS at Carnival

Production DeployStep #3: Let the watcher service do its magic

while true do VERSION=$(etcdctl watch /versions/$NAME) if [ -z "$VERSION" ]; then continue fi

echo "#### New version: $VERSION"

echo "## Pulling $IMAGE_NAME:$VERSION" docker pull $IMAGE_NAME:$VERSION 1>/dev/null echo -n ".Done!"

echo "## Updating service $SERVICE" systemctl restart $SERVICE echo ".Done!" done

Page 8: CoreOS at Carnival

Dabus

• systemd dbus notification observer

• Gives us Slack notifications whenever a service restarts

• https://github.com/carnivalmobile/dabus

Page 9: CoreOS at Carnival

Thanks @tobcox