Disabling the Cluster API
To stop using the Cluster API to automate the management of infrastructure resources on your OpenShift Container Platform cluster, convert any Cluster API resources on your cluster to equivalent Machine API resources.
Important
Managing machines with the Cluster API is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
Migrating Cluster API resources to Machine API resources
On clusters that support migrating between Machine API and Cluster API resources, the two-way synchronization controller supports converting a Cluster API resource to a Machine API resource.
Note
The two-way synchronization controller only operates on clusters with the MachineAPIMigration feature gate in the TechPreviewNoUpgrade feature set enabled.
You can migrate resources that you originally migrated from the Machine API to the Cluster API, or resources that you created as Cluster API resources initially. Migrating an original Machine API resource to a Cluster API resource and then migrating it back provides an opportunity to verify that the migration process works as expected.
Note
You can only migrate some resources on supported infrastructure types.
| Infrastructure | Compute machine | Compute machine set | Machine health check | Control plane machine set | Cluster autoscaler |
|---|---|---|---|---|---|
AWS |
Technology Preview |
Technology Preview |
Not Available |
Not Available |
Not Available |
All other infrastructure types |
Not Available |
Not Available |
Not Available |
Not Available |
Not Available |
Migrating a Cluster API resource to use the Machine API
You can migrate individual Cluster API objects to equivalent Machine API objects.
Important
Migrating a Cluster API resource to use the Machine API is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
-
You have deployed an OpenShift Container Platform cluster on a supported infrastructure type.
-
You have enabled the
MachineAPIMigrationfeature gate in theTechPreviewNoUpgradefeature set. -
You have access to the cluster using an account with
cluster-adminpermissions. -
You have installed the OpenShift CLI (
oc).
-
Identify the Cluster API resource that you want to migrate to a Machine API resource by running the following command:
$ oc get <resource_kind> -n openshift-cluster-apiwhere
<resource_kind>is one of the following values:machine.cluster.x-k8s.io-
The fully qualified name of the resource kind for a compute or control plane machine.
machineset.cluster.x-k8s.io-
The fully qualified name of the resource kind for a compute machine set.
-
Edit the resource specification by running the following command:
$ oc edit <resource_kind>/<resource_name> -n openshift-machine-apiwhere:
<resource_kind>-
Specifies a compute machine with
machine.machine.openshift.ioor compute machine set withmachineset.machine.openshift.io. <resource_name>-
Specifies the name of the Machine API resource that corresponds to the Cluster API resource that you want to migrate to the Machine API.
-
In the resource specification, update the value of the
spec.authoritativeAPIfield:apiVersion: machine.openshift.io/v1beta1 kind: <resource_kind> metadata: name: <resource_name> [...] spec: authoritativeAPI: MachineAPI [...] status: authoritativeAPI: ClusterAPI [...]where:
kind-
Specifies the resource kind of the resource that you want to migrate. For example, the resource kind for a compute machine set is
MachineSetand the resource kind for a compute machine isMachine. metadata.name-
Specifies the name of the resource that you want to migrate.
spec.authoritativeAPI-
Specifies the authoritative API that you want this resource to use. For example, to start migrating a Cluster API resource to the Machine API, specify
MachineAPI. status.authoritativeAPI-
Specifies the value for the current authoritative API. This value indicates which API currently manages this resource. Do not change the value in this part of the specification.
Important
Do not change other values when you update the value of the
spec.authoritativeAPIfield. Because other controllers might process updates to other values before the synchronization controller processes thespec.authoritativeAPIfield update, changing other values can cause unexpected behavior.For more information, see "Unexpected behavior when changing resource configurations".
-
Check the status of the conversion by running the following command:
$ oc -n openshift-machine-api get <resource_kind>/<resource_name> -o json | jq .status.authoritativeAPIwhere:
<resource_kind>-
Specifies a compute machine with
machine.machine.openshift.ioor compute machine set withmachineset.machine.openshift.io. <resource_name>-
Specifies the name of the Machine API resource that corresponds to the Cluster API resource that you want to migrate to the Machine API.
-
While the conversion progresses, this command returns a value of
Migrating. If this value persists for a long time, check the logs for thecluster-capi-operatordeployment in theopenshift-cluster-apinamespace for more information and to identify potential issues. -
When the conversion is complete, this command returns a value of
MachineAPI.
Important
Do not delete any nonauthoritative resource that does not use the current authoritative API unless you want to delete the corresponding resource that does use the current authoritative API.
When you delete a nonauthoritative resource that does not use the current authoritative API, the synchronization controller deletes the corresponding resource that does use the current authoritative API. For more information, see "Unexpected resource deletion behavior" in the Troubleshooting resource migration content.
Authoritative API types of compute machines
The authoritative API of a compute machine depends on the values of the .spec.authoritativeAPI and .spec.template.spec.authoritativeAPI fields in the Machine API compute machine set that creates it.
|
|
|
|
|
|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
Note
When the .spec.authoritativeAPI value is ClusterAPI, the Machine API machine set is not authoritative and the .spec.template.spec.authoritativeAPI value is not used.
As a result, the only combination that creates a compute machine with the Machine API as authoritative is where the .spec.authoritativeAPI and .spec.template.spec.authoritativeAPI values are MachineAPI.