Configure Istio traffic management including routing

by wshobson · MIT license · ★ 39,857 on GitHub · updated Sep 21

Istio traffic management cover

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.

---
name: istio-traffic-management
description: 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.
---

# Istio Traffic Management

Comprehensive guide to Istio traffic management for production service mesh deployments.

## When to Use This Skill

- Configuring service-to-service routing
- Implementing canary or blue-green deployments
- Setting up circuit breakers and retries
- Load balancing configuration
- Traffic mirroring for testing
- Fault injection for chaos engineering

Overview

Comprehensive guide to Istio traffic management for production service mesh deployments.

Manual install (npx, ZIP)
Claude Codenpx skills add wshobson/agents --skill istio-traffic-management -g -a claude-code
Claude Code (manual)mkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/wshobson/agents/tar.gz/4236bb91f839 \ | tar -xz -C ~/.claude/skills --strip-components=4 agents-4236bb91f839/plugins/cloud-infrastructure/skills/istio-traffic-management
Windows (PowerShell)New-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/da06506c888b0498ca89/istio-traffic-management.zip" -OutFile "$env:TEMP\istio-traffic-management.zip"; Expand-Archive "$env:TEMP\istio-traffic-management.zip" -DestinationPath "$HOME\.claude\skills" -Force
Claude.ai / desktopDownload the ZIP and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md6.7 KB
Read the files here
wshobson/4236bb91 file
SKILL.md
Show the full text322 lines

Istio Traffic Management

Comprehensive guide to Istio traffic management for production service mesh deployments.

When to Use This Skill

  • Configuring service-to-service routing
  • Implementing canary or blue-green deployments
  • Setting up circuit breakers and retries
  • Load balancing configuration
  • Traffic mirroring for testing
  • Fault injection for chaos engineering

Core Concepts

1. Traffic Management Resources
Resource Purpose Scope
VirtualService Route traffic to destinations Host-based
DestinationRule Define policies after routing Service-based
Gateway Configure ingress/egress Cluster edge
ServiceEntry Add external services Mesh-wide
2. Traffic Flow
Client → Gateway → VirtualService → DestinationRule → Service
                   (routing)        (policies)        (pods)

Templates

Template 1: Basic Routing
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: reviews-route
  namespace: bookinfo
spec:
  hosts:
    - reviews
  http:
    - match:
        - headers:
            end-user:
              exact: jason
      route:
        - destination:
            host: reviews
            subset: v2
    - route:
        - destination:
            host: reviews
            subset: v1
---
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
  name: reviews-destination
  namespace: bookinfo
spec:
  host: reviews
  subsets:
    - name: v1
      labels:
        version: v1
    - name: v2
      labels:
        version: v2
    - name: v3
      labels:
        version: v3
Template 2: Canary Deployment
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: my-service-canary
spec:
  hosts:
    - my-service
  http:
    - route:
        - destination:
            host: my-service
            subset: stable
          weight: 90
        - destination:
            host: my-service
            subset: canary
          weight: 10
---
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
  name: my-service-dr
spec:
  host: my-service
  trafficPolicy:
    connectionPool:
      tcp:
        maxConnections: 100
      http:
        h2UpgradePolicy: UPGRADE
        http1MaxPendingRequests: 100
        http2MaxRequests: 1000
  subsets:
    - name: stable
      labels:
        version: stable
    - name: canary
      labels:
        version: canary
Template 3: Circuit Breaker
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
  name: circuit-breaker
spec:
  host: my-service
  trafficPolicy:
    connectionPool:
      tcp:
        maxConnections: 100
      http:
        http1MaxPendingRequests: 100
        http2MaxRequests: 1000
        maxRequestsPerConnection: 10
        maxRetries: 3
    outlierDetection:
      consecutive5xxErrors: 5
      interval: 30s
      baseEjectionTime: 30s
      maxEjectionPercent: 50
      minHealthPercent: 30
Template 4: Retry and Timeout
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: ratings-retry
spec:
  hosts:
    - ratings
  http:
    - route:
        - destination:
            host: ratings
      timeout: 10s
      retries:
        attempts: 3
        perTryTimeout: 3s
        retryOn: connect-failure,refused-stream,unavailable,cancelled,retriable-4xx,503
        retryRemoteLocalities: true
Template 5: Traffic Mirroring
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: mirror-traffic
spec:
  hosts:
    - my-service
  http:
    - route:
        - destination:
            host: my-service
            subset: v1
      mirror:
        host: my-service
        subset: v2
      mirrorPercentage:
        value: 100.0
Template 6: Fault Injection
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: fault-injection
spec:
  hosts:
    - ratings
  http:
    - fault:
        delay:
          percentage:
            value: 10
          fixedDelay: 5s
        abort:
          percentage:
            value: 5
          httpStatus: 503
      route:
        - destination:
            host: ratings
Template 7: Ingress Gateway
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
  name: my-gateway
spec:
  selector:
    istio: ingressgateway
  servers:
    - port:
        number: 443
        name: https
        protocol: HTTPS
      tls:
        mode: SIMPLE
        credentialName: my-tls-secret
      hosts:
        - "*.example.com"
---
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: my-vs
spec:
  hosts:
    - "api.example.com"
  gateways:
    - my-gateway
  http:
    - match:
        - uri:
            prefix: /api/v1
      route:
        - destination:
            host: api-service
            port:
              number: 8080

