Configure Istio traffic management including routing

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 Code
npx skills add wshobson/agents --skill istio-traffic-management -g -a claude-codeClaude 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-managementWindows (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" -ForceClaude.ai / desktop
Codex, Cursor, other agents
Connects with Agent Alley MCP · agentalley.io/mcp
Files included
SKILL.md6.7 KB
Read the files here
wshobson/
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 | |
| 2 | name istio-traffic-management |
| 3 | 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. |
| 4 | |
| 5 | |
| 6 | # Istio Traffic Management |
| 7 | |
| 8 | Comprehensive 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 | |
| 33 | Client → Gateway → VirtualService → DestinationRule → Service |
| 34 | (routing) (policies) (pods) |
| 35 | |
| 36 | |
| 37 | ## Templates |
| 38 | |
| 39 | ### Template 1: Basic Routing |
| 40 | |
| 41 | |
| 42 | apiVersion: networking.istio.io/v1beta1 |
| 43 | kind: VirtualService |
| 44 | metadata: |
| 45 | name: reviews-route |
| 46 | namespace: bookinfo |
| 47 | spec: |
| 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 | |
| 64 | apiVersion: networking.istio.io/v1beta1 |
| 65 | kind: DestinationRule |
| 66 | metadata: |
| 67 | name: reviews-destination |
| 68 | namespace: bookinfo |
| 69 | spec: |
| 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 | |
| 86 | apiVersion: networking.istio.io/v1beta1 |
| 87 | kind: VirtualService |
| 88 | metadata: |
| 89 | name: my-service-canary |
| 90 | spec: |
| 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 | |
| 104 | apiVersion: networking.istio.io/v1beta1 |
| 105 | kind: DestinationRule |
| 106 | metadata: |
| 107 | name: my-service-dr |
| 108 | spec: |
| 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 | |
| 130 | apiVersion: networking.istio.io/v1beta1 |
| 131 | kind: DestinationRule |
| 132 | metadata: |
| 133 | name: circuit-breaker |
| 134 | spec: |
| 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 | |
| 156 | apiVersion: networking.istio.io/v1beta1 |
| 157 | kind: VirtualService |
| 158 | metadata: |
| 159 | name: ratings-retry |
| 160 | spec: |
| 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 | |
| 178 | apiVersion: networking.istio.io/v1beta1 |
| 179 | kind: VirtualService |
| 180 | metadata: |
| 181 | name: mirror-traffic |
| 182 | spec: |
| 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 | |
| 200 | apiVersion: networking.istio.io/v1beta1 |
| 201 | kind: VirtualService |
| 202 | metadata: |
| 203 | name: fault-injection |
| 204 | spec: |
| 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 | |
| 225 | apiVersion: networking.istio.io/v1beta1 |
| 226 | kind: Gateway |
| 227 | metadata: |
| 228 | name: my-gateway |
| 229 | spec: |
| 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 | |
| 243 | apiVersion: networking.istio.io/v1beta1 |
| 244 | kind: VirtualService |
| 245 | metadata: |
| 246 | name: my-vs |
| 247 | spec: |
| 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 | |
| 266 | apiVersion: networking.istio.io/v1beta1 |
| 267 | kind: DestinationRule |
| 268 | metadata: |
| 269 | name: load-balancing |
| 270 | spec: |
| 271 | host: my-service |
| 272 | trafficPolicy: |
| 273 | loadBalancer: |
| 274 | simple: ROUND_ROBIN # or LEAST_CONN, RANDOM, PASSTHROUGH |
| 275 | |
| 276 | # Consistent hashing for sticky sessions |
| 277 | apiVersion: networking.istio.io/v1beta1 |
| 278 | kind: DestinationRule |
| 279 | metadata: |
| 280 | name: sticky-sessions |
| 281 | spec: |
| 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 | |
| 310 | # Check VirtualService configuration |
| 311 | istioctl analyze |
| 312 | |
| 313 | # View effective routes |
| 314 | istioctl proxy-config routes deploy/my-app -o json |
| 315 | |
| 316 | # Check endpoint discovery |
| 317 | istioctl proxy-config endpoints deploy/my-app |
| 318 | |
| 319 | # Debug traffic |
| 320 | istioctl proxy-config log deploy/my-app --level debug |
| 321 | |
| 322 |
Details
- Updated
- Sep 21, 2026
- License
- MIT
- Stars on the repo
- ★ 39,857
- Checked
- Source
- wshobson/agents ↗
- Creator
- wshobson · 179 listings
Similar skills
See all →
SkillGuides stable API and interface design
MCPPulls up-to-date, version-specific library docsContext7
SkillFetch up-to-date documentation and code examples for anyContext7 Documentation Lookup
SkillHow to use the Adaptyv Bio Foundry API and Python SDK
SkillMaster C/.NET backend development patterns for building
SkillGuides the usage of Gemini Interactions API on GeminiGemini Interactions API SkillMore from wshobson
SkillMaster C/.NET backend development patterns for building
SkillImplement WCAG 2.2 compliant interfaces with mobileAccessibility compliance
SkillMaster Material Design 3 and Jetpack Compose patternsAndroid Mobile Design
SkillMigrate from AngularJS to Angular using hybrid modeAngular migration
SkillUnderstand anti-reversing, obfuscationAnti reversing techniques
SkillBuild production Apache Airflow DAGs with best practicesApache Airflow DAG Patterns