kubernetes distributed systems on the evolution of · what comes after microservices? 3. @bibryam...

55
Bilgin Ibryam Product Manager @RedHat @bibryam The Evolution of Distributed Systems on Kubernetes 1

Upload: others

Post on 20-May-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

Bilgin IbryamProduct Manager @RedHat@bibryam

The Evolution of Distributed Systems on Kubernetes

1

Page 2: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam

Bilgin Ibryam

2

● Product Manager at Red Hat

● Former Architect/Consultant

● Committer at Apache Camel

● Author of “Camel Design Patterns” and

“Kubernetes Patterns” books

● Latest interest: cloud native data

@bibryam

Page 3: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

What comes after Microservices?

3

Page 4: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam

Agenda

4

● Distributed system needs

● Monolithic architectures

● Cloud-native technologies

■ Kubernetes, Istio, Knative, Dapr● Future architecture trends

Page 5: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam5

Modern distributed applications

● 100s of components and 1000s of instances

● Polyglot, independent, and automatable components

● Hybrid workloads on hybrid environments

● Open source, open standards, and interoperable

● Based on Kubernetes ecosystem

Page 6: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

What are the needs of distributed applications?

6

Page 7: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam7

Distributed application needs

Page 8: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam8

Distributed application needs

Lifecycle management● Deployment/rollback● Placement/scheduling● Configuration management● Resource/failure isolation● Auto/manual scaling● Hybrid workloads (stateless, stateful,

serverless, etc)

Page 9: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam9

Distributed application needs

Advanced networking● Service discovery and failover● Dynamic traffic routing● Retry, timeout, circuit breaking● Security, rate limiting, encryption● Observability and tracing

Page 10: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam10

Distributed application needs

Resource bindings● Connectors for APIs● Protocol conversion● Message transformation● Filtering, light message routing● Point-to-point, pub/sub interactions

Page 11: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam11

Distributed application needs

Stateful abstractions● Workflow management● Temporal scheduling● Distributed caching● Idempotency● Transactionality (SAGA)● Application state

Page 12: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

Monolithic architectures

12

Page 13: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam13

Traditional middleware capabilities

● Stateful primitives

● Resource bindings

● Networking

Page 14: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam14

Traditional middleware limitations

● Lifecycle management

○ Single, shared language runtime○ Manual deployment/rollback○ Manual placement○ Manual scaling○ No resource/failure isolation

Page 15: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

Cloud-native architectures

15

Page 16: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam16

Microservices and Kubernetes

Page 17: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam17

Microservices and Kubernetes

Page 18: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam

Health probes

18

Page 19: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam

Managed start/stop

19

Page 20: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam

Declarative deployment

20

Page 21: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam21

Demands & placement

Predictable resource demand Automated placement

Page 22: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam22

Configuration management

● ConfigMaps used in Pods as:○ environment variables○ volumes

● Secrets:○ Minimal Node spread○ Only stored in memory in a tmpfs○ Encrypted in the backend store (etcd)○ Access can be restricted with RBAC

Page 23: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam23

Foundational kubernetes capabilities

More Kubernetes Patterns● Foundational patterns● Structural patterns● Configuration patterns● Behavioural patterns

(For more Kubernetes Patterns, check out the link at the end of the slides)

Page 24: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam

Batch/Periodic Job

24

Hybrid workloads

Global SingletonStateful Service

Stateless Service

Page 25: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam25

Lifecycle capabilities

● Deployment/rollback

● Placement/scheduling

● Configuration management

● Resource/failure isolation

● Auto/manual scaling

● Hybrid workloads: stateless, stateful,

batch jobs, serverless

Page 26: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

How do we extend Kubernetes?

26

Page 27: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam27

Out-of-process extension mechanism

Deployment guarantees Lifecycle guarantees

Page 28: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam

Sidecar

28

Page 29: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam

Controller Pattern

29

Default schema● ReplicaSet● StatefulSet● Job, CronJob

Default controllers● replicaset● statefulset● job, cronjob

Managed resources state● Pod● PVC...

Custom controller -> Custom behaviour

Page 30: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam

Operator Pattern

30

kind: ConfigWatcherapiVersion: k8spatterns.io/v1metadata: name: webapp-config-watcherspec: configMap: webapp-config podSelector: app: webapp

Custom operator● Go● Helm● Ansible● Java● Python

Custom application● AI/ML● Big Data● Storage● Streaming● Monitoring

CustomResourceDefinition + Controller = Operator

Page 31: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

Kubernetes based platforms

31

Page 32: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam32

What is Service Mesh?

Page 33: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam33

What is Service Mesh?

Page 34: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam34

What is Service Mesh?

Page 35: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam35

What is Service Mesh?

Page 36: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam36

Networking capabilities

API Gateway Service MeshAbstract away details and decouple

consumers from implementations

● Controls what’s allowed in/out

● Bridging security domains

