Commit 5ed0fab
Remove last-applied-configuration annotation during restore
Add removal of kubectl.kubernetes.io/last-applied-configuration annotation
to all OADP restore operations. This annotation can become very large and
cause restore failures.
The Problem:
- kubectl.kubernetes.io/last-applied-configuration stores entire resource spec
- For large resources (OpenStackControlPlane with many services), this can exceed etcd limits
- OADP restore fails with "annotation too large" or API server errors
- Observed in production: annotation size issues during restore
The Solution:
- Use OADP resourceModifiers to remove the annotation during restore
- Applied to ALL restore orders (00, 10, 20, 30, 40, 60)
- Consistent pattern everywhere using conditions: {}
Implementation:
- Updated "OwnerReference Handling" section → "OwnerReference and Annotation Handling"
- Added explanation of last-applied-configuration size issue
- Updated all example Restore CRs to include both patches:
1. Remove ownerReferences
2. Remove kubectl.kubernetes.io/last-applied-configuration
- Updated Phase 3 manual restore examples (all orders)
- Updated Key Points section to mention metadata cleanup
- Created CURRENT_JQ_HANDLING.md documenting all current jq transformations
resourceModifiers pattern (used everywhere):
```yaml
resourceModifiers:
- conditions: {} # Match all resources
patches:
- operation: remove
path: "/metadata/ownerReferences"
- operation: remove
path: "/metadata/annotations/kubectl.kubernetes.io~1last-applied-configuration"
```
Benefits:
- Prevents restore failures due to annotation size limits
- Removes stale client-side apply tracking
- Resource gets fresh annotation on next kubectl apply
- Consistent with current backup playbook behavior (already removes this)
Note:
- JSONPatch path escaping: kubectl.kubernetes.io/last-applied-configuration
→ /metadata/annotations/kubectl.kubernetes.io~1last-applied-configuration
(tilde followed by 1 escapes the forward slash)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent b5f3421 commit 5ed0fab
2 files changed
Lines changed: 228 additions & 16 deletions
| 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 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
494 | | - | |
| 494 | + | |
495 | 495 | | |
496 | | - | |
| 496 | + | |
497 | 497 | | |
498 | | - | |
| 498 | + | |
499 | 499 | | |
500 | | - | |
501 | | - | |
502 | | - | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
503 | 507 | | |
504 | 508 | | |
505 | 509 | | |
| |||
517 | 521 | | |
518 | 522 | | |
519 | 523 | | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
520 | 532 | | |
521 | 533 | | |
522 | | - | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
523 | 547 | | |
524 | 548 | | |
525 | 549 | | |
| |||
539 | 563 | | |
540 | 564 | | |
541 | 565 | | |
542 | | - | |
| 566 | + | |
543 | 567 | | |
544 | 568 | | |
545 | 569 | | |
546 | 570 | | |
547 | 571 | | |
548 | 572 | | |
| 573 | + | |
| 574 | + | |
549 | 575 | | |
550 | 576 | | |
551 | 577 | | |
| |||
560 | 586 | | |
561 | 587 | | |
562 | 588 | | |
563 | | - | |
| 589 | + | |
564 | 590 | | |
565 | 591 | | |
566 | 592 | | |
567 | 593 | | |
568 | 594 | | |
| 595 | + | |
| 596 | + | |
569 | 597 | | |
570 | 598 | | |
571 | | - | |
| 599 | + | |
572 | 600 | | |
573 | 601 | | |
574 | 602 | | |
575 | 603 | | |
576 | 604 | | |
577 | | - | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
578 | 608 | | |
579 | 609 | | |
580 | 610 | | |
| |||
1152 | 1182 | | |
1153 | 1183 | | |
1154 | 1184 | | |
1155 | | - | |
| 1185 | + | |
1156 | 1186 | | |
1157 | 1187 | | |
1158 | 1188 | | |
1159 | 1189 | | |
1160 | 1190 | | |
| 1191 | + | |
| 1192 | + | |
1161 | 1193 | | |
1162 | 1194 | | |
1163 | 1195 | | |
| |||
1178 | 1210 | | |
1179 | 1211 | | |
1180 | 1212 | | |
1181 | | - | |
| 1213 | + | |
1182 | 1214 | | |
1183 | 1215 | | |
1184 | 1216 | | |
1185 | 1217 | | |
1186 | 1218 | | |
| 1219 | + | |
| 1220 | + | |
1187 | 1221 | | |
1188 | 1222 | | |
1189 | 1223 | | |
| |||
1204 | 1238 | | |
1205 | 1239 | | |
1206 | 1240 | | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
1207 | 1249 | | |
1208 | 1250 | | |
1209 | 1251 | | |
| |||
1225 | 1267 | | |
1226 | 1268 | | |
1227 | 1269 | | |
1228 | | - | |
| 1270 | + | |
1229 | 1271 | | |
1230 | 1272 | | |
1231 | 1273 | | |
1232 | 1274 | | |
| 1275 | + | |
| 1276 | + | |
1233 | 1277 | | |
1234 | 1278 | | |
1235 | 1279 | | |
| |||
1261 | 1305 | | |
1262 | 1306 | | |
1263 | 1307 | | |
1264 | | - | |
| 1308 | + | |
1265 | 1309 | | |
1266 | 1310 | | |
1267 | 1311 | | |
1268 | 1312 | | |
1269 | 1313 | | |
| 1314 | + | |
| 1315 | + | |
1270 | 1316 | | |
1271 | 1317 | | |
1272 | 1318 | | |
| |||
1314 | 1360 | | |
1315 | 1361 | | |
1316 | 1362 | | |
1317 | | - | |
| 1363 | + | |
1318 | 1364 | | |
1319 | 1365 | | |
1320 | 1366 | | |
1321 | 1367 | | |
1322 | 1368 | | |
| 1369 | + | |
| 1370 | + | |
1323 | 1371 | | |
1324 | 1372 | | |
1325 | 1373 | | |
| |||
0 commit comments