|
| 1 | +# Migrate to v1beta2 APIs |
| 2 | + |
| 3 | +This guide explains changes introduced in new `v1beta2` and how to migrate manifests from current `v1beta1` to the new k0smotron API. |
| 4 | + |
| 5 | +## Deprecation Policy |
| 6 | + |
| 7 | +Starting from `PLACCEHOLDER`, k0smotron uses new `v1beta2` API version as storage version and deprecate `v1beta1`, which still served for compatibility. K0smotron follows the [Kubernetes API deprecation policy](https://kubernetes.io/docs/reference/using-api/deprecation-policy/) for beta APIs: |
| 8 | + |
| 9 | +- `v1beta1` is deprecated once `v1beta2` is the preferred/storage version. |
| 10 | +- `v1beta1` will be removed no earlier than `max(9 months, 3 minor releases)` after deprecation. |
| 11 | +- Until removal, `v1beta1` may still be served via conversion webhooks. |
| 12 | +- After removal, clients must use `v1beta2`. |
| 13 | + |
| 14 | +## Changes per API group |
| 15 | + |
| 16 | +### k0smotron.io |
| 17 | + |
| 18 | +#### Cluster |
| 19 | + |
| 20 | +- Storage config was restructured: |
| 21 | + - `spec.kineDataSourceURL` -> `spec.storage.kine.dataSourceURL` |
| 22 | + - `spec.kineDataSourceSecretName` -> `spec.storage.kine.dataSourceSecretName` |
| 23 | + - `spec.etcd` -> `spec.storage.etcd` |
| 24 | + - New selector field: `spec.storage.type` with values `etcd`, `kine`, `nats`. |
| 25 | +- Now, a Cluster state is reported using conditions as Kubernetes conventions follows. Details about introduced conditions can be found [here](https://github.com/k0sproject/k0smotron/pull/1365). This implies: |
| 26 | + - Move `Cluster` status reporting to Conditions. |
| 27 | + - Deprecate legacy status fields such as `status.ready` and `status.reconciliationStatus`. |
| 28 | +- TODO: check fields that can be removed in favor of patches. |
| 29 | + |
| 30 | +!!! note |
| 31 | + |
| 32 | + Downgrade caveat: `nats` has no `v1beta1` equivalent and is dropped on conversion back to `v1beta1` |
| 33 | + |
| 34 | +#### JoinTokenRequest |
| 35 | + |
| 36 | +- No changes between versions. |
| 37 | + |
| 38 | +### bootstrap.cluster.x-k8s.io |
| 39 | + |
| 40 | +#### K0sControllerConfig and K0sWorkerConfig |
| 41 | + |
| 42 | +- `spec.ignition` and `spec.customUserDataRef` moved under `spec.provisioner`. |
| 43 | +- Renamed command fields: |
| 44 | + - `spec.preStartCommands` -> `spec.preK0sCommands` |
| 45 | + - `spec.postStartCommands` -> `spec.postK0sCommands` |
| 46 | +- Status moved from boolean ready flag to initialization struct: |
| 47 | + - `status.ready` -> `status.initialization.dataSecretCreated` |
| 48 | + |
| 49 | +TODO: check CAPI changes |
| 50 | + |
| 51 | +### controlplane.cluster.x-k8s.io |
| 52 | + |
| 53 | +#### K0sControlPlane |
| 54 | + |
| 55 | +TODO: check CAPI changes |
| 56 | + |
| 57 | +- Status fields aligned to CAPI v1beta2 style: |
| 58 | + - `status.updatedReplicas` -> `status.upToDateReplicas` |
| 59 | + - `status.unavailableReplicas` replaced by `status.availableReplicas` |
| 60 | + - `status.initialized` -> `status.initialization.controlPlaneInitialized` |
| 61 | +- Several status counters are now optional pointers (may be unset early in reconciliation). |
| 62 | + |
| 63 | +### infrastructure.cluster.x-k8s.io |
| 64 | + |
| 65 | +TODO: check CAPI changes |
0 commit comments