Istio Traffic Management — managing traffic routing between microservices.
Key components:
1. VirtualService — traffic routing:
1apiVersion: networking.istio.io/v1beta12kind: VirtualService3metadata:4 name: myapp5spec:6 hosts:7 - myapp8 http:9 - match:10 - headers:11 x-canary:12 exact: "true"13 route:14 - destination:15 host: myapp16 subset: v217 - route:18 - destination:19 host: myapp20 subset: v121 weight: 9022 - destination:23 host: myapp24 subset: v225 weight: 1026 retries:27 attempts: 328 perTryTimeout: 2s29 timeout: 10s
2. DestinationRule — policies and subsets:
1apiVersion: networking.istio.io/v1beta12kind: DestinationRule3metadata:4 name: myapp5spec:6 host: myapp7 trafficPolicy:8 connectionPool:9 tcp:10 maxConnections: 10011 outlierDetection:12 consecutive5xxErrors: 513 interval: 30s14 baseEjectionTime: 30s15 subsets:16 - name: v117 labels:18 version: v119 - name: v220 labels:21 version: v2
3. Gateway — external entry:
1apiVersion: networking.istio.io/v1beta12kind: Gateway3metadata:4 name: my-gateway5spec:6 selector:7 istio: ingressgateway8 servers:9 - port:10 number: 44311 name: https12 protocol: HTTPS13 tls:14 mode: SIMPLE15 hosts:16 - myapp.com
Capabilities: Canary deployments, A/B testing, circuit breaking, retries, timeouts, fault injection.