The pod boots. Containers spin up. One of them isn’t in your YAML. That’s the sidecar, injected on the fly.
Openshift sidecar injection is the technique of automatically adding containers to a pod at creation. It enables capabilities like logging agents, service mesh proxies, and security scanners without changing the application image. Sidecars run alongside your main container, sharing its network namespace and sometimes its volumes, delivering extra functions transparently.
In OpenShift, sidecar injection can be manual—declared in the deployment manifest—or dynamic, driven by admission controllers and mutating webhooks. The dynamic route uses Kubernetes API requests as they pass through the control plane. The webhook examines the pod spec, modifies it, and adds the sidecar container definition before the pod is scheduled.
For service meshes like Istio, automatic injection in OpenShift requires enabling the injector. This means configuring namespace-level labels, setting trusted certificates for the webhook, and verifying that admission plugins are active. Automatic injection removes the need to duplicate container specs across deployments, reducing configuration drift.