istio-traffic-management — Claude Code skill: traffic setup
This skill helps configure Istio routing, load balancing, and resilience policies. Use it when setting up canary releases or testing service behavior.
/plugin marketplace add wshobson/agents
/plugin install cloud-infrastructure@claude-code-workflowsWhat istio-traffic-management does
The skill provides examples for routing requests between service versions, configuring canary deployments, and choosing load-balancing strategies. Its YAML templates use VirtualService, DestinationRule, and Gateway. They also cover circuit breakers, retries with timeouts, traffic mirroring, and fault injection.
The guide includes istioctl commands to analyze configuration, inspect routes, and check endpoint discovery. The canary example splits traffic between stable and canary subsets; circuit-breaker policies go in a DestinationRule. Install this skill if you work with Istio traffic policies. It has little to offer a project that does not use a service mesh.
What it helps with
- route requests to a service version by header
- split traffic between stable and canary subsets
- set request timeouts and retry limits
- configure circuit breaking and outlier detection
- mirror traffic or inject faults for testing
Example prompts for the agent
- Set up a canary for my-service with 90% of traffic going to stable and 10% to canary.
- Write a VirtualService for reviews that sends requests with end-user: jason to v2 and other requests to v1.
- Check the Istio configuration for deploy/my-app and show the istioctl commands to inspect routes.
How to install istio-traffic-management
1Plugin marketplace
/plugin marketplace add wshobson/agents/plugin install cloud-infrastructure@claude-code-workflowsThis installs the whole cloud-infrastructure plugin with all its skills
2Skills CLI (Vercel)
npx skills add wshobson/agents --skill istio-traffic-management -a claude-code3Manually: put the files in place
~/.claude/skills/istio-traffic-management/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/istio-traffic-management/
1Skills CLI (Vercel)
npx skills add wshobson/agents --skill istio-traffic-management -a codex2Manually: put the files in place
.agents/skills/istio-traffic-management/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add wshobson/agents --skill istio-traffic-management -a cursor2Manually: put the files in place
.cursor/skills/istio-traffic-management/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install wshobson/agents istio-traffic-management2Manually: put the files in place
.github/skills/istio-traffic-management/SKILL.mdPlatform CLI
gemini skills install https://github.com/wshobson/agents --path plugins/cloud-infrastructure/skills/istio-traffic-managementManually: put the files in place
.devin/skills/istio-traffic-management/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set213
The whole set →Similar
Questions about istio-traffic-management
How do I install istio-traffic-management in Claude Code?
Run npx skills add wshobson/agents --skill istio-traffic-management -a claude-code. You can also use /plugin marketplace add wshobson/agents followed by /plugin install cloud-infrastructure@claude-code-workflows.
What does istio-traffic-management do?
It helps configure Istio traffic policies for routing, load balancing, canary deployments, and circuit breaking. The skill includes YAML templates and istioctl commands for debugging.
Which platforms support this skill?
The listed platforms are Claude Code, Codex, and Cursor.
Source text
SKILL.md · MIT
---
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
## 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
```yaml
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
```yaml
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
```yaml
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
```yaml
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
```yaml
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
```yaml
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
```yaml
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
```yaml
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
```bash
# 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
```
© Seth Hobson · MIT · wshobson/agents