You are deploying Istio in sidecar mode on a fleet that has more than one team writing manifests, and you want the install to survive Istio upgrades, namespace migrations, and the inevitable day someone disables injection on a namespace because “it broke a job”. The default istioctl install works for a demo cluster; this article is what we put on real clusters — IstioOperator-managed config, revision tags so upgrades are reversible, and resource floors on Envoy that prevent it from being evicted before the application is.
How to verify
The control plane should expose at least one revision:
kubectl -n istio-system get pods -l app=istiod -L istio.io/rev
istioctl tag list
Namespaces enrolled in the mesh should carry an injection label tied to a revision (not the plain enabled label):
kubectl get ns -L istio.io/rev,istio-injection
A pod in an enrolled namespace must have two containers — the app and istio-proxy:
kubectl -n app get pod -o jsonpath='{.items[0].spec.containers[*].name}'
End-to-end mTLS should be confirmed from the source pod:
kubectl exec -n app deploy/checkout -c istio-proxy -- \
curl -s -o /dev/null -w "%{http_code}\n" http://payments.app.svc.cluster.local/health
What’s happening
Sidecar mode injects an Envoy container into every workload pod via a mutating webhook. The injection is keyed off namespace labels — istio-injection=enabled (legacy) or istio.io/rev=<revision> (recommended). When a pod is admitted, the webhook adds an init container that programs iptables to redirect inbound and outbound TCP through the sidecar, the sidecar itself, and a holdApplicationUntilProxyStarts hook so the app does not start before Envoy is ready. The sidecar talks to istiod over xDS to receive config (clusters, listeners, routes, secrets), to SPIRE-style identity for mTLS, and to telemetry endpoints for metrics. Sidecar mode is the older, more battle-tested path; it gives you full L7 control out of the gate, at the cost of one Envoy per pod (200-400 MiB resident is typical in production, more under traffic). Compare with istio-ambient-mesh-install when the memory math no longer works.
The procedure
-
Pin a specific Istio version and create a revision. Never run the
defaultrevision in production — pin to1-24-3(or your chosen patch) so you can upgrade by adding a new revision next to the old one.ISTIO_VERSION=1.24.3 curl -L https://istio.io/downloadIstio | ISTIO_VERSION=$ISTIO_VERSION sh - sudo mv istio-$ISTIO_VERSION/bin/istioctl /usr/local/bin/ -
Install via an IstioOperator manifest stored in Git. This keeps your install reviewable and is the only sane way to manage multi-cluster.
# istio-operator.yaml apiVersion: install.istio.io/v1alpha1 kind: IstioOperator metadata: name: istiocontrolplane namespace: istio-system spec: revision: 1-24-3 profile: default meshConfig: accessLogFile: /dev/stdout enableAutoMtls: true defaultConfig: holdApplicationUntilProxyStarts: true proxyMetadata: ISTIO_META_DNS_CAPTURE: "true" values: global: proxy: resources: requests: cpu: 100m memory: 256Mi limits: memory: 512Mi components: pilot: k8s: resources: requests: cpu: 500m memory: 2Gi limits: memory: 4Gi hpaSpec: minReplicas: 2 maxReplicas: 5Then apply:
istioctl install -f istio-operator.yaml --skip-confirmation -
Create a stable tag pointing to the revision. Tags decouple namespaces from revision numbers:
istioctl tag set stable --revision 1-24-3Now namespaces label off
istio.io/rev=stable, and you move the tag at upgrade time — no namespace relabel needed. -
Enrol namespaces by revision tag, not by
injection=enabled.kubectl label namespace app istio.io/rev=stable kubectl label namespace app istio-injection-The second command removes the legacy label — they conflict and the webhook will refuse injection if both are present.
-
Roll the workloads. Existing pods are not auto-injected; restart deployments so the webhook fires on new pods:
kubectl -n app rollout restart deploymentVerify each pod now has two containers and the
istio-proxyready before declaring the namespace migrated. -
Test the upgrade path before you need it. Install revision
1-25-0alongside1-24-3, move thestabletag to1-25-0, restart one workload, observe. If it misbehaves, move the tag back and restart again. Once the whole fleet is on1-25-0, uninstall1-24-3:istioctl uninstall --revision 1-24-3
Operational notes
- Envoy memory grows with config size. A sidecar in a mesh of 200 services with 20 routes each can sit at 400-600 MiB resident. Set
requests.memoryto match steady state andlimits50% above. Under-set and the OOMKiller will pick the sidecar before the app, leaving you a confused engineer wondering why traffic dropped. holdApplicationUntilProxyStarts: trueis not the default but should be. Without it, your app boots, makes outbound calls, seesiptables: no Envoy, and crashloops. Set it inmeshConfig.defaultConfig.- DNS capture changes resolution. With
ISTIO_META_DNS_CAPTURE=true, the sidecar resolves DNS via a local listener. Useful for external mTLS, but it breaks tools that bypass/etc/resolv.conf(Java’s InetAddress cache, some Go static binaries). Test before enabling fleet-wide. - Webhook timeouts kill admission. The injection webhook has a default 10s timeout. If istiod is slow (CPU starved, large namespace count), pod admission fails. Watch
apiserver_admission_webhook_admission_duration_seconds{name="rev.namespace.sidecar-injector.istio.io"}and scale istiod accordingly. - Jobs and CronJobs need explicit handling. A Job that completes triggers a pod-completion lifecycle that the sidecar does not match. Use
proxy.istio.io/config: '{"holdApplicationUntilProxyStarts": false}'on Job pods and have the app curl/quitquitquiton the sidecar admin port at end of work.
Stack Harbor runs Istio in sidecar mode for clients whose L7 needs (path-aware auth, header-driven routing, mirror-on-canary) outweigh the per-pod memory cost, including the IstioOperator pipeline, revision tag discipline, and the upgrade rehearsal we run before every minor bump. If that is how you would rather run your mesh, see how we handle managed Kubernetes operations end to end.