Init container
A Kubernetes container that runs to completion before the main container starts. Use: wait for dependencies (DB ready), DB schema migration, fetch secrets/config, set filesystem permissions.
Multiple init containers run sequentially. If one fails, the whole pod restarts per restartPolicy. Completely separate from the main image — can be a tiny Alpine + bash script while main is a 1 GB Java app. Since Kubernetes 1.29, there are native sidecar containers (init container with restartPolicy=Always) that replace many init patterns. Pre-sidecar: a log shipper as init container was a hack — it died on main restart.