Service Mesh — infrastructure layer, managing communication between microservices. Sidecar proxies (Envoy) intercept all traffic → handle: mTLS encryption, retries, circuit breakers, traffic shaping, observability (metrics/traces). Примеры: Istio (most-featured), Linkerd (lightweight), Consul Connect, AWS App Mesh. Overhead: +2-5 ms latency per hop, больше memory.
Ниже: подробности, пример, смежные термины, FAQ.
# Istio VirtualService — 10% traffic to v2
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
spec:
http:
- route:
- destination: { host: my-service, subset: v1 }
weight: 90
- destination: { host: my-service, subset: v2 }
weight: 10Gateway — north-south (ingress). Mesh — east-west (service-to-service). Дополняют друг друга.
Для < 10 services — yes. Complexity не окупается. Для 50+ services + mTLS requirement — worth it.
Istio: feature-rich, steep learning curve. Linkerd: lightweight Rust, simpler UX. Для starter — Linkerd.