Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CoreOS - A journey into modern Linux technologies

Avatar for Luca Bruno Luca Bruno
November 09, 2017

CoreOS - A journey into modern Linux technologies

Avatar for Luca Bruno

Luca Bruno

November 09, 2017
Tweet

More Decks by Luca Bruno

Other Decks in Technology

Transcript

  1. “CoreOS Engineer, Debian Developer and enthusiast FLOSS supporter” • OS

    Software Engineer • CoreOS, Berlin office • Eurecom promo ‘13 • Previously: security researcher/engineer $ whoami
  2. “Infrastructure with autopilot: improve reliability and security regarding critical updates,

    machine failures, networking outages” • YC’13 startup • FLOSS-centric company • Offices in SF, NYC, Berlin CoreOS Inc.
  3. Commercial Kubernetes offering by CoreOS. • Focused on automated-operations and

    self-updates • Vanilla upstream software with addons, no forked components • Our opinionated approach to infrastructure • Source of technical materials for this talk :) Tectonic
  4. Base ingredients of our stack: • Kubernetes • Etcd •

    Docker • OS ◦ Distribution: ContainerLinux ◦ Userland: GNU + systemd ◦ Kernel: Linux Technologies
  5. “Container” is a misleading word: • Linux APIs - cgroups,

    namespaces, bindmounts, overlayfs • Lightweight segmentation measure (!= security) Containers
  6. Cgroups: • Resource constraining and allocation • File-based interface -

    /sys/fs/cgroup Namespaces: • Kernel-level resource virtualization and isolation • Mount, network, hostname, IPC, hostname, cgroups • Syscall-based interface - setns(), unshare(), clone() Mounts: • Resource gluing and isolation crossing • Bindmounts - generic path-to-path mounting • Overlayfs - stackable layers of filesystems Containers
  7. Container-based cluster orchestration system. • Schedule workloads across a large

    set of nodes • Segment workloads via containers • Keep track of resource requirements and usage • High level primitives (pods, services, replicas) • Originally by Google Kubernetes
  8. Distributed key-value store. • “Consistent” database (CP in CAP terms)

    ◦ Based on the Raft consensus algorithm [Ongaro’10] • GRPC interface (HTTP2 + protobuf) • Written in Go https://github.com/coreos/etcd etcd
  9. Container runtime and tooling. • Single-stop solution for containers •

    Centralized, daemon-based design • Easy, high-level CLI to cgroups and namespaces Docker
  10. An alternative container runtime. • Daemon-less, single process tree •

    Modular design and isolation ◦ Supports VM, namespaces, plain chroot • Simpler to integrate with existing supervisors https://github.com/rkt/rkt rkt
  11. Dependency-based Linux init system and userspace framework. Main ideas: ◦

    Get rid of custom scripts ◦ Introduce absolute ordering and dependency graph ◦ Introspection via DBus interfaces https://github.com/systemd/systemd Systemd
  12. Linux distribution designed around containers. • Tailor-made for server workloads

    • A different spin on typical Linux distribution • Push toward immutable infrastructure • Our efforts at OS-level innovation ContainerLinux
  13. A compact Linux distribution without a package manager. • Immutable

    OS (read-only /usr) • Autoupdates with A/B partition-scheme • 3 release channels: ◦ Stable - 8 weeks ◦ Beta - 4 weeks ◦ Alpha - 2 weeks ContainerLinux
  14. A compact Linux distribution without a package manager. • Immutable

    OS (read-only /usr) • Autoupdates with A/B partition-scheme • 3 release channels: ◦ Stable - 8 weeks ◦ Beta - 4 weeks ◦ Alpha - 2 weeks ContainerLinux
  15. A compact Linux distribution without a package manager. • Immutable

    OS (read-only /usr) • Autoupdates with A/B partition-scheme • 3 release channels: ◦ Stable - 8 weeks ◦ Beta - 4 weeks ◦ Alpha - 2 weeks ContainerLinux
  16. A compact Linux distribution without a package manager. • Immutable

    OS (read-only /usr) • Autoupdates with A/B partition-scheme • 3 release channels: ◦ Stable - 8 weeks ◦ Beta - 4 weeks ◦ Alpha - 2 weeks ContainerLinux
  17. Autoupdate service and updates management. • Based on Omaha protocol

    (HTTPS + XML + sigs) • Updates flushed to passive partition • Updates applied via reboot • Cluster-wide maintenance scheduling ◦ Either via locksmith or kubernetes addon https://github.com/coreos/locksmith Update-engine
  18. First-boot machine provisioning tool. • Immutable node configuration • Userdata-based

    node setup (PXE and cloud) • Runs early in initrd ◦ Can partition disks, mount volumes, etc. https://github.com/coreos/ignition Ignition
  19. Main language of UNIX world. Pro: • Mature specification and

    toolings • Stable ABI • Close to machine level Cons: • Complete lack of safety • Lots of legacy codebases, messy and hard to review C
  20. Makes it easy to build simple, reliable, and efficient services.

    Pro: • Static typing and coroutines - CSP-style [Hoare’77] • Simple to learn, read and write • Easy to develop concurrent logic Cons: • Lack of generic constructs and data types • Easy to introduce data races • Mandatory runtime ◦ Multi-threaded ◦ Garbage collection Go
  21. Modern system language: safe, concurrent, practical. Pro: • Static typing,

    memory safety, no data races • Avoids global mutable state • Thin runtime (can target bare metal) Cons: • Steep learning curve • Library ecosystem still growing Rust
  22. Questions? - Demo? We have open positions in SF/NYC/BER! Jobs:

    coreos.com/careers - Internships: talk to me