🔧 DevOps

Istio

Istio

A service mesh platform. Provides traffic management, security, and observability.

Detailed Explanation

Istio is a service mesh platform that manages communication between services in a microservices architecture. By injecting the Envoy proxy as a sidecar, it provides traffic control, security, and observability features without changing application code. It was jointly developed by Google, IBM, and Lyft, and is currently a CNCF graduated project.

Istio's core feature is traffic management. Through VirtualService and DestinationRule, you can declaratively configure A/B testing, canary deployments, traffic mirroring, and circuit breaker patterns. Even complex routing rules are applied with YAML configuration alone.

In terms of security, Istio automatically applies mTLS (mutual TLS) to encrypt communication between services. Fine-grained access control is possible with RBAC policies, and it also provides authentication/authorization features such as JWT validation. Because security policies are applied at the infrastructure level, developers can focus on business logic.

For observability, it supports automatic Prometheus metric collection, Jaeger/Zipkin distributed tracing integration, and Kiali service graph visualization. In production environments, Istio adds complexity, but its value shines when operating 50 or more microservices.

Code Example

# VirtualService - 카나리 배포 설정
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: product-service
  namespace: production
spec:
  hosts:
    - product-service
  http:
    - match:
        - headers:
            x-canary:
              exact: "true"
      route:
        - destination:
            host: product-service
            subset: v2
    - route:
        - destination:
            host: product-service
            subset: v1
          weight: 90
        - destination:
            host: product-service
            subset: v2
          weight: 10
---
# DestinationRule - 서킷 브레이커 설정
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
  name: product-service
spec:
  host: product-service
  trafficPolicy:
    connectionPool:
      tcp:
        maxConnections: 100
      http:
        h2UpgradePolicy: UPGRADE
        http1MaxPendingRequests: 100
    outlierDetection:
      consecutive5xxErrors: 5
      interval: 30s
      baseEjectionTime: 60s
  subsets:
    - name: v1
      labels:
        version: v1
    - name: v2
      labels:
        version: v2

How It's Said in Practice

Team Lead: "How should we proceed with the canary for this new version of the payment service using Istio?"

Developer: "I plan to route only 5% to v2 first, and gradually increase it while monitoring the error rate in Kiali."

Team Lead: "Good. And you've checked the circuit breaker settings, right? You remember the cascading failure we had last time."

Developer: "Yes, I configured outlierDetection to block for 60 seconds after 5 consecutive 5xx errors."

Interviewer: "Load balancing is possible even without Istio, so why would you go out of your way to adopt a service mesh?"

Candidate: "Traffic can be controlled without changing application code, and security policies such as mTLS can be applied consistently at the infrastructure level. In particular, distributed tracing is integrated automatically, which makes debugging microservices much easier."

Take a mock interview on this topic → WIA SOOM AI Interview · Start for free

Reviewer: "The VirtualService has no timeout setting. If a downstream service is delayed, it could cause a cascading impact."

Developer: "Ah, you're right. I'll add timeout: 3s to the http route and set retry to attempts: 3 as well."

Cautions

Learn More