Lxd the proper way of runing containers

15
LXD LXD the proper way the proper way of running of running containers containers Marian HackMan Marinov Chief System Architect of SiteGround.com <[email protected]>

Transcript of Lxd the proper way of runing containers

Page 1: Lxd   the proper way of runing containers

LXDLXDthe proper way the proper way

of running of running containerscontainers

Marian HackMan MarinovChief System Architect of SiteGround.com

<[email protected]>

Page 2: Lxd   the proper way of runing containers

Who am I?Who am I?

Page 3: Lxd   the proper way of runing containers

Why containers?Why containers?

➢ Density

➢ KVM has to reserve memory for its guests

➢ Container is a simple process under the same kernel, so its children can share the whole machine, and do so in collaboration, because they use the same memory manager.

Page 4: Lxd   the proper way of runing containers

Why containers?Why containers?

➢ Startup time

➢ KVM 25 sec (can be optimized to around 8)

➢ Container 1.5 sec

➢ KVM 37 guests in 943sec

➢ Container 536 guests in 828sec

Intel Server with 16GB of RAM

Page 5: Lxd   the proper way of runing containers

Why containers?Why containers?

➢ Latency

Physical hardware

Linux Kernel

Host Operating System

Guest OS

Virtual Machine

Linux Kernel

Page 6: Lxd   the proper way of runing containers

Why containers?Why containers?

➢ Latency

Physical hardware

Linux Kernel

Host Operating System

Guest OS

Virtual Machine

Linux Kernel

Page 7: Lxd   the proper way of runing containers

Why containers?Why containers?

➢ Latency

Physical hardware

Linux Kernel

Host Operating System

Guest OS

Virtual Machine

Linux Kernel

Guest OS

Virtual Machine

Linux Kernel

Page 8: Lxd   the proper way of runing containers

Why containers?Why containers?

➢ Latency

Physical hardware

Linux Kernel

Host Operating System

Guest OS

Virtual Machine

Linux Kernelinit

sshd

init

sshd

init

sshd

bridge

Page 9: Lxd   the proper way of runing containers

What is LXD?What is LXD?

➢ A front-end for LXC

➢ Enables easier management of LXC containers

Page 10: Lxd   the proper way of runing containers

What is LXC?What is LXC?

➢ Linux Containers

➢ The initial project to create what we call containers today

➢ Userspace interface for the Linux kernel containment features

Page 11: Lxd   the proper way of runing containers

So why LXD then?So why LXD then?

➢ RESTful API

➢ Ability to work with remote installations

➢ Ability to control multiple LXD nodes

➢ Better command line interface

➢ Easier management

➢ storage

➢ network

➢ limits

➢ migration (including live)

Page 12: Lxd   the proper way of runing containers

InstallationInstallation

➢ Works out of the box on recent Ubuntu

➢ On Debian and CentOS it is a bit annoying

➢ you need go 1.6+

➢ latest lxc(2.0), which you can only build from source

➢ a lot of other dependencies

➢ it takes about an hour

Page 13: Lxd   the proper way of runing containers

So what can I do with it?So what can I do with it?

Page 14: Lxd   the proper way of runing containers
Page 15: Lxd   the proper way of runing containers

Marian HackMan Marinov <[email protected]>hackman @ irc.freenode.net https://github.com/hackman