A native sidecar is an init container whose restartPolicy is set to Always. Kubernetes starts it during pod initialization, but does not wait for it to terminate; instead, later init containers and regular containers start while the sidecar keeps running. This lets the sidecar provide a service throughout the pod’s lifetime, including to later init containers. section 5.5.4
Traffic meter alongside an application
A pod can place a traffic-meter container in initContainers with restartPolicy: Always, between ordinary init containers. The traffic meter starts before the application, remains available while the pod runs, and can be inspected with kubectl logs -f <pod> -c traffic-meter. A running pod reports the native sidecar among its ready containers. section 5.5.4
Native sidecars differ from ordinary init and regular containers in three practical ways:
- Kubernetes restarts the sidecar whenever it terminates, matching its role as a continuously available service. section 5.5.4
- The pod starts later init containers after the native sidecar has fully started, rather than waiting for it to finish. section 6.4.4
- During shutdown, Kubernetes terminates regular containers first and native sidecars afterward, in reverse order of their initContainers entries. section 6.4.4
- Jobs that need a sidecar that never completes should use this pattern so the sidecar does not prevent the task from finishing. section 18.3

