cni, cri, and oci - oh my! cni... · image formats: a summarised history docker v1 appc docker v2.2...

89
CNI, CRI, and OCI - Oh My!

Upload: others

Post on 01-Aug-2020

17 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

CNI, CRI, and OCI - Oh My!

Page 2: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Who are we ?

Elsie Phillips Paul Burt

Page 3: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

This talk is standards +containers

Page 4: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

What’s a standard?

Page 5: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Something those ISO folks make

Page 6: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

“Whatever the country, whatever the language, we

are always ISO”

Page 7: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

A standard we know:Javascript

Page 8: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

I hate javascript(Why would you use that as your example?)

Page 9: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No
Page 10: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No
Page 11: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

You could hate JS so much more...

Page 12: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

You could hate JS so much more

Page 13: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

You would hate JS so much more...

Page 14: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

The same way JS enables multiple browsers to thrive

Page 15: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No
Page 16: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

What’s a container?

Page 17: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

What’s a container?(Oh no, are these noobs really

doing this at Kubecon ?)

Page 18: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

What is a container?

It’s a TAR file.

What is a container?

It’s a TAR file.

AKA

Page 19: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Containers are . . .CgroupsChrootUnshareNsenterBind mounts

TAR files +

Page 20: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Linux Magic

Page 22: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Why containers?idk, why do ducks float?

Page 23: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Hell is other people’s development environment

Hell is other people’s development environment

Page 24: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

CNIContainer Network Interface

Page 25: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No
Page 26: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Zoom,Enhance!

Page 27: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

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: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

CNI vs CNMMuhammad Ali vs Joe Frazier

Page 29: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No
Page 30: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

“...both are driver-based models, or plugin-based, for creating and managing network stacks for containers.”

Page 31: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

“CNM is designed to support the Docker

runtime engine only. ”

Page 32: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No
Page 33: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

“Kubernetes is a system that supports multiple container runtimes, of which Docker is just one.”

Page 34: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No
Page 35: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

“ … voted to accept CNI (Container Networking Interface) as the 10th hosted project”

Page 36: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

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

Page 37: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

The runtime creates a network namespace

Page 38: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

The runtime reads a JSON config

Page 39: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

The runtime executes a plugin named by the config (with the ADD command)

Page 40: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

The plugin finds out what to do from JSON streamed to stdin

Page 41: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

The plugin does it’s thing

Page 42: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

If there’s an error, the runtime tells the plugin to delete (DEL)

Page 43: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Otherwise, the runtime cleans up (DEL) at the end of the lifecycle

Page 44: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No
Page 45: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Notable developments this year

- IPv6 support

- plugin chaining

- port-forwarding

Page 46: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

CNIAll the cool plugins are doing it

Page 47: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

CRIContainer Runtime Interface

Page 48: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

CRIContainer Runtime Interface

Page 49: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

CRIContainer Runtime Interface“Docker and rkt were integrated directly and

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

Page 50: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No
Page 51: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

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 52: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

CRI Timeline

1.8CRI test suite + CLI tools.

1.9CRI stats stats stats!

Sep 29

Dec ??

Page 53: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

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

kind of way

Page 54: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No
Page 55: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Demo

Page 56: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

CRIWe won’t need a different software

ecosystem for every container format? Thank goodness.

Page 57: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

OCI

Page 58: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

and the journey to standards

Page 59: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

An image formatA container runtime

A log collection daemonAn init system and process babysitter

A container image build systemA remote management API

Page 60: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

An image formatA container runtime

A log collection daemonAn init system and process babysitter

A container image build systemA remote management API

Page 61: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

An image format... the thing we want to standardise

Page 62: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Mid 2014

Page 63: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Docker Image Format Circa 2014● Fluid format and evolution

○ No specification, just implementation○ No guarantees of interoperability for other tool writers

● Not content-addressable○ No way to verify integrity or leverage CAS

● No name delegation/discovery (e.g. MX records)○ Centralised/siloed distribution

● No mechanism for signing○ No way to attest content

Page 64: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Dec 2014

Page 65: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

App Container (appc)

Page 66: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

appc image in a nutshell

● Image Format (ACI)○ what does an application consist of?

● Image Discovery○ how can an image be located?

● Content-addressability○ what is the cryptographic id of an image?

● Signing○ how is an image signed and verified?

Page 67: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

April 2015

Page 68: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Docker v2.2 Image Format Circa 2015

● Versioned v2.0, v2.1, v2.2 schema○ Still vendor-specific, but (mostly) documented!

● Content-addressable● No name delegation/discovery ● Optional and separately-defined signing

Page 69: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Two separate worlds...

aka the "Container Wars"

Page 70: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

June 2015-Present

OCI

Page 71: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No
Page 72: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No
Page 73: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

● Define what a container is in an open way so everyone can implement it○ How to package, annotate, distribute, run, ...○ Facilitate independent, interoperable tools

Why does OCI exist?

Page 74: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

● Define what a container is in an open way so everyone can implement it○ How to package, annotate, distribute, run, ...○ Facilitate independent, interoperable tools

● Unify the best ideas from Docker, appc, etc○ Content addressability, composability, signing○ End the so-called "Container Wars"

Why does OCI exist?

Page 75: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

OCI Members

Page 76: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

What makes up the standard?

Page 77: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

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

The OCI standards

Page 78: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

● Portable archive format● Composed of:

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

OCI Image Spec

Page 79: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No
Page 80: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

● On-disk layout of a container○ Extracted root filesystem and configuration, ready to

run● Lifecycle verbs

○ create, start, kill, delete, state

● Multi-platform support○ Shared general configuration○ Windows/Solaris/Linux-specific bits

OCI Runtime Spec

Page 81: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

What happened to appc?

Page 82: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Image formats: a summarised historyDocker v1 appc Docker v2.2 OCI

Introduced 2013 December 2014 April 2015 April 2016

Content-addressable

No Yes Yes Yes

Signable No Yes, optional Yes, optional Yes, optional

Federated namespace

Yes Yes Yes Yes

Delegatable DNS namespace

No Yes No Yes

Page 83: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No
Page 84: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

So, that’s it?

Page 85: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Lol, nopeLots to be done still

Page 86: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Standards will continue to evolve

Page 87: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Standards naturally lead to more options for users

Page 88: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

And that’s something worth being passionate about.

Page 89: CNI, CRI, and OCI - Oh My! CNI... · Image formats: a summarised history Docker v1 appc Docker v2.2 OCI Introduced 2013 December 2014 April 2015 April 2016 Content-addressable No

Check out Open Cloud Services on

CoreOS.com/blog