By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
For engineers who need to deploy, debug, and secure microservices in Kubernetes—fast.
You’re running a Kubernetes cluster with 50+ microservices. Traffic flows between them, but: - Latency spikes when service-A calls service-B—how do you trace it? - A new team deploys service-C with no mTLS—how do you enforce encryption without changing their code? - A canary rollout of service-D fails—how do you shift 10% of traffic to the new version without downtime?
service-A
service-B
service-C
service-D
A service mesh (Istio, Linkerd) solves these problems by moving networking logic out of your app code and into a dedicated infrastructure layer. It gives you: ✅ Traffic control (retries, timeouts, circuit breaking) ✅ Security (mTLS, RBAC, policy enforcement) ✅ Observability (metrics, logs, traces without code changes) ✅ Resilience (automatic retries, load balancing, failover)
Without a service mesh, you’re stuck: - Adding try/catch blocks for retries in every service.- Managing TLS certificates manually (or worse, not using TLS at all).- Guessing why service-X is slow (no distributed tracing).- Rolling back entire deployments when a canary fails.
try/catch
service-X
Real-world scenario:You inherit a monolith being broken into microservices. The CTO demands: - Zero downtime deployments (canary, blue/green).- End-to-end encryption (mTLS between all services).- SLOs for latency (99th percentile under 100ms).- No code changes (teams are already overloaded).
A service mesh lets you enforce all of this at the infrastructure level—without touching a single line of app code.
istio-proxy
istiod
control-plane
ServiceEntry
VirtualService
istioctl analyze
leastConn
Ingress
Gateway
STRICT
kubectl
istioctl
# Download Istio (latest stable version) curl -L https://istio.io/downloadIstio | sh - cd istio-* export PATH=$PWD/bin:$PATH # Install Istio with demo profile (includes Prometheus, Grafana, Jaeger) istioctl install --set profile=demo -y # Verify installation kubectl get pods -n istio-system
Expected output:
NAME READY STATUS RESTARTS AGE istio-egressgateway-5d8f8c7c7c-abc12 1/1 Running 0 2m istio-ingressgateway-6d5f7c8d9d-xyz34 1/1 Running 0 2m istiod-7f8c9d6b5c-12345 1/1 Running 0 2m
# Enable automatic sidecar injection for the default namespace kubectl label namespace default istio-injection=enabled # Deploy Bookinfo (a sample microservices app) kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml # Verify pods (each should have 2 containers: app + sidecar) kubectl get pods
NAME READY STATUS RESTARTS AGE details-v1-5f4d5b6b7c-abc12 2/2 Running 0 1m productpage-v1-6d5f7c8d9d-xyz34 2/2 Running 0 1m ratings-v1-7f8c9d6b5c-12345 2/2 Running 0 1m reviews-v1-8c9d6b5c7c-54321 2/2 Running 0 1m
# Apply Gateway and VirtualService kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml # Get the external IP (Minikube: use NodePort) kubectl get svc istio-ingressgateway -n istio-system
For Minikube:
# Get the URL minikube service istio-ingressgateway -n istio-system --url
For cloud providers (EKS, GKE):
# Get the external IP kubectl get svc istio-ingressgateway -n istio-system -o jsonpath='{.status.loadBalancer.ingress[0].ip}'
Verify:Open the URL in a browser—you should see the Bookinfo product page.
# Deploy reviews-v2 (new version) kubectl apply -f samples/bookinfo/platform/kube/bookinfo-reviews-v2.yaml # Apply VirtualService to split traffic (90% v1, 10% v2) kubectl apply -f - <<EOF apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: reviews spec: hosts: - reviews http: - route: - destination: host: reviews subset: v1 weight: 90 - destination: host: reviews subset: v2 weight: 10 EOF # Define subsets in DestinationRule kubectl apply -f - <<EOF apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule metadata: name: reviews spec: host: reviews subsets: - name: v1 labels: version: v1 - name: v2 labels: version: v2 EOF
# Refresh the Bookinfo page multiple times # 90% of requests should show black stars (v1), 10% should show red stars (v2)
Expected behavior:- v1 (black stars): No ratings.- v2 (red stars): Ratings with red stars.
# Delete Bookinfo kubectl delete -f samples/bookinfo/platform/kube/bookinfo.yaml # Uninstall Istio istioctl uninstall --purge -y kubectl delete namespace istio-system
PERMISSIVE
yaml apiVersion: security.istio.io/v1beta1 kind: PeerAuthentication metadata: name: default spec: mtls: mode: STRICT
AuthorizationPolicy
yaml apiVersion: security.istio.io/v1beta1 kind: AuthorizationPolicy metadata: name: deny-all spec: {} # Deny all by default
yaml template: metadata: annotations: sidecar.istio.io/inject: "false"
Sidecar
CircuitBreaker
DestinationRule
yaml apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule metadata: name: my-service spec: host: my-service trafficPolicy: connectionPool: tcp: { maxConnections: 100 } http: { http2MaxRequests: 1000, maxRequestsPerConnection: 10 } outlierDetection: consecutiveErrors: 5 interval: 10s baseEjectionTime: 30s maxEjectionPercent: 50
istio_requests_total
istio_request_duration_milliseconds
istio_requests_rejected_total
bash kubectl port-forward svc/tracing 16686:16686 -n istio-system
http://localhost:16686
PeerAuthentication
sidecar.istio.io/inject: "false"
subsets
outlierDetection
Trap: DISABLE is not a valid mode (it’s the absence of mTLS).
DISABLE
Traffic Splitting
weight: 20
weight: 80
Trap: DestinationRule defines subsets, but does not split traffic.
Sidecar Injection
kubectl label namespace <ns> istio-injection=enabled
Trap: Annotations (sidecar.istio.io/inject: "true") override namespace labels.
sidecar.istio.io/inject: "true"
Gateway vs. Ingress
Trap: Gateway does not replace Ingress—it works alongside it.
Circuit Breaking
Challenge:Deploy a service (httpbin) and configure Istio to: 1. Rate limit to 10 requests per minute per client IP.2. Mirror (shadow) 100% of traffic to a second instance (httpbin-v2).
httpbin
httpbin-v2
Solution:```yaml
kubectl apply -f https://raw.githubusercontent.com/istio/istio/master/samples/httpbin/httpbin.yaml
kubectl apply -f - <<EOF apiVersion: networking.istio.io/v1alpha3 kind: EnvoyFilter metadata: name: httpbin-rate-limit spec: workloadSelector: labels: app: httpbin configPatches: - applyTo: HTTP_FILTER match: context: SIDECAR_INBOUND listener: portNumber: 80 filterChain: filter: name: "envoy.filters.network.http_connection_manager" patch: operation: INSERT_BEFORE value: name: envoy.filters.http.local_ratelimit typed_config: "@type": type.googleapis.com/udpa.type.v1.TypedStruct type_url: type.googleapis.com/envoy.extensions.filters.http.local_ratelimit.v3.LocalRateLimit value: stat_prefix: http_local_rate_limiter token_bucket: max_tokens: 10 tokens_per_fill: 10 fill_interval: 60s filter_enabled: runtime_key: local_rate_limit_enabled default_value: numerator: 100 denominator: HUNDRED filter_enforced: runtime_key: local_rate_limit_enforced default_value: numerator: 100 denominator: HUNDRED EOF
kubectl apply -f - <<EOF apiVersion: apps/v1 kind: Deployment metadata: name: httpbin-v2 spec: replicas: 1 selector: matchLabels: app: httpbin version: v2 template: metadata: labels: app: httpbin version: v2 spec: containers: - image: kennethreitz/httpbin name: httpbin ports: - containerPort: 80 EOF
kubectl apply -f - <<EOF apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: httpbin spec: hosts: - httpbin http: - route: - destination: host: httpbin subset: v1 weight: 100 mirror: host: httpbin subset: v2 mirrorPercentage: value: 100.0 EOF
kubectl apply -f - <<EOF apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.