Implement a production service mesh with Istio or Linkerd. Covers sidecar architecture, traffic management, mTLS, observability integration, and operational runbooks for enterprise environments.
This reference explains how to evaluate and operate service mesh systems in production environments. It covers operational patterns, configuration details, and failure modes relevant to teams deploying mesh-based networking in Kubernetes clusters.
Use the standard Helm chart to deploy a service mesh control plane:
helm repo add istio https://istio-release.storage.googleapis.com/charts
helm install istio-base istio/base -n istio-system --create-namespace
helm install istiod istio/istiod -n istio-system
To enable mesh routing for a new deployment, apply the following annotation:
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-app
annotations:
sidecar.istio.io/inject: "true"
spec:
template:
metadata:
annotations:
sidecar.istio.io/status: '{"version":"...","initContainers":["istio-init"],"containers":["istio-proxy"]}'
The proxy container starts automatically when the annotation is applied. If the istio-proxy container does not appear in pod status, check that the control plane is healthy:
kubectl get pods -n istio-system
Create an DestinationRule to configure traffic behavior:
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: example-app
spec:
host: example-app
trafficPolicy:
connectionPool:
http:
maxRequestsPerConnection: 10
Set circuit breaker thresholds in a DestinationRule:
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: example-app
spec:
host: example-app
trafficPolicy:
connectionPool:
http:
maxRequestsPerConnection: 10
outlierDetection:
consecutiveErrors: 5
interval: 10s
baseEjectionTime: 30s
If outlierDetection does not take effect, ensure that the service is using HTTP protocol in the VirtualService:
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: example-app
spec:
hosts:
- example-app
http:
- route:
- destination:
host: example-app
Apply retry policy to a service using DestinationRule:
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: example-app
spec:
host: example-app
trafficPolicy:
retries:
attempts: 3
perTryTimeout: 2s
In a VirtualService, define timeout behavior:
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: example-app
spec:
hosts:
- example-app
http:
- route:
- destination:
host: example-app
timeout: 5s
Use Prometheus for service mesh metrics. The following configuration adds Istio metrics to a scrape target:
apiVersion: v1
kind: Service
metadata:
name: istio-pilot
namespace: istio-system
labels:
istio: pilot
spec:
ports:
- port: 15014
name: http-monitoring
For basic dashboard access, expose the Istio dashboard:
kubectl port-forward svc/istio-ingressgateway -n istio-system 8080:80
If a pod does not contain an istio-proxy container, check that:
istiod) is running and healthy.kubectl get pods -n istio-system -l app=istiod
kubectl describe pod <pod-name> -n <namespace>
If traffic bypasses the mesh, verify that:
sidecar.istio.io/inject annotation is present.VirtualService.DestinationRule matches the host used by the VirtualService.kubectl get virtualservices -A
kubectl get destinationrules -A
If upgrading the control plane causes pods to fail, ensure that:
istiod deployment has sufficient resources.kubectl rollout status deployment/istiod -n istio-system
Changes to configuration may not appear immediately. Wait for the proxy to sync:
kubectl get pods -l istio.io/rev=latest -n <namespace>
kubectl logs <pod-name> -c istio-proxy
To upgrade control plane components, use Helm with updated chart versions:
helm upgrade istiod istio/istiod -n istio-system --set revision=1-17-0
After upgrade, verify that all components are running:
kubectl get pods -n istio-system -l app=istiod
Export current configuration with kubectl:
kubectl get istiooperators -A -o yaml > mesh-backup.yaml
Restore using:
kubectl apply -f mesh-backup.yaml
When running multiple versions of the mesh, specify the revision during installation:
helm install istiod-1-17 istio/istiod -n istio-system --set revision=1-17
Then use the revision in sidecar injection:
annotations:
sidecar.istio.io/revision: "1-17"
If control plane components fail, they may cause traffic disruption. Monitor:
kubectl get pods -n istio-system
kubectl logs deployment/istiod -n istio-system
If istiod fails to start, check its configuration for misconfigurations such as missing certificates or invalid ports.
Use weighted routing in VirtualService:
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: example-app
spec:
hosts:
- example-app
http:
- route:
- destination:
host: example-app
subset: v1
weight: 90
- destination:
host: example-app
subset: v2
weight: 10
Route traffic based on HTTP headers:
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: example-app
spec:
hosts:
- example-app
http:
- match:
- headers:
version:
exact: v2
route:
- destination:
host: example-app
subset: v2
Add delay and abort faults to simulate failures:
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: example-app
spec:
hosts:
- example-app
http:
- fault:
delay:
fixedDelay: 5s
percent: 100
route:
- destination:
host: example-app
Set limits for proxy containers:
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-app
spec:
template:
spec:
containers:
- name: istio-proxy
resources:
limits:
cpu: 200m
memory: 256Mi
Use the following endpoint to check proxy health:
kubectl exec -it <pod-name> -c istio-proxy -- curl localhost:15020/stats/prometheus
In cases where service mesh is not needed, disable sidecar injection:
annotations:
sidecar.istio.io/inject: "false"
If istio-proxy containers crash repeatedly, inspect the logs:
kubectl logs <pod-name> -c istio-proxy
Common causes include misconfigured certificates or invalid configuration.
When configuration does not propagate, check:
istiod pod health.kubectl logs deployment/istiod -n istio-system | grep "config"
If certificates expire or are misconfigured, restart istiod:
kubectl delete pod -n istio-system -l app=istiod
When traffic stops flowing, verify the following:
VirtualService matches the destination host.DestinationRule defines appropriate subsets.kubectl get virtualservice example-app -o yaml
kubectl get destinationrule example-app -o yaml
To rollback to a previous version:
helm rollback istiod -n istio-system --set revision=1-16-0
Ensure all proxies are updated before completing the rollback.
If configuration changes break traffic, restore from backup:
kubectl apply -f mesh-backup.yaml
If sidecar injection fails, disable it temporarily:
annotations:
sidecar.istio.io/inject: "false"
A mature service mesh setup includes:
The system should handle upgrades gracefully, maintain consistent performance, and provide clear observability signals without requiring external tools beyond standard Kubernetes monitoring stack.
This page was rewritten on 15 October 2026. It replaced a templated version that was not specific to its own title. How these pages are written and checked. If anything here is wrong, tell us at [email protected] and we will correct it.
We use cookies for analytics (Google Analytics) and advertising (Google AdSense) to improve your experience and support free content. Privacy Policy