Skills · Infrastructure & ops

Istio Traffic Management

Unverified30/40

Configure Istio traffic management including routing, load balancing, circuit breakers, and canary deployments. Use when implementing service mesh traffic policies, progressive delivery, or resilience patterns.

Originally by wshobson · MIT

Claude CodePartialHas SKILL.md but declares no allowed-tools — Claude Code will ask for permission each time
Cursor·UnknownWe have not crawled the repo tree, so we will not guess
Codex·UnknownWe have not crawled the repo tree, so we will not guess
Gemini CLI·UnknownThe spec defines no detection rule for Gemini
Copilot·UnknownWe have not crawled the repo tree, so we will not guess
npx agentalley add istio-traffic-management

This command does not work yet — the CLI is still being built. Until then, use Raw in the reader below to take the file.

Who is stuck, and on what

Configure Istio traffic management including routing, load balancing, circuit breakers, and canary deployments. Use when implementing service mesh traffic policies, progressive delivery, or resilience patterns.

The whole source

No sign-in, no blur, nothing truncated
istio-traffic-management/SKILL.md322 lines6.7 KBRawView on GitHub
Frontmatter — 2 properties
nameistio-traffic-management
descriptionConfigure Istio traffic management including routing, load balancing, circuit breakers, and canary deployments. Use when implementing service mesh traffic policies, progressive delivery, or resilience patterns.
1---
2name: istio-traffic-management
3description: Configure Istio traffic management including routing, load balancing, circuit breakers, and canary deployments. Use when implementing service mesh traffic policies, progressive delivery, or resilience patterns.
4---A5No allowed-tools declared — no way to tell what this skill may touch
5 
6# Istio Traffic Management
7 
8Comprehensive guide to Istio traffic management for production service mesh deployments.
9 
10## When to Use This Skill
11 
12- Configuring service-to-service routing
13- Implementing canary or blue-green deployments
14- Setting up circuit breakers and retries
15- Load balancing configuration
16- Traffic mirroring for testing
17- Fault injection for chaos engineering
18 
19## Core Concepts
20 
21### 1. Traffic Management Resources
22 
23| Resource | Purpose | Scope |
24| ------------------- | ----------------------------- | ------------- |
25| **VirtualService** | Route traffic to destinations | Host-based |
26| **DestinationRule** | Define policies after routing | Service-based |
27| **Gateway** | Configure ingress/egress | Cluster edge |
28| **ServiceEntry** | Add external services | Mesh-wide |
29 
30### 2. Traffic Flow
31 
32```
33Client → Gateway → VirtualService → DestinationRule → Service
34 (routing) (policies) (pods)
35```
36 
37## Templates
38 
39### Template 1: Basic Routing
40 
41```yaml
42apiVersion: networking.istio.io/v1beta1
43kind: VirtualService
44metadata:
45 name: reviews-route
46 namespace: bookinfo
47spec:
48 hosts:
49 - reviews
50 http:
51 - match:
52 - headers:
53 end-user:
54 exact: jason
55 route:
56 - destination:
57 host: reviews
58 subset: v2
59 - route:
60 - destination:
61 host: reviews
62 subset: v1
63---
64apiVersion: networking.istio.io/v1beta1
65kind: DestinationRule
66metadata:
67 name: reviews-destination
68 namespace: bookinfo
69spec:
70 host: reviews
71 subsets:
72 - name: v1
73 labels:
74 version: v1
75 - name: v2
76 labels:
77 version: v2
78 - name: v3
79 labels:
80 version: v3
81```
82 
83### Template 2: Canary Deployment
84 
85```yaml
86apiVersion: networking.istio.io/v1beta1
87kind: VirtualService
88metadata:
89 name: my-service-canary
90spec:
91 hosts:
92 - my-service
93 http:
94 - route:
95 - destination:
96 host: my-service
97 subset: stable
98 weight: 90
99 - destination:
100 host: my-service
101 subset: canary
102 weight: 10
103---
104apiVersion: networking.istio.io/v1beta1
105kind: DestinationRule
106metadata:
107 name: my-service-dr
108spec:
109 host: my-service
110 trafficPolicy:
111 connectionPool:
112 tcp:
113 maxConnections: 100
114 http:
115 h2UpgradePolicy: UPGRADE
116 http1MaxPendingRequests: 100
117 http2MaxRequests: 1000
118 subsets:
119 - name: stable
120 labels:
121 version: stable
122 - name: canary
123 labels:
124 version: canary
125```
126 
127### Template 3: Circuit Breaker
128 
129```yaml
130apiVersion: networking.istio.io/v1beta1
131kind: DestinationRule
132metadata:
133 name: circuit-breaker
134spec:
135 host: my-service
136 trafficPolicy:
137 connectionPool:
138 tcp:
139 maxConnections: 100
140 http:
141 http1MaxPendingRequests: 100
142 http2MaxRequests: 1000
143 maxRequestsPerConnection: 10
144 maxRetries: 3
145 outlierDetection:
146 consecutive5xxErrors: 5
147 interval: 30s
148 baseEjectionTime: 30s
149 maxEjectionPercent: 50
150 minHealthPercent: 30
151```
152 
153### Template 4: Retry and Timeout
154 
155```yaml
156apiVersion: networking.istio.io/v1beta1
157kind: VirtualService
158metadata:
159 name: ratings-retry
160spec:
161 hosts:
162 - ratings
163 http:
164 - route:
165 - destination:
166 host: ratings
167 timeout: 10s
168 retries:
169 attempts: 3
170 perTryTimeout: 3s
171 retryOn: connect-failure,refused-stream,unavailable,cancelled,retriable-4xx,503
172 retryRemoteLocalities: true
173```
174 
175### Template 5: Traffic Mirroring
176 
177```yaml
178apiVersion: networking.istio.io/v1beta1
179kind: VirtualService
180metadata:
181 name: mirror-traffic
182spec:
183 hosts:
184 - my-service
185 http:
186 - route:
187 - destination:
188 host: my-service
189 subset: v1
190 mirror:
191 host: my-service
192 subset: v2
193 mirrorPercentage:
194 value: 100.0
195```
196 
197### Template 6: Fault Injection
198 
199```yaml
200apiVersion: networking.istio.io/v1beta1
201kind: VirtualService
202metadata:
203 name: fault-injection
204spec:
205 hosts:
206 - ratings
207 http:
208 - fault:
209 delay:
210 percentage:
211 value: 10
212 fixedDelay: 5s
213 abort:
214 percentage:
215 value: 5
216 httpStatus: 503
217 route:
218 - destination:
219 host: ratings
220```
221 
222### Template 7: Ingress Gateway
223 
224```yaml
225apiVersion: networking.istio.io/v1beta1
226kind: Gateway
227metadata:
228 name: my-gateway
229spec:
230 selector:
231 istio: ingressgateway
232 servers:
233 - port:
234 number: 443
235 name: https
236 protocol: HTTPS
237 tls:
238 mode: SIMPLE
239 credentialName: my-tls-secret
240 hosts:
241 - "*.example.com"
242---
243apiVersion: networking.istio.io/v1beta1
244kind: VirtualService
245metadata:
246 name: my-vs
247spec:
248 hosts:
249 - "api.example.com"
250 gateways:
251 - my-gateway
252 http:
253 - match:
254 - uri:
255 prefix: /api/v1
256 route:
257 - destination:
258 host: api-service
259 port:
260 number: 8080
261```
262 
263## Load Balancing Strategies
264 
265```yaml
266apiVersion: networking.istio.io/v1beta1
267kind: DestinationRule
268metadata:
269 name: load-balancing
270spec:
271 host: my-service
272 trafficPolicy:
273 loadBalancer:
274 simple: ROUND_ROBIN # or LEAST_CONN, RANDOM, PASSTHROUGH
275---
276# Consistent hashing for sticky sessions
277apiVersion: networking.istio.io/v1beta1
278kind: DestinationRule
279metadata:
280 name: sticky-sessions
281spec:
282 host: my-service
283 trafficPolicy:
284 loadBalancer:
285 consistentHash:
286 httpHeaderName: x-user-id
287 # or: httpCookie, useSourceIp, httpQueryParameterName
288```
289 
290## Best Practices
291 
292### Do's
293 
294- **Start simple** - Add complexity incrementally
295- **Use subsets** - Version your services clearly
296- **Set timeouts** - Always configure reasonable timeouts
297- **Enable retries** - But with backoff and limits
298- **Monitor** - Use Kiali and Jaeger for visibility
299 
300### Don'ts
301 
302- **Don't over-retry** - Can cause cascading failures
303- **Don't ignore outlier detection** - Enable circuit breakers
304- **Don't mirror to production** - Mirror to test environments
305- **Don't skip canary** - Test with small traffic percentage first
306 
307## Debugging Commands
308 
309```bash
310# Check VirtualService configuration
311istioctl analyze
312 
313# View effective routes
314istioctl proxy-config routes deploy/my-app -o json
315 
316# Check endpoint discovery
317istioctl proxy-config endpoints deploy/my-app
318 
319# Debug traffic
320istioctl proxy-config log deploy/my-app --level debug
321```
322 

Reviews

Installed this one?Write the first review and take the Trailblazer badge.

Reviews only open after a real install, so this is empty — and we leave it empty rather than invent one.

Alternatives

Also in Infrastructure & ops