![Page 1: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/1.jpg)
Kubernetes meets Finagle for resilient microservicesoliver gouldcto, buoyant
KubeCon EU 2016
![Page 2: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/2.jpg)
oliver gould • cto @ buoyantopen-source microservice infrastructure
• previously, tech lead @ twitter:observability, traffic
• core contributor: finagle
• creator: linkerd
• loves: kubernetes, dogs@olix0r [email protected]
![Page 3: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/3.jpg)
overview
1. why microservices?
2. finagle: the once and future layer 5
3. resilient rpc
4. introducing linkerd
5. demo
6. questions! answers?
![Page 4: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/4.jpg)
why microservices?
![Page 5: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/5.jpg)
scaling teams
growing software
![Page 6: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/6.jpg)
performance correctness debugging monitoring
securityefficiencyresilience
![Page 7: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/7.jpg)
Resilience is an imperative: our software runs on the truly dismal computers we call datacenters. Besides being heinouslycomplex… they are unreliable and prone to operator error.
Marius Eriksen @mariusRPC Redux
![Page 8: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/8.jpg)
resilience in microservicessoftware you didn’t write
hardware you can’t touch
network you can’t configure
break in new and surprising ways
and your customers shouldn’t notice
![Page 9: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/9.jpg)
resilient microservices require resilient communication
![Page 10: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/10.jpg)
datacenter
[1] physical
[2] link
[3] network
[4] transportkubernetes calico, …
aws, azure, digitalocean, gce, …
your code languages, libraries[7] application
rpc[5] session
[6] presentation json, protobuf, thrift, …
http/2, mux, …
![Page 11: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/11.jpg)
layer 5 deals in requests
![Page 12: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/12.jpg)
finagleTHE ONCE AND FUTURE LAYER 5
![Page 13: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/13.jpg)
github.com/twitter/finagleRPC library (JVM)
asynchronous
built on Netty
scala
functional
strongly typed
first commit: Oct 2010
![Page 14: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/14.jpg)
used by…
![Page 15: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/15.jpg)
programming finagle// proxy requests on 8080 to the users service // with a timeout of 1 second
val users = Http.newClient(“/s/users”)
Http.serve(“:8080”, Service.mk[Request, Response] { req => users(req).within(1.second).handle { case _: TimeoutException => Response(Status.BadGateway) } })
![Page 16: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/16.jpg)
operating finagleservice discovery
circuit breaking
backpressure
timeouts
retries
tracing
metrics
keep-alive
multiplexing
load balancing
per-request routing
service-level objectives
![Page 17: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/17.jpg)
resilient rpcREAL-WORLD MOTIVATIONS FOR
![Page 18: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/18.jpg)
“It’s slow”is the hardest problem you’ll ever debug.
Jeff Hodges @jmhodgesNotes on Distributed Systems for Young Bloods
![Page 19: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/19.jpg)
the more components you deploy, the more problems you have
![Page 20: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/20.jpg)
the more components you deploy, the more problems you have
😩
![Page 21: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/21.jpg)
the more components you deploy, the more problems you have
😩
😩
😩
😩
😩
😩
![Page 22: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/22.jpg)
l5: load balance requests lb algorithms:
• round-robin • fewest connections • queue depth • exponentially-weighted
moving average (ewma) • aperture
![Page 23: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/23.jpg)
where are we spending time?
![Page 24: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/24.jpg)
who’s talking?
😎
![Page 25: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/25.jpg)
layer 5 routing• application configured against a logical name:/s/users
• requests are bound to concrete names:/k8s/prod/http/users
• delegations express routing by rewriting:/s => /k8s/prod/http/s/l5d-docs => /$/inet/linkerd.io/443
![Page 26: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/26.jpg)
per-request routing
GET / HTTP/1.1Host: mysite.comDtab-local: /s/users => /s/users-v2
GET / HTTP/1.1Host: mysite.comDtab-local: /s/slorbs => /s/debugproxy/s/slorbs
![Page 27: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/27.jpg)
so all i have to do is rewrite my app in scala?
![Page 28: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/28.jpg)
![Page 29: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/29.jpg)
github.com/buoyantio/linkerdmicroservice rpc proxy
layer-5 router
aka l5d
built on finagle
pluggable
kubernetes
consul
zookeeper
![Page 30: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/30.jpg)
make layer 5 great again
transport layer security
service discovery
backpressure
timeouts
retries
stats
tracing
routing
multiplexing
load balancing
circuit breaking
service-level objectives
![Page 31: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/31.jpg)
l5d sidecar
books authors
pod A pod B
![Page 32: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/32.jpg)
l5d sidecar
incoming router
outgoing router
io.l5d.k8s namer
service
![Page 33: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/33.jpg)
l5d.yamlnamers:- kind: io.l5d.experimental.k8s authTokenFile: …/serviceaccount/tokenrouters:- protocol: http label: incoming servers: - port: 8080 ip: 0.0.0.0 baseDtab: | /http/1.1 => /$/inet/127.1/8888;
- protocol: http label: outgoing servers: - port: 4140 baseDtab: | /srv => /io.l5d.k8s/default/http; /method => /$/io.buoyant.http.anyMethodPfx/srv; /http/1.1 => /method;
kind: ServiceapiVersion: v1metadata: namespace: default name: $SERVICENAME
spec: selector: app: $SERVICENAME type: LoadBalancer ports: - name: http port: 8080 targetPort: 8080
svc.yaml.sh
![Page 34: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/34.jpg)
linkerd roadmap• use k8s 3rdparty for routing state kubernetes#18835 • DaemonSets deployments? • tighter grpc support netty#3667 • cluster-wide routing control • service-level objectives • application-level circuit breaking • more configurable everything
![Page 35: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/35.jpg)
traffic control with linkerdDEMO
![Page 36: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/36.jpg)
web
books authorsl5d l5d
l5d
![Page 37: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/37.jpg)
web
books authorsl5d l5d
l5d
books-v2l5d
![Page 38: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/38.jpg)
web
books authorsl5d l5d
l5d
books-v2l5d
helium
tracingcontrol
ui
play!
![Page 39: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/39.jpg)
<demo video />
![Page 40: KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices](https://reader034.vdocuments.us/reader034/viewer/2022050613/587d54281a28abee158b53c7/html5/thumbnails/40.jpg)
more at linkerd.io
slack: slack.linkerd.io
email: [email protected]
twitter:
• @olix0r
• @linkerd
thanks!