Cheat Sheets / Kubernetes & Platform

Service Mesh cheat sheet

75 commands from every lesson of Service Mesh — Istio & Linkerd, on one page.

01 · Why (and why not) a mesh

What a mesh gives

mTLS with workload identityEncryption + 'who is calling' for every hop
Authorization policiesAllow service A → B (by identity), not by IP
Traffic controlCanary splits, retries, timeouts, circuit breaking, fault injection
Uniform telemetryGolden signals for every service without code changes

What it costs

ResourcesProxies per pod (sidecar) or per node (ambient/ztunnel)
LatencyExtra proxy hops (typically sub-millisecond to a few ms each)
OperationsUpgrades, certificates, CRDs, debugging a new layer

02 · Istio architecture

Install & inspect

istioctl install --set profile=default (or profile=ambient)Install Istio (or use the Helm charts)
kubectl label namespace shop istio-injection=enabledSidecar mode: inject into new pods
kubectl label namespace shop istio.io/dataplane-mode=ambientAmbient mode: add a namespace to the mesh
istioctl waypoint apply -n shop --enroll-namespaceAmbient: add an L7 waypoint for the namespace
istioctl analyze -AFind configuration problems
istioctl proxy-status / istioctl proxy-config routes <pod>Is config pushed? What does this proxy know?

Core resources

PeerAuthentication / AuthorizationPolicy / RequestAuthenticationmTLS mode, access rules, JWT validation
VirtualService / DestinationRule (or Gateway API HTTPRoute)Routing and traffic policy
ServiceEntry / Sidecar / TelemetryExternal services, proxy scope, telemetry config

03 · Linkerd architecture

Install & check

linkerd check --preValidate the cluster before installing
linkerd install --crds | kubectl apply -f - && linkerd install | kubectl apply -f -Install CRDs, then the control plane (CLI method)
linkerd checkVerify the installation
kubectl annotate ns shop linkerd.io/inject=enabledInject proxies into new pods
linkerd viz install | kubectl apply -f - && linkerd viz dashboardMetrics extension and dashboard

Observe & debug

linkerd viz stat deploy -n shopSuccess rate, RPS, latency per deployment
linkerd viz top deploy/cart -n shopLive top requests
linkerd viz tap deploy/cart -n shopStream live requests (metadata)
linkerd viz edges deploy -n shopWhich connections are mTLS'd, by identity

04 · mTLS & identity

Identity

spiffe://cluster.local/ns/shop/sa/cartIstio SPIFFE ID (trust domain / namespace / service account)
cart.shop.serviceaccount.identity.linkerd.cluster.localLinkerd identity name
One service account per workloadIdentities are only as fine-grained as service accounts

Istio mTLS & authz

PeerAuthentication mtls.mode: PERMISSIVE → STRICTAccept both, then only mTLS
PeerAuthentication in istio-system (root namespace)Mesh-wide default
AuthorizationPolicy: from.source.principals: [cluster.local/ns/shop/sa/frontend]Allow by identity
istioctl x describe pod <pod>Effective mTLS/policy for a pod

05 · Inside the sidecar & the mTLS handshake

Sidecar injection

kubectl get mutatingwebhookconfiguration | grep istioThe webhook that injects the sidecar
kubectl label namespace demo istio-injection=enabledInject sidecars into new pods in this namespace
kubectl -n demo get pod -l app=sleep -o jsonpath='{.items[0].spec.containers[*].name}'Containers actually stored (app + istio-proxy)
kubectl -n demo rollout restart deployExisting pods only get a sidecar when re-created

Inside the sidecar

