Istio

From G1Joshi/Agent-Skills · View interactive version

Istio is an AI agent skill from the GitHub repository G1Joshi/Agent-Skills. Expert Istio service mesh assistance covering VirtualServices, DestinationRules, mTLS policies, Envoy sidecars, and ingress gateways. Use when managing microservice networking, traffic splitting, and zero-trust security on Kubernetes.

How to use this skill

Skill file

Istio

Istio is an open-source service mesh providing transparent traffic management, zero-trust security with mutual TLS, dynamic telemetry, and sidecarless Ambient Mesh architectures.

When to Use

Quick Start

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: reviews-route
spec:
  hosts:
    - reviews
  http:
    - route:
        - destination:
            host: reviews
            subset: v1
          weight: 80
        - destination:
            host: reviews
            subset: v2
          weight: 20

Core Concepts

Traffic Shifting with VirtualService & DestinationRule

Implementing a 90/10 Canary release rollout:

apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: payment-service
  namespace: default
spec:
  host: payment-service
  subsets:
    - name: v1
      labels:
        version: "1.0"
    - name: v2
      labels:
        version: "2.0"
  trafficPolicy:
    loadBalancer:
      simple: ROUND_ROBIN
    tls:
      mode: ISTIO_MUTUAL # Strict mTLS within mesh
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: payment-service
  namespace: default
spec:
  hosts:
    - payment-service
  http:
    - route:
        - destination:
            host: payment-service
            subset: v1
          weight: 90
        - destination:
            host: payment-service
            subset: v2
          weight: 10
      timeout: 3s
      retries:
        attempts: 3
        perTryTimeout: 1s
        retryOn: 5xx,connect-failure

Strict Mutual TLS (mTLS) PeerAuthentication

Enforcing encryption for all inter-service pod communication:

apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
  name: default
  namespace: istio-system
spec:
  mtls:
    mode: STRICT # Rejects all non-mTLS plain-text connections

Fault Injection for Resiliency Verification

Testing application tolerance against downstream latencies:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: ratings-delay
spec:
  hosts:
    - ratings
  http:
    - fault:
        delay:
          percentage:
            value: 20.0
          fixedDelay: 5s
      route:
        - destination:
            host: ratings

Common Patterns

Circuit Breaking with Outlier Detection in DestinationRule

Problem: Slow or failing pod replicas drag down the response times of the entire service.

Solution:

Eject consecutive failing pods automatically:

apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: backend-circuit-breaker
spec:
  host: backend-service
  trafficPolicy:
    connectionPool:
      tcp:
        maxConnections: 100
      http:
        http1MaxPendingRequests: 10
    outlierDetection:
      consecutive5xxErrors: 3
      interval: 10s
      baseEjectionTime: 30s
      maxEjectionPercent: 50

Best Practices

Do:

Don't:

Troubleshooting

| Error | Cause | Solution |

| :-------------------------------- | :------------------------------------------------------------------ | :------------------------------------------------------------------------------------- |

| 503 Service Unavailable (UC/UF) | Envoy proxy cannot reach upstream pod or connection reset. | Check destination service endpoint health and verify subset labels match active pods. |

| mTLS Handshake Failed | Incompatible PeerAuthentication mode or expired client certificate. | Verify mesh TLS mode (PERMISSIVE vs STRICT) and confirm cert-manager or istiod health. |

| High Sidecar Latency | CPU throttling on Envoy container during traffic spikes. | Increase CPU limits in sidecar injection annotations and optimize connection pooling. |

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.