11
CoreOS Workshop

Running services with Docker on CoreOS workshop

Embed Size (px)

Citation preview

Page 1: Running services with Docker on CoreOS workshop

CoreOS Workshop

Page 2: Running services with Docker on CoreOS workshop

Workshop

CoreOS on AWS

Docker

Systemd

Etcd

Page 3: Running services with Docker on CoreOS workshop

CoreOS on AWS• “CoreOS is designed for security, consistency, and

reliability. A single service's code and all dependencies are packaged within a container that can be run on one or many CoreOS machines.”

• AMI : Amazon Machine Image, CoreOS ship their own (Alpha, Beta and Stable release channel)

• Discovery token

• Virtualisation : HVM and PV

Page 4: Running services with Docker on CoreOS workshop

Practice

• Start a 3 node CoreOS cluster on AWS

• Use t2.micro instances

• Check that the nodes see they are in a cluster

• Delete a node, add a new one. Check it adds itself to the cluster

Page 5: Running services with Docker on CoreOS workshop

Docker• “Docker is an open platform for developers and

sysadmins to build, ship, and run distributed applications"

• Containers

• Dockerfiles

• Building, the hub (does everybody have an account?)

Page 6: Running services with Docker on CoreOS workshop

Practice• Write a hello world program (any language, ruby is

cool)

• Add a Dockerfile to your project

• Build a container, run it

• Push it on the hub

• Pull it on your CoreOS cluster, run it there

Page 7: Running services with Docker on CoreOS workshop

Systemd

• “systemd is a suite of system management daemons, libraries, and utilities designed as a central management and configuration platform for the Linux computer operating system”

• Service and unit files

• How to control it on CoreOS : fleet

Page 8: Running services with Docker on CoreOS workshop

Practice

• Write a systemd unit file that start our Docker container

• On a random server

• On a specific server

• On all servers

Page 9: Running services with Docker on CoreOS workshop

Etcd

• “A highly-available key value store for shared configuration and service discovery”

• Shared across CoreOS cluster

• API accessible through command line (etcdctl) or curl-like requests

Page 10: Running services with Docker on CoreOS workshop

Practice• Edit our app to print “Hello $name” where $name

comes from the environment

• Rebuild, push and pull the new container

• Set the variable in etcd

• Read the variable in the systemd unit file

• Restart our service

Page 11: Running services with Docker on CoreOS workshop

Questions ?