CoreOS @Codetalks Hamburg

43
Introduction to CoreOS Timo Derstappen @teemow

description

Introduction to CoreOS

Transcript of CoreOS @Codetalks Hamburg

Page 1: CoreOS @Codetalks Hamburg

Introduction to CoreOS

Timo Derstappen@teemow

Page 2: CoreOS @Codetalks Hamburg

Simple service orchestration, built for developers.

Based in Cologne, Germany.Ten terrific folks, and hiring!

http://giantswarm.io/

Page 3: CoreOS @Codetalks Hamburg

What is CoreOS?

Page 4: CoreOS @Codetalks Hamburg

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.

Minimal Linux

Page 5: CoreOS @Codetalks Hamburg

Features

● Automatic Updates● Docker Containers● Cluster management● Service Discovery

Page 6: CoreOS @Codetalks Hamburg

Linux Basis

● Based on Gentoo● systemd● btrfs● Images for PXE,

OpenStack, AWS, GCE, Vagrant

Page 7: CoreOS @Codetalks Hamburg

“Immutable” System

● Read-only rootfs● Writeable overlay on /etc

Page 8: CoreOS @Codetalks Hamburg

No classic package manager

● ChromeOS inspired update engine● Atomic Updates● Rollbacks● Using Docker to distribute software

Page 9: CoreOS @Codetalks Hamburg

CoreOS own tools

● Etcd● Locksmith● Cloud-config● Flannel● Fleet

https://github.com/coreos

Page 10: CoreOS @Codetalks Hamburg

EtcdA highly-available key value store for shared configuration and service discovery.

Page 11: CoreOS @Codetalks Hamburg

Etcd

● Basis for> Configuration management> Service Discovery

● REST Interface● Raft consensus algorithm

http://raftconsensus.github.io/

Page 12: CoreOS @Codetalks Hamburg

Etcd Cluster

Page 13: CoreOS @Codetalks Hamburg

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"

Page 14: CoreOS @Codetalks Hamburg

LocksmithReboot manager for the CoreOS update engine.

Page 15: CoreOS @Codetalks Hamburg

Locksmith

● Reboot strategies for CoreOS updates● Uses etcd for distributed locks● Alpha, Beta, Stable channels

Page 16: CoreOS @Codetalks Hamburg

Cloud ConfigCustomize a CoreOS machine through user-data.

Page 17: CoreOS @Codetalks Hamburg

Cloud Config

● Initialization of your instances● Configure etcd, fleet, locksmith● YAML file● eg. EC2 user-data, Autoscaler launch-

config

Page 18: CoreOS @Codetalks Hamburg

Configure your cluster

#cloud-config

coreos:

update:

reboot-strategy: etcd-lock

Page 19: CoreOS @Codetalks Hamburg

Configure your cluster

#cloud-config

coreos:

update:

reboot-strategy: etcd-lock

etcd:

discovery: https://discovery.etcd.io/<token>

Page 20: CoreOS @Codetalks Hamburg

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

Page 21: CoreOS @Codetalks Hamburg

FlannelOverlay networks backed by etcd.

Page 22: CoreOS @Codetalks Hamburg

Cloud overlay network

● One subnet per machine● Get rid of docker port mapping● Let containers talk to each other via IP

addresses

Page 23: CoreOS @Codetalks Hamburg

Backends

● Encapsulate packets in UDP● VXLAN implementation coming

Page 24: CoreOS @Codetalks Hamburg

FleetSystemd for the cluster

Page 25: CoreOS @Codetalks Hamburg

Fleet

● CLI and API to start your containers● Uses etcd and systemd

Page 26: CoreOS @Codetalks Hamburg

Fleet deployment

Page 27: CoreOS @Codetalks Hamburg

Fleet Scheduler

● Relatively simple> By meta data> Same machine/exclusion

● Resolve service dependencies!● More to come

> Resource management (CPU, memory etc.)

Page 28: CoreOS @Codetalks Hamburg

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

Page 29: CoreOS @Codetalks Hamburg

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

Page 30: CoreOS @Codetalks Hamburg

Service Discovery

Page 31: CoreOS @Codetalks Hamburg

Three-Tier Application

● Load Balancer● App● Database

Page 32: CoreOS @Codetalks Hamburg

Sidekick

Keep configuration out of your app

Page 33: CoreOS @Codetalks Hamburg

Ambassador

Reverse proxy for your serviceKeep service discovery out of your app

Page 34: CoreOS @Codetalks Hamburg

Using CoreOS

Page 35: CoreOS @Codetalks Hamburg

CoreOS

● Great foundation to create flexible distributed infrastructures

● Unix philosophy

Page 36: CoreOS @Codetalks Hamburg

Kubernetes

● Google Container Orchestration

● Runs on top of CoreOS

Page 37: CoreOS @Codetalks Hamburg

cAdvisor

● Monitoring for your containers

● Collects, aggregates and processes metrics

● InfluxDB Backend● Monitoring of

clusters with Heapster

Page 38: CoreOS @Codetalks Hamburg

Deis

Heroku-like Open Source PaaS

Page 39: CoreOS @Codetalks Hamburg

Panamax

● Web interface to start multi container apps● App Templates on Github● Open Source project from CenturyLink

Labs

Page 40: CoreOS @Codetalks Hamburg

We ♥ CoreOS

Page 41: CoreOS @Codetalks Hamburg

Docker Cologne - CoreOS Meetup

19:00, 14th OctoberStartplatz

Brandon Philips, CTO of CoreOSLuke Marsden, CTO of Flocker

There is a Meetup in Cologne

Page 42: CoreOS @Codetalks Hamburg

Sign up for theGiant Swarm private Beta

Request Invite

http://giantswarm.io/

Page 43: CoreOS @Codetalks Hamburg

Thanks for listening!Reach out:Timo Derstappen@teemow@giantswarm