Kubernetes Native Sidecar Containers
Native sidecar containers (stable in Kubernetes 1.29) solve a long-standing lifecycle problem: regular sidecar containers in the main containers list start and stop in an arbitrary order, causing proxy sidecars like Envoy to not be ready when the app starts, or log collectors to die before flushing the last batch. Native sidecars are init containers with restartPolicy: Always — they start before main containers and are guaranteed to terminate after them.
Overview
Overview
Native sidecar containers solve a persistent pain point of the sidecar pattern: no guaranteed lifecycle ordering between the proxy or collector and the main application. They arrived as beta, on by default, in Kubernetes 1.29 and graduated to stable in 1.33, with a single API field: restartPolicy: Always on an initContainer.
With that one field, the kubelet runs the pod's life in a fixed order.
- The kubelet starts the sidecar, declared as an initContainer with restartPolicy: Always, first.
- The sidecar reports ready.
- The kubelet starts the app container.
- Both run for the pod's life.
- At shutdown, the kubelet terminates the app first.
- It terminates the sidecar last, after the sidecar has flushed.
Key concepts
- restartPolicy on initContainers
Sign up free to read the full topic
More DevOps topics
- Kubernetes Descheduler
- Kubernetes Error Triage — Symptoms, Exit Codes and Cloud Equivalents
- Kubernetes Evictions and Node Pressure
- Kubernetes Gateway API v1
- Kubernetes Multi-cloud and Hybrid Cluster Patterns
- Kubernetes Multi-tenancy Patterns
- Kubernetes Network Policies
- Kubernetes Networking Deep Dive
- Kubernetes Observability: Metrics, Logs, and Traces
- Kubernetes Operators & CRDs
- Kubernetes Pod Networking & CNI
- Kubernetes Pod Scheduling
Start free on Cariara · Coding problems · System design studio