|
| 1 | +# New Module Submission and Promotion Process: Migration Guide |
| 2 | + |
| 3 | +To ensure a smooth transition, the submission pipeline, and Lifecycle Manager support **both** the old and new metadata formats. If both are present, Lifecycle Manager prefers the new format. If no new metadata format is provided, it falls back to the old channel-based metadata. |
| 4 | + |
| 5 | +The migration strategy involves replicating the current state with the NEW metadata while keeping the old metadata as a fallback. |
| 6 | + |
| 7 | +## Migration Procedure |
| 8 | + |
| 9 | +1. Submit the existing versions using the NEW approach. |
| 10 | + |
| 11 | + The following example assumes the current module versions are: |
| 12 | + |
| 13 | + - `telemetry-regular` pointing to `1.32.0` |
| 14 | + - `telemetry-fast` pointing to `1.34.0` |
| 15 | + - `telemetry-experimental` pointing to `1.34.0-experimental` |
| 16 | + - `telemetry-dev` pointing to `1.35.0-rc1` |
| 17 | + |
| 18 | + You must re-submit all the above versions using the NEW approach. It means you must submit the following: |
| 19 | + |
| 20 | + - `/modules/telemetry/1.32.0/module-config.yaml` |
| 21 | + - `/modules/telemetry/1.34.0/module-config.yaml` |
| 22 | + - `/modules/telemetry/1.34.0-experimental/module-config.yaml` |
| 23 | + - `/modules/telemetry/1.35.0-rc1/module-config.yaml` |
| 24 | + |
| 25 | + For more information on the necessary changes in the `module-config.yaml` file, see [Migrating from Kyma CLI to `modulectl`](https://github.com/kyma-project/modulectl/blob/main/docs/contributor/migration-guide.md#2-module-configuration-module-configyaml-differences). |
| 26 | + |
| 27 | + Once you submit all the versions, the following ModuleTemplate custom resources (CRs) appear in the `/kyma/kyma-modules` repository: |
| 28 | + |
| 29 | + - `/telemetry/moduletemplate-telemetry-1.32.0.yaml` |
| 30 | + - `/telemetry/moduletemplate-telemetry-1.34.0.yaml` |
| 31 | + - `/telemetry/moduletemplate-telemetry-1.34.0-experimental.yaml` |
| 32 | + - `/telemetry/moduletemplate-telemetry-1.35.0-rc1.yaml` |
| 33 | + |
| 34 | +2. Submit the existing channel mapping using the NEW approach. |
| 35 | + |
| 36 | + Create a `/module-manifests/modules/<module-name>/module-releases.yaml` that replicates the existing channel mapping. For example: |
| 37 | + |
| 38 | + ```yaml |
| 39 | + channels: |
| 40 | + - channel: regular |
| 41 | + version: 1.32.0 |
| 42 | + - channel: fast |
| 43 | + version: 1.34.0 |
| 44 | + - channel: experimental |
| 45 | + version: 1.34.0-experimental |
| 46 | + - channel: dev |
| 47 | + version: 1.35.0-rc1 |
| 48 | + ``` |
| 49 | +
|
| 50 | + Once you submit the channel mapping, landscape-specific ModuleReleaseMeta CRs are created and kustomizations are updated accordingly in `/kyma/kyma-modules`. |
| 51 | + |
| 52 | + - `/telemetry` |
| 53 | + - `/moduletemplate-telemetry-1.32.0.yaml` |
| 54 | + - `/moduletemplate-telemetry-1.34.0.yaml` |
| 55 | + - `/moduletemplate-telemetry-1.34.0-experimental.yaml` |
| 56 | + - `/moduletemplate-telemetry-1.35.0-rc1.yaml` |
| 57 | + - `/dev` |
| 58 | + - `module-release-meta.yaml` with |
| 59 | + - channel `regular` => `1.32.0` |
| 60 | + - channel `fast` => `1.34.0` |
| 61 | + - channel `experimental` => `1.34.0-experimental` |
| 62 | + - channel `dev` => `1.35.0-rc1` |
| 63 | + - `/stage` |
| 64 | + - `module-release-meta.yaml` with |
| 65 | + - channel `regular` => `1.32.0` |
| 66 | + - channel `fast` => `1.34.0` |
| 67 | + - channel `experimental` => `1.34.0-experimental` |
| 68 | + - `/prod` |
| 69 | + - `module-release-meta.yaml` with |
| 70 | + - channel `regular` => `1.32.0` |
| 71 | + - channel `fast` => `1.34.0` |
| 72 | + - `/kustomizations` |
| 73 | + - `/dev` |
| 74 | + - `/kustomization.yaml` with |
| 75 | + - ModuleReleaseMeta `../../telemetry/dev/module-release-meta.yaml` |
| 76 | + - ModuleTemplate `../../telemetry/moduletemplate-telemetry-1.32.0.yaml` |
| 77 | + - ModuleTemplate `../../telemetry/moduletemplate-telemetry-1.34.0.yaml` |
| 78 | + - ModuleTemplate `../../telemetry/moduletemplate-telemetry-1.34.0-experimental.yaml` |
| 79 | + - ModuleTemplate `../../telemetry/moduletemplate-telemetry-1.35.0-rc1.yaml` |
| 80 | + - ... (resources from other modules) |
| 81 | + - `/stage` |
| 82 | + - `/kustomization.yaml` with |
| 83 | + - ModuleReleaseMeta `../../telemetry/stage/module-release-meta.yaml` |
| 84 | + - ModuleTemplate `../../telemetry/moduletemplate-telemetry-1.32.0.yaml` |
| 85 | + - ModuleTemplate `../../telemetry/moduletemplate-telemetry-1.34.0.yaml` |
| 86 | + - ModuleTemplate `../../telemetry/moduletemplate-telemetry-1.34.0-experimental.yaml` |
| 87 | + - ... (resources from other modules) |
| 88 | + - `/prod` |
| 89 | + - `/kustomization.yaml` with |
| 90 | + - ModuleReleaseMeta `../../telemetry/stage/module-release-meta.yaml` |
| 91 | + - ModuleTemplate `../../telemetry/moduletemplate-telemetry-1.32.0.yaml` |
| 92 | + - ModuleTemplate `../../telemetry/moduletemplate-telemetry-1.34.0.yaml` |
| 93 | + - ... (resources from other modules) |
| 94 | + |
| 95 | +3. Verify in KCP. |
| 96 | + |
| 97 | + ArgoCD picks up and deploys the changes from step 2. All landscapes have the same channel-version mapping of the module described in OLD and NEW metadata. |
| 98 | + |
| 99 | + Following the Telemetry module example, the following resources exist in KCP: |
| 100 | + |
| 101 | + **New ModuleTemplates** |
| 102 | + - ModuleTemplate `kyma-system/telemetry-regular` pointing to `1.32.0` |
| 103 | + - ModuleTemplate `kyma-system/telemetry-fast` pointing to `1.34.0` |
| 104 | + - ModuleTemplate `kyma-system/telemetry-experimental` pointing to `1.34.0-experimental` (only in DEV and STAGE) |
| 105 | + - ModuleTemplate `kyma-system/telemetry-dev` pointing to `1.35.0-rc1` (only in DEV) |
| 106 | + - ModuleReleaseMeta `kyma-system/telemetry` |
| 107 | + |
| 108 | + **Old ModuleTemplates** |
| 109 | + - ModuleTemplate `kyma-system/telemetry-1.32.0` |
| 110 | + - ModuleTemplate `kyma-system/telemetry-1.34.0` |
| 111 | + - ModuleTemplate `kyma-system/telemetry-1.34.0-experimental` (only in DEV and STAGE) |
| 112 | + - ModuleTemplate `kyma-system/telemetry-1.35.0-rc1` (only in DEV) |
| 113 | + |
| 114 | + As the new module metadata takes precedence, the reconciliation of the module already happens based on the new metadata. Since all versions and channel mappings are the same, no update is performed and all modules stay in the same state as before. |
| 115 | + |
| 116 | + The functionality can further be verified by enabling the module in a test SKR which will install it from scratch using the new metadata. |
| 117 | + |
| 118 | +4. [OPTIONAL] Roll back the new module metadata. |
| 119 | + |
| 120 | + In case of failure, the setup can be reverted to the old approach. |
| 121 | + |
| 122 | + To do so, a PR can be opened to `/kyma/kyma-modules` reverting the submission from 2. ArgoCD then undeploys the new module metadata and KLM falls back to the old module metadata. |
| 123 | + |
| 124 | +> [!Note] |
| 125 | +> After rollback, you can still use the old submission pipeline to submit new versions of the module while you're working on a fix. |
| 126 | + |
| 127 | +5. Submit a version upgrade using the old format. |
| 128 | + |
| 129 | + To avoid version downgrades, prepare for failure recovery and submit a version update using the old metadata. |
| 130 | + |
| 131 | + - `/modules/telemetry/regular/module-config.yaml` pointing to `1.34.0` (before `1.32.0`) |
| 132 | + |
| 133 | + Since the new metadata exists, Lifecycle Manager continues to use it. The old metadata is ignored but remains available for rollback. |
| 134 | + |
| 135 | +6. Submit the updated channel mapping with the NEW approach. |
| 136 | + |
| 137 | + After preparing the old metadata to rollback in case of failure, you can continue with the actual version update using the new metadata. |
| 138 | + |
| 139 | + Following the example, submit the `modules/telemetry/module-releases.yaml` file: |
| 140 | + |
| 141 | + ```yaml |
| 142 | + channels: |
| 143 | + - channel: regular |
| 144 | + version: 1.34.0 # <= this version is bumped |
| 145 | + - channel: fast |
| 146 | + version: 1.34.0 |
| 147 | + - channel: experimental |
| 148 | + version: 1.34.0-experimental |
| 149 | + - channel: dev |
| 150 | + version: 1.35.0-rc1 |
| 151 | + ``` |
| 152 | + |
| 153 | + Once you submit the mapping, the resources in `/kyma/kyma-modules` are the same as the resources from step 2, except the `regular` channel pointing to version `1.34.0` in all ModuleReleaseMeta CRs for different landscapes. |
| 154 | + |
| 155 | +7. Verify if the module is updated in KCP. |
| 156 | + |
| 157 | + ArgoCD picks up this change and deploys the new ModuleReleaseMeta to the different landscapes. Lifecycle Manager is now picking up the version change and updating all modules using the `regular` channel to version `1.34.0`. |
| 158 | + |
| 159 | +8. [OPTIONAL] Roll back the new metadata. |
| 160 | + |
| 161 | + In case of failure, you can revert the setup to the old approach. |
| 162 | + |
| 163 | + To do so, a PR can be opened to `/kyma/kyma-modules` reverting the submissions from steps 2 and 6. It is important to revert completely removing the entire new metadata from KCP so that KLM falls back to the old module metadata. |
| 164 | + |
| 165 | +> [!Note] |
| 166 | +> After rollback, you can still use the old submission pipeline to submit new versions of the module while you're working on a fix. |
| 167 | + |
| 168 | +9. Delete all old metadata files related to the module. |
| 169 | + |
| 170 | +10. Continue to use the NEW approach to provide new module versions and update the mapping of channels. |
0 commit comments