On clusters that support migrating Machine api resources to Cluster api resources, a two-way synchronization controller creates the following Cluster api resources in the openshift-cluster-api
namespace:
-
One or more machine templates that correspond to compute machine sets.
-
One or more compute machine sets that manage three compute machines.
-
One or more Cluster api compute machines that correspond to each Machine api compute machine.
|
The two-way synchronization controller only operates on clusters with the MachineapiMigration feature gate in the TechPreviewNoUpgrade feature set enabled.
|
These Cluster api resources correspond to the resources that the installation program provisions in the openshift-machine-api
namespace for a cluster that uses the default configuration options.
The Cluster api resources have the same names as their Machine api counterparts and appear in the output of commands, such as oc get
, that list resources.
The synchronization controller creates the Cluster api resources in an unprovisioned (Paused
) state to prevent unintended reconciliation.
For supported configurations, you can migrate a Machine api resource to the equivalent Cluster api resource by changing which api it considers authoritative.
When you migrate a Machine api resources to the Cluster api, you transfer management of the resource to the Cluster api.
By migrating a Machine api resource to use the Cluster api, you can verify that everything works as expected before deciding to use the Cluster api in production clusters.
After migrating a Machine api resource to an equivalent Cluster api resource, you can examine the new resource to verify that the features and configuration match the original Machine api resource.
When you change the authoritative api for a compute machine set, any existing compute machines that the compute machine set manages retain their original authoritative api.
As a result, a compute machine set that manages machines that use different authoritative apis is a valid and expected occurrence in clusters that support migrating between these api types.
When you change the authoritative api for a compute machine, the instance on the underlying infrastructure that backs the machine is not recreated or reprovisioned.
In-place changes, such as modifying labels, tags, taints, or annotations, are the only changes that the api group can make to the underlying instance that backs the machine.
|
You can only migrate some resources on supported infrastructure types.
|
Table 1. Supported resource conversions
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 Machine api resource to use the Cluster api
You can migrate individual Machine api objects to equivalent Cluster api objects.
|
Migrating a Machine api resource to use 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.
|
Prerequisites
-
You have deployed an OKD cluster on a supported infrastructure type.
-
You have enabled the use of the Cluster api.
-
You have enabled the MachineapiMigration
feature gate in the TechPreviewNoUpgrade
feature set.
-
You have access to the cluster using an account with cluster-admin
permissions.
-
You have installed the OpenShift CLI (oc
).
Procedure
-
Identify the Machine api resource that you want to migrate to a Cluster api resource by running the following command:
$ oc get <resource_kind> -n openshift-machine-api
where <resource_kind>
is one of the following values:
machine.machine.openshift.io
-
The fully qualified name of the resource kind for a compute or control plane machine.
machineset.machine.openshift.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-api
<resource_kind>
-
Specifies a compute machine with machine.machine.openshift.io
or compute machine set with machineset.machine.openshift.io
.
<resource_name>
-
Specifies the name of the Machine api resource that you want to migrate to a Cluster api resource.
-
In the resource specification, update the value of the spec.authoritativeapi
field:
apiVersion: machine.openshift.io/v1beta1
kind: <resource_kind> (1)
metadata:
name: <resource_name> (2)
[...]
spec:
authoritativeapi: Clusterapi (3)
[...]
status:
authoritativeapi: Machineapi (4)
[...]
1 |
The resource kind varies depending on the resource kind.
For example, the resource kind for a compute machine set is MachineSet and the resource kind for a compute machine is Machine . |
2 |
The name of the resource that you want to migrate. |
3 |
Specify the authoritative api that you want this resource to use.
For example, to start migrating a Machine api resource to the Cluster api, specify Clusterapi . |
4 |
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. |
Deploying Cluster api compute machines by using a Machine api compute machine set
You can configure a Machine api compute machine set to deploy Cluster api compute machines.
With this process, you can test the Cluster api compute machine creation workflow without creating and scaling a Cluster api compute machine set.
A Machine api compute machine set with this configuration creates nonauthoritative Machine api compute machines that use the Cluster api as authoritative.
The two-way synchronization controller then creates corresponding authoritative Cluster api machines that provision on the underlying infrastructure.
|
Deploying Cluster api compute machines by using a Machine api compute machine set 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.
|
Prerequisites
-
You have deployed an OKD cluster on a supported infrastructure type.
-
You have enabled the use of the Cluster api.
-
You have enabled the MachineapiMigration
feature gate in the TechPreviewNoUpgrade
feature set.
-
You have access to the cluster using an account with cluster-admin
permissions.
-
You have installed the OpenShift CLI (oc
).
Procedure
-
List the Machine api compute machine sets in your cluster by running the following command:
$ oc get machineset.machine.openshift.io -n openshift-machine-api
-
Edit the resource specification by running the following command:
$ oc edit machineset.machine.openshift.io <machine_set_name> \
-n openshift-machine-api
where <machine_set_name>
is the name of the Machine api compute machine set that you want to configure to deploy Cluster api compute machines.
-
In the resource specification, update the value of the spec.template.spec.authoritativeapi
field:
apiVersion: machine.openshift.io/v1beta1
kind: MachineSet
metadata:
[...]
name: <machine_set_name>
[...]
spec:
authoritativeapi: Machineapi (1)
[...]
template:
[...]
spec:
authoritativeapi: Clusterapi (2)
status:
authoritativeapi: Machineapi (3)
[...]
1 |
The unconverted value for the Machine api compute machine set.
Do not change the value in this part of the specification. |
2 |
Specify Clusterapi to configure the compute machine set to deploy Cluster api compute machines. |
3 |
The current value for the Machine api compute machine set.
Do not change the value in this part of the specification. |
Verification
-
List the machines that are managed by the updated compute machine set by running the following command:
$ oc get machines.machine.openshift.io \
-n openshift-machine-api \
-l machine.openshift.io/cluster-api-machineset=<machine_set_name>
-
To verify that a machine created by the updated machine set has the correct configuration, examine the status.authoritativeapi
field in the CR for one of the new machines by running the following command:
$ oc describe machines.machine.openshift.io <machine_name> \
-n openshift-machine-api
For a Cluster api compute machine, the value of the field is Clusterapi
.