Alex Withrow [email protected] linkedin https://github.com/awwithro/istio-linkerd-demo
- System for handling inter-service communication
- Works with service discovery
- Adds control and visibility
- Can be used to manage policy and security
- Can provide metrics for service communication
"The explicit goal of the service mesh is to move service communication out of the realm of the invisible, implied infrastructure, and into the role of a first-class member of the ecosystem—where it can be monitored, managed and controlled." -- William Morgan
- Uses the Envoy proxy under the hood.
- Envoy was developed at Lyft as their service proxy
- Istio adds management an kubernetes integration on-top of Envoy
- Designed for kubernetes primarily
- Acts as an invisible proxy. Traffic is forwarded via IPTables
- Manages rules with kubernetes api through CustomResourceDefinitions (CRDs)
- Sidecar - Envoy proxy that runs in the same pod as a service
- Pilot - Primary Control service. Provides routes/rules/endpoints to sidecars
- Mixer - Allows for extending Istio. Can be used to provide policy, metrics
- Auth - Used for providing mTLS between sidecars.
apiVersion: config.istio.io/v1alpha2
kind: RouteRule
metadata:
name: my-rule
spec:
destination:
name: my-service
route:
- labels:
version: v1
weight: 100
- Uses Finagle under the hood
- Finagle developed at Twitter as an RPC library for the JVM
- Allows services to use Finagle as a proxy. Language agnostic
- Explicit proxy
- Linkerd - Primary proxy that handles traffic. Can run as a sidecar or per node.
- Namerd - Centralized service for configuring routing/discovery
- Delegation Tables (Dtabs) - Configuration for translating requests to endpoints
/http/1.1/GET => /svc ;
/svc/my-service => /version/my-service/v1 ;
/version => /#/io.l5d.k8s/default/http ;
curl http://my-service/hello-world
/http/1.1/GET => /svc ;
/svc/my-service => /version/my-service/v1 ;
/version => /#/io.l5d.k8s/default/http ;
request interpreted as
/http/1.1/GET/my-service/hello-world
matches
/http/1.1/GET
becomes
/svc/my-service/hello-world
/http/1.1/GET => /svc ;
/svc/my-service => /version/my-service/v1 ;
/version => /#/io.l5d.k8s/default/http ;
/svc/my-service/hello-world
matches
/scv/my-service
becomes
/version/my-service/v1/hello-world
/http/1.1/GET => /svc ;
/svc/my-service => /version/my-service/v1 ;
/version => /#/io.l5d.k8s/default/http ;
- /version/my-service/v1/hello-world
matches
/version
becomes
/#/io.l5d.k8s/default/http/my-service/v1/hello-world
/#/io.l5d.k8s/default/http/my-service/v1/hello-world
This is a lookup in k8s for:
- In the
default
namespace - on the port labeled
http
- an instance of the
my-service
service - with the version label of
v1
curl http://my-service/hello-world
becomes
100.10.25.116:80/hello-world
| | HTTP | HTTP2/ gRPC | TCP | Thrift | Mux | Websockets | |:--------|:----:|:-----:|:----:|:---:|:------:|:---:|:----------:| | Istio | :white_check_mark: | :white_check_mark: | :white_check_mark: |:x:| :x:| :white_check_mark: | Linkerd | :white_check_mark: | :white_check_mark: | :x: |:white_check_mark: | :white_check_mark: | :x:
Kubernetes | Consul | Nomad | Marathon | ZK | |
---|---|---|---|---|---|
Istio | ✅ | ✅ | ✅ | ❌ | ❌ |
Linkerd | ✅ | ✅ | ❌ | ✅ | ✅ |
DNS_SRV | Curator | File Based | Eureka | |
---|---|---|---|---|
Istio | ❌ | ❌ | ❌ | ✅ |
Linkerd | ✅ | ✅ | ✅ | ❌ |
Host | Path | Method | Source | Arbitrary Header | |
---|---|---|---|---|---|
Istio | ✅ | ✅ | ✅ | ✅ | ✅ |
Linkerd* | ✅ | ✅ | ✅ | ✅ | ✅ |
- Linkerd routing methods are determined per linkerd server
Prometheus | StatsD | StackDriver | Zipkin | InfluxDB | |
---|---|---|---|---|---|
Istio | ✅ | ✅ | ✅ | ✅ | ❌ |
Linkerd | ✅ | ✅ | ❌ | ✅ | ✅ |
mTLS | Fault Injection | Retries | Policy | Egress | |
---|---|---|---|---|---|
Istio | ✅ | ✅ | ✅ | ✅ | ✅ |
Linkerd | ✅ | ❌ | ✅ | ❌ | ❌ |
- Linkerd & Envoy are part of the CNCF (not Istio)
- Linkerd more feature complete and stable. Announced (02/16)
- Istio still beta and not quite production ready. Announced (05/17)
- Istio approach more flexible
- Mixer Adapters are a big plus for Istio
- Both have a steep learning curve
- Linkerd 1.1.1 introduced support for Istio
- Istio provides the control plane
- Linkerd provides the data plane
- words: generates a random word
- simon: prints "Simon Says: word"
- capitalizer: calls either words service or simon service and capitalizes the output