Upload
charles-martinot
View
79
Download
0
Embed Size (px)
Citation preview
CoreOS Workshop
Workshop
CoreOS on AWS
Docker
Systemd
Etcd
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
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
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?)
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
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
Practice
• Write a systemd unit file that start our Docker container
• On a random server
• On a specific server
• On all servers
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
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
Questions ?