what’s hype and what’s ripe? learning the fundamentals of … · 2019. 12. 21. · what is a...

66

Upload: others

Post on 28-Feb-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore
Page 2: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

What’s Hype and What’s Ripe? Learning the Fundamentals of

Docker and KubernetesPaul Burt, Red HatPaul Burt, Red Hat

Page 3: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

What is a container? Why are they catching on? In this introductory tutorial, we’ll explore how to run a container on your laptop, in addition to answering these questions.

We’ll look at how to build a container and the importance of building your own or using trusted containers. We’ll look at recent studies on the health of “public registries”, discuss what they are, and how you can easily avoid their security risks with a bit of pragmatism.

After that, we’ll get our hands dirty looking at the tools required to build and run containers at a small scale. We’ll answer questions like why do container deployments often grow to such a large scale, and what changes about the way we should run them when looking at a large scale? We’ll explore the importance of automation, using the story of Knight Capital as a cautionary tale.

We’ll look at common architectures, work through some tutorials for Docker and Kubernetes on katacoda, and map out the dizzying landscape that is the CNCF Landscape. The goal of this tutorial is to introduce you to containers if you’re new to the scene and fill in gaps-in-knowledge for veterans of the container ecosystem.

Page 4: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

What the heck is Kubernetes?

Slides: goo.gl/oPUmcZ

Page 5: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

This talk isContainers +Kubernetes

Page 6: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore
Page 7: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

“Did anyone make a large purchase recently? A house, an expensive car? How many of you made that purchase by just looking at the benefits, and not looking at the price?”

– R. Meshenberg

Page 8: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

What’s a container?

Page 9: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

What is a container?

It’s a TAR file.

What is a container?

It’s a TAR file.

AKA

Page 10: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Containers are . . .CgroupsChrootUnshareNsenterBind mounts

TAR files +

Page 11: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Linux Magic

Page 13: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

For History on containers see B. Cantrill’s talk

goo.gl/1m1G3b

Page 14: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Why containers?idk, why do ducks float?

Page 15: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Hell is other people’s development environment

Hell is other people’s development environment

Page 16: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore
Page 17: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

TL;DR of how it worksAin’t nobody got time to read specs

Page 18: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore
Page 19: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore
Page 20: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

The runtime manages the lifecycle of a container (including plugins)

Page 21: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

An image formatA container runtime

A log collection daemonAn init system and process babysitter

A container image build systemA remote management API

Page 22: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Two separate but connected specifications● image-spec: what's in a container● runtime-spec: how to run a container

The OCI standards

Page 23: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

● Portable archive format● Composed of:

○ image manifest○ image index (optional)○ filesystem layers○ configuration

OCI Image Spec

Page 24: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore
Page 25: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore
Page 26: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Zoom,Enhance!

Page 27: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

CNI concerns itself only with network connectivity of containers and removing allocated resources when the container is deleted.

CNI concerns itself only with network connectivity of containers and removing allocated resources when the container is deleted.

Page 28: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

CRIContainer Runtime Interface

Page 29: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

CRIContainer Runtime Interface“Docker and rkt were integrated directly and

deeply into the kubelet source code through an internal and volatile interface.”

Page 30: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore
Page 31: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

CRI Timeline

1.5 alpha out

1.6 Docker CRI gets beta + enabled by default

1.7 Docker CRI goes GAJun 30

Mar 28

Dec 12

2017

Page 32: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

That’s exciting...In a Mom & Dad got me socks for X-mas

kind of way

Page 33: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore
Page 34: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore
Page 35: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

CNI, CRI, and OCI - Oh My!

goo.gl/fK8kFS

Page 36: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

So, that’s it?

Page 37: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

But... How do we run containers?

Page 38: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

I know! This is where we talk about Kubernetes.

Page 39: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

I know! This is where we talk about Kubernetes.

Nope

Page 40: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Systemd is sufficient management for a single host

Page 41: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore
Page 42: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

So, why the excitement about Kubernetes?

Page 43: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Distributed systems,Immutable infrastructure,

CAP Theorem, Pets vs Cattle,etc...

Page 44: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

1. The network is reliable.

2. Latency is zero.

3. Bandwidth is infinite.

4. The network is secure.

5. Topology doesn't change.

6. There is one administrator.

7. Transport cost is zero.

8. The network is homogeneous.

Fallacies of distributed computing

Page 45: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Distributed systems are hard

Page 46: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

So, what is Kubernetes?(specifically)

Page 47: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore
Page 49: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

For our purposes, we can think of the machinery as the control plane and the kubelet

Page 50: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Popping the hood is different than driving

Page 51: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Pods and Services

Page 52: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore
Page 53: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Give this a name

Page 54: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Design patterns for container-based distributed

systemsgoo.gl/MrJEj8

Page 55: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

NIST Application Container Security Guide

goo.gl/bkmG7i

Page 56: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

DIY Kubernetes

I assure you, Lord Vader, my men are working as fast they can.

Page 57: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

$ rkt run presentation# everyone claps# drink a beer$

rkt run...

Page 58: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Hello Darkness, my old friend...

Page 59: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

To get started you need an image registry + cluster

Page 60: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Image Registries

Page 61: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore
Page 62: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Clusters

Every Cloud and Linux vendor

+

Page 63: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore
Page 64: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore
Page 65: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore

Let’s get our hands dirty with Kubernetes

learn.openshift.comSlides: goo.gl/oPUmcZ

Page 66: What’s Hype and What’s Ripe? Learning the Fundamentals of … · 2019. 12. 21. · What is a container? Why are they catching on? In this introductory tutorial, we’ll explore