|
1 | 1 | ---
|
2 | 2 | layout: blog
|
3 | 3 | title: "Start Sidecar First: How To Avoid Snags"
|
4 |
| -date: 2025-05-05 |
5 |
| -draft: true |
| 4 | +date: 2025-06-03 |
| 5 | +draft: false |
6 | 6 | slug: start-sidecar-first
|
7 | 7 | author: Agata Skorupka (The Scale Factory)
|
8 | 8 | ---
|
@@ -223,10 +223,10 @@ I’ll summarize the startup behavior in the table below:
|
223 | 223 |
|
224 | 224 | | Probe/Hook | Sidecar starts before the main app? | Main app waits for the sidecar to be ready? | What if the check doesn’t pass? |
|
225 | 225 | |----------------|----------------------------------------------------------|-----------------------------------------------------|----------------------------------------------------|
|
226 |
| -| readinessProbe | Yes, but it’s almost in parallel (effectively **no**) | **No** | Sidecar is not ready, main app is running | |
227 |
| -| livenessProbe | Yes, but it’s almost in parallel (effectively **no**) | **No** | Sidecar is restarted, main app is running | |
228 |
| -| startupProbe | Yes, but it’s almost in parallel (effectively **no**) | **Yes** | Main app is not started | |
229 |
| -| postStart | **Yes**, sequentially after postStart is executed | **Yes**, but you have to provide custom logic for that | Main app is not started | |
| 226 | +| `readinessProbe` | **Yes**, but it’s almost in parallel (effectively **no**) | **No** | Sidecar is not ready; main app continues running | |
| 227 | +| `livenessProbe` | Yes, but it’s almost in parallel (effectively **no**) | **No** | Sidecar is restarted, main app continues running | |
| 228 | +| `startupProbe` | **Yes** | **Yes** | Main app is not started | |
| 229 | +| postStart | **Yes**, main app container starts after `postStart` completes | **Yes**, but you have to provide custom logic for that | Main app is not started | |
230 | 230 |
|
231 | 231 | To summarize: with sidecars often being a dependency of the main application, you may want to delay the start of the latter until the sidecar is healthy.
|
232 | 232 | The ideal pattern is to start both containers simultaneously and have the app container logic delay at all levels, but it’s not always possible. If that's what you need, you have to use the right kind of customization to the Pod definition. Thankfully, it’s nice and quick, and you have the recipe ready above.
|
|
0 commit comments