Migrate to v1beta2 APIs#
This guide explains changes introduced in new v1beta2 and how to migrate manifests from current v1beta1 to the new k0smotron API. For more details about each Api Group, please check current custom resource references.
Deprecation Policy#
Starting from v1.11.0, k0smotron uses new v1beta2 API version as storage version and deprecate v1beta1, which still served for compatibility. K0smotron follows the Kubernetes API deprecation policy for beta APIs:
v1beta1is deprecated oncev1beta2is the preferred/storage version.v1beta1will be removed no earlier thanmax(9 months, 3 minor releases)after deprecation.- Until removal,
v1beta1may still be served via conversion webhooks. - After removal, clients must use
v1beta2.
Changes per API group in v1beta2#
k0smotron.io#
Cluster#
- Storage config was restructured:
spec.kineDataSourceURL->spec.storage.kine.dataSourceURLspec.kineDataSourceSecretName->spec.storage.kine.dataSourceSecretNamespec.etcd->spec.storage.etcd- New selector field:
spec.storage.typewith valuesetcd,kine,nats.
- Introduce of
spec.patchesfor customize patching of generated resoruces inv1beta2. Check documentation about patches for more details. - Now, a Cluster state is reported using conditions as Kubernetes conventions follows. This implies:
- Move
Clusterstatus reporting to Conditions. Details about introduced conditions can be found in Pull Request #1365. - Deprecate legacy status fields such as
status.readyandstatus.reconciliationStatus. In v1beta2, this fields are stored understatus.deprecated.v1beta1for backward compatibility, and will be removed once v1beta1 support is dropped.
- Move
Warning
Downgrade caveat: spec.storage.type for nats type and spec.patches has no v1beta1 equivalent.
JoinTokenRequest#
- Changed the status section to use conditions for reporting status. This improvement includes:
- Following Kubernetes conventions for status reporting by adding
status.conditionsin v1beta2 (see related Pull Request #1416). - Deprecating the
status.reconciliationStatusfield. In v1beta2, this field is stored understatus.deprecated.v1beta1.reconciliationStatusfor backward compatibility, and will be removed once v1beta1 support is dropped.
- Following Kubernetes conventions for status reporting by adding
bootstrap.cluster.x-k8s.io#
K0sControllerConfig and K0sWorkerConfig#
spec.ignitionandspec.customUserDataRefmoved underspec.provisioner.- Renamed command fields:
spec.preStartCommands->spec.preK0sCommands.spec.postStartCommands->spec.postK0sCommands.
- The Status section has been changed to follow the CAPI v1beta2 API proposal.
- Status moved from boolean ready flag to initialization struct:
status.ready->status.initialization.dataSecretCreated.
- Status moved from boolean ready flag to initialization struct:
Some other changes may affect the internal Go types in k0smotron.
controlplane.cluster.x-k8s.io#
K0sControlPlane#
- Status fields aligned to CAPI v1beta2 style:
status.updatedReplicas->status.upToDateReplicas.status.unavailableReplicasreplaced bystatus.availableReplicas.status.initialized->status.initialization.controlPlaneInitialized.
- Several status counters are now optional pointers (may be unset early in reconciliation).
K0smotronControlPlane#
- Storage config was restructured:
spec.kineDataSourceURL->spec.storage.kine.dataSourceURLspec.kineDataSourceSecretName->spec.storage.kine.dataSourceSecretNamespec.etcd->spec.storage.etcd- New selector field:
spec.storage.typewith valuesetcd,kine,nats.
- Introduce of
spec.patchesfor customize patching of generated resoruces inv1beta2. Check documentation about patches for more details. - Now, a Cluster state is reported using conditions as Kubernetes conventions follows. This implies:
- Move
Clusterstatus reporting to Conditions. Details about introduced conditions can be found in Pull Request #1365. - Deprecate legacy status fields such as
status.readyandstatus.reconciliationStatus. In v1beta2, this fields are stored understatus.deprecated.v1beta1for backward compatibility, and will be removed once v1beta1 support is dropped.
- Move
- Status fields aligned to CAPI v1beta2 style:
status.updatedReplicas->status.upToDateReplicas.status.unavailableReplicasreplaced bystatus.availableReplicas.status.initialized->status.initialization.controlPlaneInitialized.
- Several status counters are now optional pointers (may be unset early in reconciliation).
Warning
Downgrade caveat: spec.storage.type for nats type and spec.patches has no v1beta1 equivalent.
infrastructure.cluster.x-k8s.io#
RemoteMachine#
- Rename
spec.CustomCleanCommandstospec.CleanCommandsfor simplicity. - Adapt
statusfields to the ones required by CAPIv1beta2:ready->status.initialization.provisioned.- Remove
status.failureReasonandstatus.failureMessageand use conditions instead to report state related to RemoteMachine.
RemoteCluster#
- Adapt
statusfields to the ones required by CAPIv1beta2:ready->status.initialization.provisioned.- Use conditions to report state related to RemoteCluster.