Commit 25dcc4d
fix(kotsadm): add wait-for-rqlite init container before schemahero migrations (#5925)
* fix(kotsadm): add wait-for-rqlite init container before schemahero
When kotsadm and rqlite restart simultaneously (e.g., during EC
upgrades), schemahero-plan runs before rqlite accepts connections,
causing CrashLoopBackOff with "tried all peers unsuccessfully".
Insert a wait-for-rqlite init container at position 0 in both the
Deployment and StatefulSet that polls http://kotsadm-rqlite:4001/readyz
until rqlite reports ready. This prevents the race between schemahero
and rqlite startup.
Affects both KotsadmDeployment() and KotsadmStatefulSet() init
container lists.
Closes replicated-collab/netbox-replicated#149
Ref: replicated-collab/netbox-replicated#148
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(kotsadm): add 5-min timeout, use lighter image, add unit tests
Address review findings:
- Add 5-minute timeout to wait loop so rqlite failures surface as a
clear init error rather than an indefinite hang
- Use kotsadm-migrations image (lighter, already pulled for schemahero)
- Replace private repo link with Shortcut story reference
- Add unit tests for waitForRqliteInitContainer() and verify init
container ordering in KotsadmDeployment()
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor(kotsadm): extract wait-for-rqlite script to embedded .sh file
Per review feedback: move the inline shell script out of the Go source
and load it via go:embed, matching the existing pattern used by
minio_objects.go for scripts/{copy,export,import}-minio-data.sh.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 8de414a commit 25dcc4d
3 files changed
Lines changed: 99 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
| |||
195 | 200 | | |
196 | 201 | | |
197 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
198 | 229 | | |
199 | 230 | | |
200 | 231 | | |
| |||
493 | 524 | | |
494 | 525 | | |
495 | 526 | | |
| 527 | + | |
496 | 528 | | |
497 | 529 | | |
498 | 530 | | |
| |||
1086 | 1118 | | |
1087 | 1119 | | |
1088 | 1120 | | |
| 1121 | + | |
1089 | 1122 | | |
1090 | 1123 | | |
1091 | 1124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
226 | 229 | | |
227 | 230 | | |
228 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments