Istio

From paulpas/agent-skill-router · View interactive version

Istio is an AI agent skill from the GitHub repository paulpas/agent-skill-router. "Istio in Cloud-Native Engineering - Connect, secure, control, and observe" services.

How to use this skill

Skill file

related-skills: cncf-argo, cncf-artifact-hub, cncf-aws-eks, cncf-azure-aks

Istio in Cloud-Native Engineering

Category: api-management

Status: Active

Stars: 38,137

Last Updated: 2026-04-22

Primary Language: Go

Documentation: https://istio.io/latest/docs/


Purpose and Use Cases

Istio is a core component of the cloud-native ecosystem, serving as a service mesh that adds observability, traffic control, and security policies to service-to-service communication without application code changes.

What Problem Does It Solve?

Embedding cross-cutting concerns like traffic management, security, and observability directly into application code. It enables these features declaratively without code changes.

When to Use This Project

Use Istio when you need a comprehensive service mesh with built-in traffic management, security (mTLS), and observability across your microservices. Consider lighter alternatives if you only need specific features.

Key Use Cases


Architecture Design Patterns

Core Components

Component Interactions

  1. User → API Server: Deploys application with sidecar
  2. Pilot → Istio Agent: Pushes config to sidecars
  3. Istio Agent → Envoy: Configures Envoy proxy
  4. Pilot → Kubernetes API: Reads services and endpoints
  5. Citadel → Envoy: Provides certificates for mTLS
  6. Collectors → Grafana/Jaeger: Export telemetry data

Data Flow Patterns

  1. Traffic Flow: Ingress Gateway → Sidecar → Application → Sidecar → Destination
  2. Configuration Push: Pilot reads Kubernetes API → Converts to Envoy config → Pushes to sidecars
  3. mTLS Handshake: Client sidecar → Citadel (via Pilot Agent) → Server sidecar → Application
  4. Telemetry Collection: Sidecar → Metrics → Prometheus, Traces → Jaeger

Design Principles


Integration Approaches

Integration with Other CNCF Projects

API Patterns

Configuration Patterns

Extension Mechanisms


Common Pitfalls and How to Avoid Them

Misconfigurations

Performance Issues

Operational Challenges

Security Pitfalls


Coding Practices

Idiomatic Configuration

API Usage Patterns

Observability Best Practices

Testing Strategies

Development Workflow


Fundamentals

Essential Concepts

Terminology Glossary

Data Models and Types

Lifecycle Management

State Management


Scaling and Deployment Patterns

Horizontal Scaling

High Availability

Production Deployments

Upgrade Strategies

Resource Management


Additional Resources


Troubleshooting

Common Issues

  1. Deployment Failures
  1. Performance Issues
  1. Configuration Errors
  1. Integration Problems

Getting Help

Content generated automatically. Verify against official documentation before production use.

Tutorial

This tutorial will guide you through installing, configuring, and using Istio for service mesh management in Kubernetes.

Prerequisites

Before beginning, ensure you have:

Verify your setup:

# Check cluster connectivity
kubectl cluster-info

# Verify kubectl configuration
kubectl get nodes

# Check Kubernetes version (1.21+ recommended)
kubectl version --short

# Check if Envoy proxy sidecar injection is supported
kubectl get mutatingwebhookconfigurations

1. Installation

Istio can be installed using istioctl, Helm, or with managed offerings from cloud providers.

Method 1: Using istioctl (Recommended)
# Download istioctl
curl -L https://istio.io/downloadIstio | sh -

# Add istioctl to PATH
export PATH="$PATH:$(pwd)/istio-*/bin"
# Or for Linux:
# export PATH="$PATH:$(pwd)/istio-1.21.0/bin"

# Verify installation
istioctl version

# Or install istioctl via Homebrew (macOS/Linux)
brew install istioctl

# Or via Chocolatey (Windows)
choco install istioctl
Method 2: Using istioctl with Profile
# Install with default profile (recommended for production)
istioctl install --set profile=default -y

# Install with demo profile (for learning and testing)
istioctl install --set profile=demo -y

# Install with minimal profile (custom configuration)
istioctl install --set profile=minimal -y

# Install with custom settings
istioctl install --set profile=default \
  --set values.gateways.istio-ingressgateway.type=LoadBalancer \
  --set values.pilot.resources.requests.memory=1Gi \
  -y
Method 3: Using Helm
# Add the Istio Helm repository
helm repo add istio.io https://istio-release.storage.googleapis.com/charts
helm repo update

# Install Istio base charts
helm install istio-base istio.io/base -n istio-system --create-namespace

# Install Istio control plane
helm install istiod istio.io/istiod -n istio-system \
  --set global.sts.tokenAudience=istiod.istio-system.svc.service-account

# Install Istio ingress gateway
helm install istio-ingress istio.io/gateway -n istio-system \
  --set service.type=LoadBalancer

# Verify installation
kubectl get pods -n istio-system
Method 4: Using Managed Istio (Cloud Providers)
# Amazon EKS with AWS Distro for Istio
# See: https://aws.amazon.com/istio/

# Google GKE with Istio
gcloud container clusters update my-cluster \
  --update-istio=enabled \
  --istio-version=1.21.0

# Azure AKS with Istio
az aks update \
  --name myAKSCluster \
  --resource-group myResourceGroup \
  --enable-istio

2. Basic Configuration

Enable Sidecar Injection
# Enable injection on namespace
kubectl label namespace default istio-injection=enabled

# Or use label selector
kubectl label namespace production istio-injection=enabled

# Verify namespace is labeled
kubectl get namespace -L istio-injection

# Manually inject sidecar
kubectl get default -o yaml | istioctl kube-inject -f - | kubectl apply -f -
Configure Mesh Settings
# Create IstioOperator configuration
cat <<EOF | kubectl apply -f -
apiVersion: istio.io/v1beta1
kind: IstioOperator
metadata:
  name: istio-control-plane
  namespace: istio-system
spec:
  profile: default
  components:
    pilot:
      k8s:
        resources:
          requests:
            memory: "1024Mi"
            cpu: "500m"
        env:
        - name: PILOT_ENABLE_PROTOCOL_SNIFFING_FOR_OUTBOUND
          value: "true"
    ingressGateways:
    - name: istio-ingressgateway
      enabled: true
      k8s:
        service:
          type: LoadBalancer
EOF
Configure mTLS
# Enable mTLS in namespace
cat <<EOF | kubectl apply -f -
apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
  name: default
  namespace: production
spec:
  mtls:
    mode: STRICT
---
  related-skills: cncf-argo, cncf-artifact-hub, cncf-aws-eks, cncf-azure-aks
# Disable mTLS for specific workloads
apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
  name: explicit-disabled
  namespace: production
spec:
  selector:
    matchLabels:
      app: monitoring
  mtls:
    mode: DISABLE
EOF
Configure Gateways
# Create Gateway for external access
cat <<EOF | kubectl apply -f -
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
  name: myapp-gateway
  namespace: production
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - myapp.example.com
EOF

related-skills: cncf-argo, cncf-artifact-hub, cncf-aws-eks, cncf-azure-aks

3. Usage Examples

Deploying an Application with Istio
# Deploy the sleep application (sample app)
kubectl apply -f istio-*/samples/sleep/sleep.yaml

# Verify sidecar injection
kubectl get pods -l app=sleep

# Check injected sidecar
istioctl proxy-status

# Describe pod to see sidecar
kubectl describe pod sleep-xxxxx
Traffic Management Examples
# Create a Virtual Service
cat <<EOF | kubectl apply -f -
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: sleep
  namespace: default
spec:
  hosts:
  - sleep
  http:
  - route:
    - destination:
        host: sleep
        subset: v1
      weight: 100
---
  related-skills: cncf-argo, cncf-artifact-hub, cncf-aws-eks, cncf-azure-aks
# Create subsets
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
  name: sleep
  namespace: default
spec:
  host: sleep
  subsets:
  - name: v1
    labels:
      version: v1
EOF

# Apply traffic policy
istioctl analyze
Testing Circuit Breaking
# Configure circuit breaking
cat <<EOF | kubectl apply -f -
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
  name: myapp-circuit-breaker
  namespace: production
spec:
  host: myapp.production.svc.cluster.local
  trafficPolicy:
    connectionPool:
      tcp:
        maxConnections: 100
      http:
        h2UpgradePolicy: UPGRADE
        http1MaxPendingRequests: 100
        http2MaxRequests: 1000
    outlierDetection:
      consecutive5xxErrors: 5
      interval: 30s
      baseEjectionTime: 30s
      maxEjectionPercent: 50
EOF
Observability with Kiali
# Enable Kiali addon
istioctl install --set profile=demo -y

# Access Kiali dashboard
istioctl dashboard kiali

# Or port-forward manually
kubectl -n istio-system port-forward svc/kiali 20001:20001

# Access via browser
open http://localhost:20001

related-skills: cncf-argo, cncf-artifact-hub, cncf-aws-eks, cncf-azure-aks

4. Common Operations

Monitoring Mesh Health
# Check Istio components status
kubectl get pods -n istio-system

# Check proxy status
istioctl proxy-status

# Verify configuration
istioctl analyze

# Check sidecar injection status
istioctl proxy-status --injection

# View configuration dumps
istioctl proxy-config listeners <pod-name> -n <namespace>
istioctl proxy-config routes <pod-name> -n <namespace>
istioctl proxy-config clusters <pod-name> -n <namespace>
Debugging Service Mesh
# View Envoy logs
kubectl logs <pod-name> -c istio-proxy -n <namespace>

# View sidecar logs
kubectl logs <pod-name> -c sidecar-redirect -n <namespace>

# Test connectivity
istioctl proxy-status | grep SYMBOLIC-NAME
istioctl proxy-config <pod-name> -n <namespace>

# Check certificate status
istioctl proxy-config <pod-name> -n <namespace> --type certificate

# Verify mTLS status
istioctl proxy-check <pod-name> -n <namespace>
Managing Configuration
# List all Istio resources
kubectl get virtualservices -A
kubectl get destinationrules -A
kubectl get gateways -A
kubectl get servicesettings -A

