+ All Categories
Home > Technology > Containers and Cloud: From LXC to Docker to Kubernetes

Containers and Cloud: From LXC to Docker to Kubernetes

Date post: 11-Apr-2017
Category:
Upload: shreyas-mm
View: 1,597 times
Download: 9 times
Share this document with a friend
37
Containers and Cloud: From LXC to Docker to Kubernetes Shreyas MM www.shreyasmm.com
Transcript
Page 1: Containers and Cloud: From LXC to Docker to Kubernetes

Containers and Cloud: From LXC to Docker to Kubernetes

Shreyas MMwww.shreyasmm.com

Page 2: Containers and Cloud: From LXC to Docker to Kubernetes

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

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

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

What the Problem ? The Matrix from Hell

Page 6: Containers and Cloud: From LXC to Docker to Kubernetes

What the Problem ? The Matrix from Hell

Page 7: Containers and Cloud: From LXC to Docker to Kubernetes

Real World Cargo Transport Pre-1960

Page 8: Containers and Cloud: From LXC to Docker to Kubernetes

Another Matrix from Hell

Page 9: Containers and Cloud: From LXC to Docker to Kubernetes

Solution - Containers

Page 10: Containers and Cloud: From LXC to Docker to Kubernetes

Solution: Intermodal Shipping Container

Page 11: Containers and Cloud: From LXC to Docker to Kubernetes

Solution - Containers

Page 12: Containers and Cloud: From LXC to Docker to Kubernetes

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

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

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

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

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

Docker is a Container System for Code

Page 18: Containers and Cloud: From LXC to Docker to Kubernetes

Docker Eliminates the Matrix from Hell

Page 19: Containers and Cloud: From LXC to Docker to Kubernetes

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

Containers before Docker

Page 21: Containers and Cloud: From LXC to Docker to Kubernetes

Containers After Docker

Page 22: Containers and Cloud: From LXC to Docker to Kubernetes

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

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

Docker File

Page 25: Containers and Cloud: From LXC to Docker to Kubernetes

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

Docker Benefits

Packaging and distribution Sandboxing Networking

Page 27: Containers and Cloud: From LXC to Docker to Kubernetes

Docker Benefits

Orchestration Identity Authorization

Page 28: Containers and Cloud: From LXC to Docker to Kubernetes

Kubernetes

Kubernetes is an open sourceorchestration system for containers

Page 29: Containers and Cloud: From LXC to Docker to Kubernetes

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

Kubernetes

Kubernetes is an open sourceorchestration system for containers

Page 31: Containers and Cloud: From LXC to Docker to Kubernetes

POD & CONTROLLER DEFINITION SAMPLE

Page 32: Containers and Cloud: From LXC to Docker to Kubernetes

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

SERVICE DEFINITION SAMPLE

Page 34: Containers and Cloud: From LXC to Docker to Kubernetes

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

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

• 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

Thank You

Shreyas MM@MMShreyas

www.shreyasmm.com


Recommended