kubectl -n demo exec deploy/sleep -c istio-proxy -- idRuns as UID 1337 (excluded from traffic redirection)
kubectl -n demo exec deploy/sleep -c istio-proxy -- pilot-agent request GET listenersEnvoy listeners via the local admin API
kubectl -n demo exec deploy/sleep -c istio-proxy -- pilot-agent request GET certsCertificates Envoy holds: SPIFFE SAN, serial, expiry
kubectl -n demo exec deploy/httpbin -c istio-proxy -- pilot-agent request GET stats | grep -E 'ssl\.(handshake|connection_error|fail_verify)'Handshake and verification counters

Trust and CA

kubectl -n istio-system get configmap istio -o yaml | grep -i trustDomainThe mesh trust domain (default cluster.local)
kubectl -n demo get configmap istio-ca-root-cert -o jsonpath='{.data.root-cert\.pem}' | openssl x509 -noout -subject -datesThe root every proxy trusts
kubectl -n istio-system get secret istio-ca-secret cacerts --ignore-not-foundSelf-signed CA (istio-ca-secret) or plug-in CA (cacerts)

06 · Lab: from no mesh to STRICT mTLS

Install

helm repo add istio https://istio-release.storage.googleapis.com/chartsAdd the official Istio chart repository
helm install istio-base istio/base -n istio-system --create-namespace --set defaultRevision=default --waitCRDs and cluster-wide resources
helm install istiod istio/istiod -n istio-system --waitControl plane (CA + config)
istioctl install --set profile=minimal -yQuick alternative: istiod only

Verify with istioctl

istioctl proxy-statusEvery sidecar SYNCED with istiod
istioctl x describe pod <pod> -n demoEffective mTLS mode and policies
istioctl proxy-config secret deploy/httpbin -n demoCertificates loaded in Envoy, with expiry

Verify with kubectl only

kubectl get peerauthentication -AWhich mTLS modes are set, where
kubectl -n demo exec deploy/httpbin -c istio-proxy -- pilot-agent request GET certsCertificates: SPIFFE SAN, serial, expiry
kubectl -n demo exec deploy/httpbin -c istio-proxy -- pilot-agent request GET stats/prometheus | grep connection_security_policymTLS vs plain-text request counts
kubectl -n demo port-forward deploy/httpbin 15000:15000 && curl -s localhost:15000/certsEnvoy admin API from your laptop

07 · Traffic management

Routing

HTTPRoute backendRefs weights: 90 / 10Canary split (Gateway API; Istio and Linkerd)
VirtualService http.route[].weight + DestinationRule subsetsCanary split (Istio API)
Argo Rollouts / FlaggerAutomate canary steps with metric analysis

Resilience

timeout: 2s (per route)Never wait forever
retries: attempts: 2, perTryTimeout: 500ms, retryOn: connect-failure,refused-stream,unavailableRetry only safe failures
connectionPool + outlierDetection (DestinationRule)Circuit breaking and ejecting bad endpoints
fault: delay / abort (VirtualService)Inject failures to test behaviour

08 · Mesh observability

Istio metrics

istio_requests_total{reporter, source_workload, destination_workload, response_code}Request counts
istio_request_duration_milliseconds_bucketLatency histogram
reporter="destination" (server side) vs "source" (client side)Avoid double counting

Linkerd & tools

request_total, response_total, response_latency_ms_bucketLinkerd proxy metrics
linkerd viz stat / routes / edgesCLI golden signals
KialiIstio service graph, config validation

09 · Upgrades & production patterns

Istio revision upgrade

istioctl install --set revision=1-26-0Install the new control plane alongside the old
istioctl tag set prod-stable --revision 1-26-0 --overwritePoint a stable tag at the new revision
kubectl label ns shop istio.io/rev=prod-stable --overwrite (remove istio-injection)Namespaces follow the tag
kubectl rollout restart deploy -n shopMove pods to the new sidecar
istioctl uninstall --revision 1-25-2Remove the old control plane when empty

Linkerd & general

linkerd upgrade | kubectl apply -f - (or helm upgrade)Upgrade the control plane
linkerd check --proxyCheck proxies' versions and health
Upgrade one minor at a time; read release notesSupported paths