Download - Lxd the proper way of runing containers
![Page 1: Lxd the proper way of runing containers](https://reader034.vdocument.in/reader034/viewer/2022051300/588429771a28ab485c8b6fa5/html5/thumbnails/1.jpg)
LXDLXDthe proper way the proper way
of running of running containerscontainers
Marian HackMan MarinovChief System Architect of SiteGround.com
![Page 2: Lxd the proper way of runing containers](https://reader034.vdocument.in/reader034/viewer/2022051300/588429771a28ab485c8b6fa5/html5/thumbnails/2.jpg)
Who am I?Who am I?
![Page 3: Lxd the proper way of runing containers](https://reader034.vdocument.in/reader034/viewer/2022051300/588429771a28ab485c8b6fa5/html5/thumbnails/3.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051300/588429771a28ab485c8b6fa5/html5/thumbnails/4.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051300/588429771a28ab485c8b6fa5/html5/thumbnails/5.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051300/588429771a28ab485c8b6fa5/html5/thumbnails/6.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051300/588429771a28ab485c8b6fa5/html5/thumbnails/7.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051300/588429771a28ab485c8b6fa5/html5/thumbnails/8.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051300/588429771a28ab485c8b6fa5/html5/thumbnails/9.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051300/588429771a28ab485c8b6fa5/html5/thumbnails/10.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051300/588429771a28ab485c8b6fa5/html5/thumbnails/11.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051300/588429771a28ab485c8b6fa5/html5/thumbnails/12.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051300/588429771a28ab485c8b6fa5/html5/thumbnails/13.jpg)
So what can I do with it?So what can I do with it?
![Page 14: Lxd the proper way of runing containers](https://reader034.vdocument.in/reader034/viewer/2022051300/588429771a28ab485c8b6fa5/html5/thumbnails/14.jpg)
![Page 15: Lxd the proper way of runing containers](https://reader034.vdocument.in/reader034/viewer/2022051300/588429771a28ab485c8b6fa5/html5/thumbnails/15.jpg)
Marian HackMan Marinov <[email protected]>hackman @ irc.freenode.net https://github.com/hackman