Introduction to 
CoreOS 
Timo Derstappen 
@teemow
Simple service orchestration, 
built for developers. 
Based in Cologne, Germany. 
Ten terrific folks, and hiring! 
http://giantswarm.io/
What is CoreOS?
Minimal Linux 
CoreOS enables warehouse-scale computing 
on top of a minimal, modern operating 
system. 
A new Linux Distribution to provide features 
needed to run modern infrastructure stacks.
Features 
● Automatic Updates 
● Docker Containers 
● Cluster management 
● Service Discovery
Linux Basis 
● Based on Gentoo 
● systemd 
● btrfs 
● Images for PXE, 
OpenStack, AWS, 
GCE, Vagrant
“Immutable” System 
● Read-only rootfs 
● Writeable overlay on /etc
No classic package manager 
● ChromeOS inspired update engine 
● Atomic Updates 
● Rollbacks 
● Using Docker to distribute software
CoreOS own tools 
● Etcd 
● Locksmith 
● Cloud-config 
● Flannel 
● Fleet 
https://github.com/coreos
Etcd 
A highly-available key value store for shared 
configuration and service discovery.
Etcd 
● Basis for 
> Configuration management 
> Service Discovery 
● REST Interface 
● Raft consensus algorithm 
http://raftconsensus.github.io/
Etcd Cluster
Discovery API 
$> curl https://discovery.etcd.io/new 
https://discovery.etcd. 
io/463c1435f9f63c952e0899b1f459c0fe 
$> curl -s https://discovery.etcd. 
io/463c1435f9f63c952e0899b1f459c0fe | jq ".node. 
nodes[].value" 
"http://172.31.19.1:7001" 
"http://172.31.19.0:7001" 
"http://172.31.18.255:7001"
Locksmith 
Reboot manager for the CoreOS update 
engine.
Locksmith 
● Reboot strategies for CoreOS updates 
● Uses etcd for distributed locks 
● Alpha, Beta, Stable channels
Cloud Config 
Customize a CoreOS machine through user-data.
Cloud Config 
● Initialization of your instances 
● Configure etcd, fleet, locksmith 
● YAML file 
● eg. EC2 user-data, Autoscaler launch-config
Configure your cluster 
#cloud-config 
coreos: 
update: 
reboot-strategy: etcd-lock
Configure your cluster 
#cloud-config 
coreos: 
update: 
reboot-strategy: etcd-lock 
etcd: 
discovery: https://discovery.etcd.io/<token>
Configure your cluster 
#cloud-config 
coreos: 
update: 
reboot-strategy: etcd-lock 
etcd: 
discovery: https://discovery.etcd.io/<token> 
users: 
- name: teemow 
coreos-ssh-import-github: teemow
Flannel 
Overlay networks backed by etcd.
Cloud overlay network 
● One subnet per machine 
● Get rid of docker port mapping 
● Let containers talk to each other via IP 
addresses
Backends 
● Encapsulate packets in UDP 
● VXLAN implementation coming
Fleet 
Systemd for the cluster
Fleet 
● CLI and API to start your containers 
● Uses etcd and systemd
Fleet deployment
Fleet Scheduler 
● Relatively simple 
> By meta data 
> Same machine/exclusion 
● Resolve service dependencies! 
● More to come 
> Resource management (CPU, memory etc.)
Unit file 
[Unit] 
Description=A Redis Server 
[Service] 
TimeoutStartSec=0 
ExecStartPre=/usr/bin/docker pull teemow/redis 
ExecStart=/usr/bin/docker run --rm -p 6379 --name %n 
teemow/redis 
ExecStop=/usr/bin/docker stop %n
Manage a service 
$> fleetctl start redis.service 
$> fleetctl list-units 
$> fleetctl status redis.service 
$> fleetctl journal redis.service 
$> fleetctl stop redis.service 
$> fleetctl destroy redis.service
Service Discovery
Three-Tier Application 
● Load Balancer 
● App 
● Database
Sidekick 
Keep 
configuration out 
of your app
Ambassador 
Reverse proxy for 
your service 
Keep service 
discovery 
out of your app
Using CoreOS
CoreOS 
● Great foundation to create flexible 
distributed infrastructures 
● Unix philosophy
Kubernetes 
● Google 
Container 
Orchestration 
● Runs on top of 
CoreOS
cAdvisor 
● Monitoring for your 
containers 
● Collects, 
aggregates and 
processes metrics 
● InfluxDB Backend 
● Monitoring of 
clusters with 
Heapster
Deis 
Heroku-like Open 
Source PaaS
Panamax 
● Web interface to start multi container apps 
● App Templates on Github 
● Open Source project from CenturyLink 
Labs
We ♥ CoreOS
There is a Meetup in Cologne 
Docker Cologne - CoreOS Meetup 
19:00, 14th October 
Startplatz 
Brandon Philips, CTO of CoreOS 
Luke Marsden, CTO of Flocker
Sign up for the 
Giant Swarm private Beta 
Request Invite 
http://giantswarm.io/
Thanks for listening! 
Reach out: 
Timo Derstappen 
@teemow 
@giantswarm

CoreOS @Codetalks Hamburg

  • 1.
    Introduction to CoreOS Timo Derstappen @teemow
  • 2.
    Simple service orchestration, built for developers. Based in Cologne, Germany. Ten terrific folks, and hiring! http://giantswarm.io/
  • 3.
  • 4.
    Minimal Linux CoreOSenables warehouse-scale computing on top of a minimal, modern operating system. A new Linux Distribution to provide features needed to run modern infrastructure stacks.
  • 5.
    Features ● AutomaticUpdates ● Docker Containers ● Cluster management ● Service Discovery
  • 6.
    Linux Basis ●Based on Gentoo ● systemd ● btrfs ● Images for PXE, OpenStack, AWS, GCE, Vagrant
  • 7.
    “Immutable” System ●Read-only rootfs ● Writeable overlay on /etc
  • 8.
    No classic packagemanager ● ChromeOS inspired update engine ● Atomic Updates ● Rollbacks ● Using Docker to distribute software
  • 9.
    CoreOS own tools ● Etcd ● Locksmith ● Cloud-config ● Flannel ● Fleet https://github.com/coreos
  • 10.
    Etcd A highly-availablekey value store for shared configuration and service discovery.
  • 11.
    Etcd ● Basisfor > Configuration management > Service Discovery ● REST Interface ● Raft consensus algorithm http://raftconsensus.github.io/
  • 12.
  • 13.
    Discovery API $>curl https://discovery.etcd.io/new https://discovery.etcd. io/463c1435f9f63c952e0899b1f459c0fe $> curl -s https://discovery.etcd. io/463c1435f9f63c952e0899b1f459c0fe | jq ".node. nodes[].value" "http://172.31.19.1:7001" "http://172.31.19.0:7001" "http://172.31.18.255:7001"
  • 14.
    Locksmith Reboot managerfor the CoreOS update engine.
  • 15.
    Locksmith ● Rebootstrategies for CoreOS updates ● Uses etcd for distributed locks ● Alpha, Beta, Stable channels
  • 16.
    Cloud Config Customizea CoreOS machine through user-data.
  • 17.
    Cloud Config ●Initialization of your instances ● Configure etcd, fleet, locksmith ● YAML file ● eg. EC2 user-data, Autoscaler launch-config
  • 18.
    Configure your cluster #cloud-config coreos: update: reboot-strategy: etcd-lock
  • 19.
    Configure your cluster #cloud-config coreos: update: reboot-strategy: etcd-lock etcd: discovery: https://discovery.etcd.io/<token>
  • 20.
    Configure your cluster #cloud-config coreos: update: reboot-strategy: etcd-lock etcd: discovery: https://discovery.etcd.io/<token> users: - name: teemow coreos-ssh-import-github: teemow
  • 21.
    Flannel Overlay networksbacked by etcd.
  • 22.
    Cloud overlay network ● One subnet per machine ● Get rid of docker port mapping ● Let containers talk to each other via IP addresses
  • 23.
    Backends ● Encapsulatepackets in UDP ● VXLAN implementation coming
  • 24.
    Fleet Systemd forthe cluster
  • 25.
    Fleet ● CLIand API to start your containers ● Uses etcd and systemd
  • 26.
  • 27.
    Fleet Scheduler ●Relatively simple > By meta data > Same machine/exclusion ● Resolve service dependencies! ● More to come > Resource management (CPU, memory etc.)
  • 28.
    Unit file [Unit] Description=A Redis Server [Service] TimeoutStartSec=0 ExecStartPre=/usr/bin/docker pull teemow/redis ExecStart=/usr/bin/docker run --rm -p 6379 --name %n teemow/redis ExecStop=/usr/bin/docker stop %n
  • 29.
    Manage a service $> fleetctl start redis.service $> fleetctl list-units $> fleetctl status redis.service $> fleetctl journal redis.service $> fleetctl stop redis.service $> fleetctl destroy redis.service
  • 30.
  • 31.
    Three-Tier Application ●Load Balancer ● App ● Database
  • 32.
  • 33.
    Ambassador Reverse proxyfor your service Keep service discovery out of your app
  • 34.
  • 35.
    CoreOS ● Greatfoundation to create flexible distributed infrastructures ● Unix philosophy
  • 36.
    Kubernetes ● Google Container Orchestration ● Runs on top of CoreOS
  • 37.
    cAdvisor ● Monitoringfor your containers ● Collects, aggregates and processes metrics ● InfluxDB Backend ● Monitoring of clusters with Heapster
  • 38.
  • 39.
    Panamax ● Webinterface to start multi container apps ● App Templates on Github ● Open Source project from CenturyLink Labs
  • 40.
  • 41.
    There is aMeetup in Cologne Docker Cologne - CoreOS Meetup 19:00, 14th October Startplatz Brandon Philips, CTO of CoreOS Luke Marsden, CTO of Flocker
  • 42.
    Sign up forthe Giant Swarm private Beta Request Invite http://giantswarm.io/
  • 43.
    Thanks for listening! Reach out: Timo Derstappen @teemow @giantswarm