introduction to microservices with docker and kubernetes

48
All Aboard the Buzzword Express (or - what are Docker and Kubernetes?) Dave Charles @cobecto

Upload: david-charles

Post on 15-Apr-2017

142 views

Category:

Software


7 download

TRANSCRIPT

Page 1: Introduction to Microservices with Docker and Kubernetes

All Aboard the Buzzword Express(or - what are Docker and Kubernetes?)

Dave Charles@cobecto

Page 2: Introduction to Microservices with Docker and Kubernetes
Page 3: Introduction to Microservices with Docker and Kubernetes
Page 4: Introduction to Microservices with Docker and Kubernetes
Page 5: Introduction to Microservices with Docker and Kubernetes
Page 6: Introduction to Microservices with Docker and Kubernetes
Page 7: Introduction to Microservices with Docker and Kubernetes

DDN

Page 8: Introduction to Microservices with Docker and Kubernetes

DDN

DHS

Page 9: Introduction to Microservices with Docker and Kubernetes

DDN

DHS

DVCS

Page 10: Introduction to Microservices with Docker and Kubernetes
Page 11: Introduction to Microservices with Docker and Kubernetes
Page 12: Introduction to Microservices with Docker and Kubernetes

?

Page 13: Introduction to Microservices with Docker and Kubernetes
Page 14: Introduction to Microservices with Docker and Kubernetes
Page 15: Introduction to Microservices with Docker and Kubernetes

Duh - This is just SOA?

Page 16: Introduction to Microservices with Docker and Kubernetes

Duh - This is just SOA?

Page 17: Introduction to Microservices with Docker and Kubernetes

Martin Fowlerauthor, speaker, and loud-mouth on the design of enterprise software

I've heard people say the nice thing about SOA is that it separates data from process, that it combines data and process, that it uses web standards, that it's independent of web standards, that it's asynchronous, that it's synchronous, that the synchronicity doesn't matter....

Page 18: Introduction to Microservices with Docker and Kubernetes

Adrian Cockcroft• A service-oriented architecture composed of

loosely coupled elements that have bounded contexts

Page 19: Introduction to Microservices with Docker and Kubernetes

Eric Evans• Domain Driven Design.• A microservice with correctly bounded context

is self-contained for the purposes of software development.

• You can understand and update the microservice’s code without knowing anything about the internals of its peers

Page 20: Introduction to Microservices with Docker and Kubernetes
Page 21: Introduction to Microservices with Docker and Kubernetes

Componentisation via Services

Page 22: Introduction to Microservices with Docker and Kubernetes

Business CapabilitiesNot

Org Structure

Page 23: Introduction to Microservices with Docker and Kubernetes

ProductsNot

Projects

Page 24: Introduction to Microservices with Docker and Kubernetes

Smart endpointsDumb Pipes

Page 25: Introduction to Microservices with Docker and Kubernetes

DecentralisedGovernance

Page 26: Introduction to Microservices with Docker and Kubernetes

DecentralisedData Management

Page 27: Introduction to Microservices with Docker and Kubernetes

So what are the benefits

Page 28: Introduction to Microservices with Docker and Kubernetes

There must be down-sides?

Page 29: Introduction to Microservices with Docker and Kubernetes

Docker

Page 30: Introduction to Microservices with Docker and Kubernetes

Docker

Page 31: Introduction to Microservices with Docker and Kubernetes
Page 32: Introduction to Microservices with Docker and Kubernetes
Page 33: Introduction to Microservices with Docker and Kubernetes
Page 34: Introduction to Microservices with Docker and Kubernetes

• A HOST runs a DOCKER SERVER (agent running as a daemon)

• Accessed using a DOCKER CLIENT• Tasks:• Builds IMAGES• Downloads IMAGES• Starts CONTAINERS• Stops CONTAINERS

Page 35: Introduction to Microservices with Docker and Kubernetes

Kubernetes

K8s

Page 36: Introduction to Microservices with Docker and Kubernetes

API SERVER

SCHEDULER

CONTROLLER

users control plane clusterNODE

NODE

NODE

kubelet

registry

APICLIENT

UI

Page 37: Introduction to Microservices with Docker and Kubernetes

API SERVER

SCHEDULER

CONTROLLER

users control plane clusterNODE

NODE

NODE

kubelet

registrykubectl run nginx:v1

Page 38: Introduction to Microservices with Docker and Kubernetes

API SERVER

SCHEDULER

CONTROLLER

users control plane clusterNODE

NODE

NODE

kubelet

registrykubectl run nginx:v1

status

Page 39: Introduction to Microservices with Docker and Kubernetes

API SERVER

SCHEDULER

CONTROLLER

users control plane clusterNODE

NODE

NODE

kubelet

registry

status

status

Page 40: Introduction to Microservices with Docker and Kubernetes

API SERVER

SCHEDULER

CONTROLLER

users control plane clusterNODE

NODE

NODE

registry

Page 41: Introduction to Microservices with Docker and Kubernetes

• NAMESPACE• Provides multiple virtual clusters backed by

the same physical cluster• “default” by, well, default

Some Terminology

Page 42: Introduction to Microservices with Docker and Kubernetes

• POD• Encapsulate containers and volumes• Atomic unit of replication and placement• A logical host

Some Terminology

Page 43: Introduction to Microservices with Docker and Kubernetes

• Volumes• Local scratch directories• Cloud block storage (GCE, AWS)• Cluster storage• Special – like Secrets, GIT repo

Some Terminology

Page 44: Introduction to Microservices with Docker and Kubernetes

• Secrets• As per 12 factor App• Injected as a volume into a POD• Never touches disk

Some Terminology

Page 45: Introduction to Microservices with Docker and Kubernetes

• Labels and Selectors• Labels are user defined key-value pairs than

can be attached to any API object• These labels are query-able by SELECTORS

Some Terminology

Page 46: Introduction to Microservices with Docker and Kubernetes

• Replication Controllers• Ensure n copies of a POD• Will drive current state towards desired state• If too few replicas, will create new ones• If too many, will destroy some• Used for scaling up, down and rolling

updates

Some Terminology

Page 47: Introduction to Microservices with Docker and Kubernetes

• Services• Targets group of pods with label selectors• Pods get their own IP, but they cannot be

relied upon to be stable over time• Services provide a stable endpoint so that

ephemeral pods can be found and accessed.

Some Terminology

Page 48: Introduction to Microservices with Docker and Kubernetes

https://www.infoq.com/presentations/7-sins-microservices

http://martinfowler.com/articles/microservices.html

https://www.nginx.com/blog/microservices-at-netflix-architectural-best-practices/