服务网格指南

Istio vs Linkerd 对比

特性IstioLinkerd
代理Envoy(功能丰富,较重)linkerd2-proxy(轻量,Rust)
复杂度高——学习曲线陡低——运维简单
性能开销约 5-10% 延迟约 1-3% 延迟
mTLS是(可配置)是(默认自动)
流量管理丰富(VirtualService、DestinationRule)HTTPRoute、TrafficSplit
可观测性Jaeger、Kiali、Prometheus内置仪表盘、Prometheus
最适合大型组织,复杂流量控制简单场景,安全为主

Istio VirtualService(金丝雀部署)

apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: my-service spec: hosts: - my-service http: - match: - headers: x-user-group: exact: beta route: - destination: host: my-service subset: v2 - route: - destination: host: my-service subset: v1 weight: 90 - destination: host: my-service subset: v2 weight: 10 --- apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule metadata: name: my-service spec: host: my-service subsets: - name: v1 labels: version: v1 - name: v2 labels: version: v2