# Dry-run configuration
istioctl analyze -I manifest.yaml

# Validate configuration
istioctl validate -f manifest.yaml

# Export configuration
istioctl proxy-config <pod-name> -n <namespace> -o json
Upgrading Istio
# Download new version
curl -L https://istio.io/downloadIstio | sh -
export PATH="$PATH:$(pwd)/istio-1.21.0/bin"

# Validate previous version
istioctl analyze

# Upgrade istioctl
istioctl upgrade --version 1.21.0

# Or use upgrade command
istioctl upgrade -y --version 1.21.0

# Verify upgrade
istioctl version
kubectl get pods -n istio-system

5. Best Practices

Configuration Best Practices
  1. Namespace Isolation: Use dedicated namespaces for different mesh components
  2. Resource Limits: Set appropriate CPU and memory limits for Istio components
  3. Auto-Injection: Enable sidecar injection selectively by namespace
  4. Version Management: Always use specific Istio versions in production
  5. Rolling Updates: Use rolling updates for Istio control plane
  6. Backup Configuration: Backup Istio configurations regularly
  7. Network Policies: Configure network policies for mesh security
  8. Monitoring: Enable metrics collection for all mesh components
Security Best Practices
  1. Enable mTLS: Always enable strict mTLS in production
  2. Rotate Certificates: Regularly rotate root and intermediate certificates
  3. Use Pod Security Policies: Restrict pod capabilities
  4. Network Policies: Implement network policies for micro-segmentation
  5. RBAC: Configure RBAC for Istio resources
  6. Audit Logging: Enable audit logging for security analysis
  7. Secret Management: Use external secret management
  8. Image Verification: Use verified Istio images
Observability Best Practices
  1. Collect All Metrics: Enable comprehensive metrics collection
  2. Distributed Tracing: Integrate with Jaeger or Zipkin
  3. Centralized Logging: Configure centralized logging
  4. Dashboards: Create Grafana dashboards for mesh metrics
  5. Alerting: Set up alerts for mesh health
  6. Service Graph: Monitor service dependency graph
  7. Latency Tracking: Track request latency across services
  8. Error Rates: Monitor error rates and trends
Performance Best Practices
  1. Optimize Sidecar: Configure sidecar resource limits appropriately
  2. Disable Unused Features: Disable features you don't use
  3. Use CRDs Efficiently: Limit the number of Istio CRDs
  4. Network Optimization: Configure network policies for optimal performance
  5. Caching: Enable caching where appropriate
  6. Compression: Enable HTTP compression
  7. Connection Pooling: Configure connection pooling
  8. Load Balancing: Choose appropriate load balancing strategies

Content generated automatically. Verify against official documentation before production use.

Examples

Virtual Service with Canary Deployment

# Virtual Service with traffic splitting for canary deployment
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: myapp
  namespace: production
spec:
  hosts:
  - myapp.production.svc.cluster.local
  http:
  # Main traffic (90%)
  - route:
    - destination:
        host: myapp.production.svc.cluster.local
        subset: main
      weight: 90
    - destination:
        host: myapp.production.svc.cluster.local
        subset: canary
      weight: 10
    headers:
      request:
        add:
          x-deployment: canary
    match:
    - headers:
        x-canary:
          exact: "true"
    route:
    - destination:
        host: myapp.production.svc.cluster.local
        subset: canary
  subsets:
  - name: main
    labels:
      version: v1
  - name: canary
    labels:
      version: v2

PeerAuthentication for Strict mTLS

# Enforce strict mTLS across the mesh
apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
  name: default
  namespace: production
spec:
  mtls:
    mode: STRICT
---
  related-skills: cncf-argo, cncf-artifact-hub, cncf-aws-eks, cncf-azure-aks
# Permissive mode for gradual migration
apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
  name: production-policy
  namespace: production
spec:
  mtls:
    mode: PERMISSIVE

Gateway with TLS Termination

# Ingress Gateway with TLS termination
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
  name: myapp-gateway
  namespace: production
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 443
      name: https
      protocol: HTTPS
    tls:
      mode: SIMPLE
      credentialName: myapp-tls-cert
    hosts:
    - myapp.example.com
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - myapp.example.com
    tls:
      httpsRedirect: true

When to Use

Use this skill when:


Core Workflow

  1. Assess Requirements — Understand the use case, scale, integration needs, and existing infrastructure. Checkpoint: Document requirements, constraints, and success criteria.
  1. Design Architecture — Plan component interactions, data flow, and deployment strategy using cloud-native best practices. Checkpoint: Verify the architecture addresses all requirements and follows CNCF conventions.
  1. Implement & Configure — Create manifests, configurations, and deployment scripts. Include resource limits, health checks, and observability hooks. Checkpoint: Validate all YAML against schema and test in a staging environment.
  1. Deploy & Monitor — Apply manifests to the cluster, verify component health, and confirm observability is working. Checkpoint: Confirm all pods/services are running, probes passing, and metrics/alerts configured.

Constraints

MUST DO

MUST NOT DO


Live References

These links are resolved at load time — content is fetched and inlined to provide the latest documentation.

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.