Introduction
Sometimes your main application needs some setup before it starts. The init container pattern lets you run a small helper container first to prepare things, like loading data or waiting for a service, before your main app runs.
When your app needs to wait for a database to be ready before starting.
When you want to load configuration files or secrets before the main app runs.
When you need to run a script to prepare data or environment before the main container.
When you want to ensure network services are reachable before launching your app.
When you want to separate setup logic from the main application for clarity and reuse.