● Request / response transformation

● Protocol, data format transformation

● API composition

● Rate limiting

Enhances the reliability and the visibility of the

networking interactions

● Telemetry, tracing collection

● Service discovery, load balancing

● TLS termination/origination

● Request routing, traffic splitting

● Traffic shadowing

● Rate limiting

Page 37: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam37

What is Knative?

Serving

Common infrastructure for request-driven

interactions that can "scale to zero".

Eventing

Common infrastructure for consuming and producing events

declaratively.

Kubernetes-based platform to deploy, and manage serverless workloads.

Page 38: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam38

Knative Serving concepts

● Scale-to-zero & activation

● Rapid autoscaling

● Traffic splitting

● Callable by Knative eventing

● Simplified deployment model

○ Single Port

○ No PersistentVolumes

○ Single Container

apiVersion: serving.knative.dev/v1alpha1kind: Servicemetadata: name: lottospec: replicas: 1 selector: matchLabels:

app: lotto template: metadata: labels: app: lotto spec: containers: - image: cds19/lotto

Page 39: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam39

Knative Eventing concepts

● Sources (Kafka, CronJob, Apache Camel 200+, etc)

● Broker implementations (In-memory, Kafka, etc)

● CloudEvents data format

● Trigger with filters

● Sequence: chaining multiple steps composed of

containers

Page 40: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam40

Lifecycle, networking, binding capabilities● Knative Serving

○ Simplified deployment for stateless workloads

○ Traffic based autoscaling including Scale-to-Zero

○ Traffic splitting for custom rollout / rollback scenarios

● Knative Eventing

○ External triggers for feeding Knative Services

○ Based on CloudEvents

○ Backed by proven messaging systems

○ Declarative messaging infrastructure

Page 41: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam41

What is Dapr?

Sidecar architecture

Developer first, standard APIs used from any programming

language or framework.

Building blocks

Make it easy for developers to create microservice without

being an expert in distributed systems.

A portable runtime for building distributed applications.

Page 42: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam42

Dapr building blocks

Distributed Tracing

See and measure the message calls across components and networked services

Service Invocation

Act as a reverse proxy with built-in service discovery, tracing and error handling

Publish & Subscribe

Secure, scalable messaging between services

Resource Bindings

Trigger code through events from input and output bindings to external resources.

Actors

Encapsulate code and data in reusable actor objects as a common microservices

State Management

Provides a key/value-based state API with pluggable state stores for persistence

Page 43: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam43

Dapr architecture

Sour

ce: h

ttps

://g

ithub

.com

/dap

r/do

cs

Page 44: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam44

Dapr on Kubernetes

Sour

ce: h

ttps

://g

ithub

.com

/dap

r/do

cs

Page 45: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam45

Full circle

● Centralized control plane

● Centralized data plane

● Centralized control plane

● Decentralized, highly-scalable data plane

Service discoveryDynamic routingResiliencyObservability

DeploymentPlacementConfig mgmtScaling

Bindings State abstraction Pub/SubObservability

ConnectorsEventingFilteringServerless

Page 46: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

Future cloud native trends

46

Page 47: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam47

Lifecycle trends

Sour

ce: h

ttps

://o

pera

torh

ub.io

Page 48: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam

● Introduction of Service Mesh Interface specification

● Architecture consolidation of Istio with istiod

● More L7 protocols: MongoDB, DynamoDB, ZooKeeper, MySQL, Redis, Kafka(8188)

○ KIP-559 can enable bridging, validation, encryption, filtering, transformation

● HTTP Cache filter (eCache)

● HTTP tap filter (with matcher)

● WebAssembly (wasm) filters with dynamic loading (C++ -> Rust, Go, etc)

48

Networking trends

Page 49: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam49

Binding trends

Dev Environment Cloud

kamel CLI

Camel K Operator

Custom Resource

Running Pod

Fast redeploy!Less than 1 second!

- from: uri: "direct:route" steps: - split: tokenize: "," - to: "mock:split"

Camel-K Operator:1. Choose a runtime

2. Scaffold a project3. Add boilerplate4. Add dependencies5. Create container image6. Create Kubernetes

resources for deployment

Sour

ce: h

ttps

://g

ithub

.com

/apa

che/

cam

el-k

Live updates!

Page 50: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam50

State trends

Sour

ce: h

ttps

://g

ithub

.com

/clo

udst

atei

o/cl

ouds

tate

Page 51: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

What does all this mean?

51

Page 52: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam52

Multi-runtime microservices are here

Page 53: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam53

Smart sidecars and dumb pipes

Page 54: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

@bibryam54

What comes after Microservices?

Page 55: Kubernetes Distributed Systems on The Evolution of · What comes after Microservices? 3. @bibryam Agenda 4 Distributed system needs Monolithic architectures Cloud-native technologies

Thank You

55

@bibryam

https://k8spatterns.io