Load Balancing Strategies

apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
  name: load-balancing
spec:
  host: my-service
  trafficPolicy:
    loadBalancer:
      simple: ROUND_ROBIN # or LEAST_CONN, RANDOM, PASSTHROUGH
---
# Consistent hashing for sticky sessions
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
  name: sticky-sessions
spec:
  host: my-service
  trafficPolicy:
    loadBalancer:
      consistentHash:
        httpHeaderName: x-user-id
        # or: httpCookie, useSourceIp, httpQueryParameterName

Best Practices

Do's
  • Start simple - Add complexity incrementally
  • Use subsets - Version your services clearly
  • Set timeouts - Always configure reasonable timeouts
  • Enable retries - But with backoff and limits
  • Monitor - Use Kiali and Jaeger for visibility
Don'ts
  • Don't over-retry - Can cause cascading failures
  • Don't ignore outlier detection - Enable circuit breakers
  • Don't mirror to production - Mirror to test environments
  • Don't skip canary - Test with small traffic percentage first

Debugging Commands

# Check VirtualService configuration
istioctl analyze

# View effective routes
istioctl proxy-config routes deploy/my-app -o json

# Check endpoint discovery
istioctl proxy-config endpoints deploy/my-app

# Debug traffic
istioctl proxy-config log deploy/my-app --level debug
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---
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 
View all files on GitHub →

Details

Updated
Sep 21, 2026
License
MIT
Stars on the repo
★ 39,857
Checked
Source
wshobson/agents ↗
Creator
wshobson · 179 listings
View creator

Similar skills

See all →
SkillGuides stable API and interface designaddyosmani/agent-skills · by addyosmaniGuides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.★ 98.7k GitHub starsMCPPulls up-to-date, version-specific library docsContext7upstash/context7 · by upstashPulls up-to-date, version-specific library docs and code examples into the prompt so the AI stops inventing old APIs.★ 62.3k GitHub starsSkillFetch up-to-date documentation and code examples for anyContext7 Documentation Lookupupstash/context7 · by upstashFetch up-to-date documentation and code examples for any library, framework, SDK, CLI tool, or cloud service. Use whenever the user asks about a specific library — even well-known ones like React, Next.js, Prisma, Express, Tailwind, Django, or Spring Boot — because training data may not reflect recent API changes or version updates. Always use for: API syntax questions, configuration options, version migration issues, "how do I" questions mentioning a library name, debugging that involves library-specific behavior, setup instructions, and CLI tool usage. Use even when you think you know the answer. Do not rely on training data for API details, signatures, or configuration options — they are frequently out of date. Prefer this over web search for library documentation.★ 62.3k GitHub starsSkillHow to use the Adaptyv Bio Foundry API and Python SDKK-Dense-AI/scientific-agent-skills · by K-Dense-AIHow to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.★ 46k GitHub starsSkillMaster C/.NET backend development patterns for buildingwshobson/agents · by wshobsonMaster C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.★ 39.9k GitHub starsSkillGuides the usage of Gemini Interactions API on GeminiGemini Interactions API Skillgoogle/skills · by googleGuides the usage of Gemini Interactions API on Gemini Enterprise Agent Platform. Use when the user wants to use the stateful, server-managed Interactions API for multi-turn conversations, background execution, streaming, structured output, and function calling on the Agent Platform.★ 20.9k GitHub stars

More from wshobson

SkillMaster C/.NET backend development patterns for buildingwshobson/agents · by wshobsonMaster C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.★ 39.9k GitHub starsSkillImplement WCAG 2.2 compliant interfaces with mobileAccessibility compliancewshobson/agents · by wshobsonImplement WCAG 2.2 compliant interfaces with mobile accessibility, inclusive design patterns, and assistive technology support. Use when auditing accessibility, implementing ARIA patterns, building for screen readers, or ensuring inclusive user experiences.★ 39.9k GitHub starsSkillMaster Material Design 3 and Jetpack Compose patternsAndroid Mobile Designwshobson/agents · by wshobsonMaster Material Design 3 and Jetpack Compose patterns for building native Android apps. Use when designing Android interfaces, implementing Compose UI, or following Google's Material Design guidelines.★ 39.9k GitHub starsSkillMigrate from AngularJS to Angular using hybrid modeAngular migrationwshobson/agents · by wshobsonMigrate from AngularJS to Angular using hybrid mode, incremental component rewriting, and dependency injection updates. Use when upgrading AngularJS applications, planning framework migrations, or modernizing legacy Angular code.★ 39.9k GitHub starsSkillUnderstand anti-reversing, obfuscationAnti reversing techniqueswshobson/agents · by wshobsonUnderstand anti-reversing, obfuscation, and protection techniques encountered during software analysis. Use this skill when analyzing malware evasion techniques, when implementing anti-debugging protections for CTF challenges, when reverse engineering packed binaries, or when building security research tools that need to detect virtualized environments.★ 39.9k GitHub starsSkillBuild production Apache Airflow DAGs with best practicesApache Airflow DAG Patternswshobson/agents · by wshobsonBuild production Apache Airflow DAGs with best practices for operators, sensors, testing, and deployment. Use when creating data pipelines, orchestrating workflows, or scheduling batch jobs.★ 39.9k GitHub stars