containers and cloud: from lxc to docker to kubernetes
TRANSCRIPT
![Page 1: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/1.jpg)
Containers and Cloud: From LXC to Docker to Kubernetes
Shreyas MMwww.shreyasmm.com
![Page 2: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/2.jpg)
Cloud Systems with Hypervisor
Apps – Django, Rails, Structs, Hybernate
Guest OS – RedHat ,Ubuntu, CentOS
![Page 3: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/3.jpg)
Many payloads
● Backend services (API)● Databases● Distributed stores● Webapps
● Go● Java● Node.js● PHP● Python● Ruby● CherryPy● Django● Flask● Plone
+ Your Code
![Page 4: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/4.jpg)
Many Targets
Your local development environment Your coworkers' development environment Your Q&A team's test environment Some random demo/test server The staging server(s) The production server(s) Bare metal Virtual machines Shared hosting
![Page 5: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/5.jpg)
What the Problem ? The Matrix from Hell
![Page 6: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/6.jpg)
What the Problem ? The Matrix from Hell
![Page 7: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/7.jpg)
Real World Cargo Transport Pre-1960
![Page 8: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/8.jpg)
Another Matrix from Hell
![Page 9: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/9.jpg)
Solution - Containers
![Page 10: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/10.jpg)
Solution: Intermodal Shipping Container
![Page 11: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/11.jpg)
Solution - Containers
![Page 12: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/12.jpg)
Linux Containers (LXC)
• Units of software delivery (ship it!)• Run everywhere
– Regardless of kernel version– Regardless of host distro– (but container and host architecture must match*)
• Run anything– If it can run on the host, it can run in the container– i.e., if it can run on a Linux kernel, it can run
![Page 13: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/13.jpg)
What are Linux Containers exactly?
High level approach: it's a lightweight VM• Own process space• Own network interface• Can run stuff as root• Can have its own /sbin/init
(different from the host)
![Page 14: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/14.jpg)
What are Linux Containers exactly?
Low level approach: it's chroot on steroids• Can also not have its own /sbin/init• Container = isolated process(es)• Share kernel with host
![Page 15: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/15.jpg)
Containers Implementation History
Different OS Implement Differently• Unix – chroot (1979)• FreeBSD – jails• Solaris 11 – zones• HP-UX containers• IBM AIX workload partitions.• Linux - LXC
![Page 16: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/16.jpg)
Docker
• Docker is an open source project• Systematic way to automate the faster deployment of Linux
applications inside portable containers• Docker extends LXC with a kernel-and application-level API that
together run processes in isolation: CPU, memory, I/O, network• Docker containers are created using base images
![Page 17: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/17.jpg)
Docker is a Container System for Code
![Page 18: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/18.jpg)
Docker Eliminates the Matrix from Hell
![Page 19: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/19.jpg)
Docker Eliminates the Matrix from Hell
Containers are Isolated , butShare OS & Where appropriate Bins/Libs
![Page 20: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/20.jpg)
Containers before Docker
![Page 21: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/21.jpg)
Containers After Docker
![Page 22: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/22.jpg)
How Docker Works
• You can build Docker images that hold your applications
• You can create Docker containers from those Docker images to run your applications.
• You can share those Docker images via Docker Hub or your own registry
![Page 23: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/23.jpg)
Docker File
• Like a Makefile (shell script with keywords) • Extends from a Base Image • Results in a new Docker Image • A Docker file lists the steps needed to build an images• docker build is used to run a Docker file• Can define default command for docker run, ports to expose, etc
![Page 24: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/24.jpg)
Docker File
![Page 25: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/25.jpg)
Some Docker Cmds
docker run => Create a new containerdocker stop => Stop a running containerdocker start => Start an existing containerdocker restart => Restart an existing containerdocker ps => List existing containersdocker inspect => Get low-level container/image informationdocker rm => Delete an existing containerdocker exec => Run a command in a running container
![Page 26: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/26.jpg)
Docker Benefits
Packaging and distribution Sandboxing Networking
![Page 27: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/27.jpg)
Docker Benefits
Orchestration Identity Authorization
![Page 28: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/28.jpg)
Kubernetes
Kubernetes is an open sourceorchestration system for containers
![Page 29: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/29.jpg)
Kubernetes
POD = Group of tightly coupled containers ▸ Various services composing an application ▸ All containers always scheduled on same node ▸ Unique IP address per POD ▸ Do not reschedule themselves
CONTROLLER = Implements the control loop ▸ Ensures desired # of pods are running
![Page 30: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/30.jpg)
Kubernetes
Kubernetes is an open sourceorchestration system for containers
![Page 31: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/31.jpg)
POD & CONTROLLER DEFINITION SAMPLE
![Page 32: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/32.jpg)
Kubernetes Services
▸ Logical abstraction for a set of pods ▸ Label selector express which pods implement a given service ▸ Defines a public endpoint similar to a Virtual IP ▸ exposes 1 or more TCP/UDP ports ▸ Forwards requests to pods through DNAT (Destination NAT)
![Page 33: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/33.jpg)
SERVICE DEFINITION SAMPLE
![Page 34: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/34.jpg)
Kubernetes LABELS AND SELECTORS
▸ Labels: metadata (key/value pairs) applied to resources ▸ Examples:
environment = { dev | qa | staging | prod}network_qos = { standard | premium | guaranteed }
![Page 35: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/35.jpg)
Containers, docker, and Kubernetes seem to haveSparked the hope of a universal Cloud application and
Deployment technology.
Conclusion
![Page 36: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/36.jpg)
• Containers and Cloud: From LXC to Docker to Kubernetes –DAVID BERNSTEIN• www.docker.com• www.kubernetes.com• P. Mell and T. Grance, The NIST Definition of Cloud Computing: Recommendations
of the National Institute of Standards and Technology, NIST Special Publication 800-145, 2011.
References
![Page 37: Containers and Cloud: From LXC to Docker to Kubernetes](https://reader036.vdocuments.us/reader036/viewer/2022081505/58ecc1321a28ab951b8b4647/html5/thumbnails/37.jpg)
Thank You
Shreyas MM@MMShreyas
www.shreyasmm.com