Kubernetes Sidecar Containers in v1.29
After years of workarounds, Kubernetes 1.29 introduces native sidecar container support via restartPolicy: Always in init containers.
The Old Way (Hack)
spec:
containers:
- name: app
image: myapp:latest
- name: istio-proxy
image: istio/proxyv2
Problem: No startup/shutdown ordering guarantees.
The New Way (Native)
spec:
initContainers:
- name: istio-proxy
image: istio/proxyv2
restartPolicy: Always
containers:
- name: app
image: myapp:latest
Why This Matters
- Proper lifecycle - Sidecars start before and stop after main containers
- Job support - Finally works correctly with batch workloads
- Resource accounting - Cleaner resource limits
Migration Notes
Istio 1.20+ supports this natively. Enable with:
istioctl install --set values.pilot.env.ENABLE_NATIVE_SIDECARS=true