|
1 | 1 | #!/bin/bash |
2 | 2 | # Migration 45 --> 46 |
3 | 3 | # Pin KubeadmConfigTemplate / KubeadmConfig objects with helm.sh/resource-policy=keep |
4 | | -# so the Talos migration (PR #2610) does not let Helm prune them while CAPI still |
| 4 | +# so the Talos worker migration does not let Helm prune them while CAPI still |
5 | 5 | # references them from the existing kubeadm-backed MachineSet. |
6 | 6 | # |
7 | | -# PR #2610 drops KubeadmConfigTemplate from the kubernetes app chart templates |
| 7 | +# This release drops KubeadmConfigTemplate from the kubernetes app chart templates |
8 | 8 | # entirely (workers move to TalosConfigTemplate). On upgrade Helm sees the |
9 | 9 | # resource present in the previous release manifest but absent in the new one |
10 | 10 | # and issues a delete. The old MachineSet, which is still around until CAPI |
|
14 | 14 | # MachineHealthCheck remediation, etc.) workers can hang in pending state with |
15 | 15 | # nothing to bootstrap from. |
16 | 16 | # |
17 | | -# The fix is to annotate every Helm-managed KubeadmConfigTemplate (and the |
18 | | -# KubeadmConfig instances spawned from them) with helm.sh/resource-policy=keep |
19 | | -# *before* the new chart renders. Helm then leaves the object alone, CAPI keeps |
20 | | -# its references intact, and the resources disappear naturally when the old |
21 | | -# MachineSet is finally garbage-collected after the Talos rollover completes. |
| 17 | +# The fix is to annotate every Helm-managed KubeadmConfigTemplate (and any |
| 18 | +# Helm-managed KubeadmConfig) with helm.sh/resource-policy=keep *before* the new |
| 19 | +# chart renders. The KubeadmConfig children CAPI spawns from the template are |
| 20 | +# owned by their Machine, not Helm (no app.kubernetes.io/managed-by=Helm label), |
| 21 | +# so Helm never prunes them and the managed-by selector below leaves them alone. |
| 22 | +# Helm then leaves the template alone, CAPI keeps its references intact, and the |
| 23 | +# resources disappear naturally when the old MachineSet is finally |
| 24 | +# garbage-collected after the Talos rollover completes. |
22 | 25 | # |
23 | 26 | # Idempotent: re-running on already-annotated objects is a no-op |
24 | 27 | # (kubectl annotate --overwrite tolerates the existing value). |
|
0 commit comments