CoreOS intro

4,177 views

Published on

An introduction to CoreOS for the Docker Cologne Meetup.

Published in: Software, Technology

CoreOS intro

  1. 1. Timo Derstappen @teemow CoreOS Introduction
  2. 2. CoreOS ● Minimal OS to host your containers ● Automatic Updates ● Cluster Management ● Service Discovery
  3. 3. CoreOS ● distributed containers ● configuration in etcd
  4. 4. CoreOS 101 ● minimal Gentoo ● PXE, KVM, AWS, OpenStack, Vagrant ● read-only rootfs (writable overlay) ● cloud config ● etcd ● systemd / fleet ● locksmith
  5. 5. Cloud Config ● handles early initialization of a cloud instance ● configure fleet, etcd ● create users ● write files ● etc...
  6. 6. Etcd ● Highly available K/V store ● Basis for ○ Configuration management ○ Service Discovery ● Raft consensus algorithm ● Discovery API ● REST Interface
  7. 7. Locksmith ● reboot strategies for CoreOS updates ● uses etcd for distributed locks
  8. 8. Fleet ● Define and launch containers ● Fleet is systemd for the cluster ● Utilizes etcd + systemd
  9. 9. Unit file [Unit] Description=A Redis Server [Service] TimeoutStartSec=0 EnvironmentFile=/etc/environment Environment="IMAGE=teemow/redis" ExecStartPre=/usr/bin/docker pull $IMAGE ExecStart=/bin/bash -c "exec /usr/bin/docker run --rm -p $COREOS_PRIVATE_IPV4::6379 --name %n $IMAGE" ExecStop=-/usr/bin/docker kill %n
  10. 10. Launch a service # start fleetctl --tunnel my.coreos-cluster.com start redis.service # status fleetctl --tunnel my.coreos-cluster.com list-units fleetctl --tunnel my.coreos-cluster.com status redis.service fleetctl --tunnel my.coreos-cluster.com journal redis.service # stop fleetctl --tunnel my.coreos-cluster.com stop redis.service fleetctl --tunnel my.coreos-cluster.com destroy redis.service
  11. 11. CoreOS ● distributed containers ● configuration in etcd
  12. 12. Sidekick ● Keep configuration out of your app
  13. 13. Ambassador ● Reverse proxy for your service ● Keep service discovery out of your app
  14. 14. CoreOS ● Great foundation to create flexible distributed infrastructures ● Unix philosophy
  15. 15. Lessons Learned ● 150+ Instances on AWS ● Micro Services ● Polyglot Persistence ● DevOps

×