This is a cache of https://docs.openshift.com/container-platform/4.14/machine_management/cluster_api_machine_management/cluster-api-troubleshooting.html. It is a snapshot of the page at 2024-11-22T15:51:50.433+0000.
Troubleshooting Cluster <strong>api</strong> clusters - Managing machines with the Cluster <strong>api</strong> | Machine management | OpenShift Container Platform 4.14
×

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.

Use the information in this section to understand and recover from issues you might encounter. Generally, troubleshooting steps for problems with the Cluster api are similar to those steps for problems with the Machine api.

The Cluster Capi Operator and its operands are provisioned in the openshift-cluster-api namespace, whereas the Machine api uses the openshift-machine-api namespace. When using oc commands that reference a namespace, be sure to reference the correct one.

Referencing the intended objects when using the CLI

For clusters that use the Cluster api, OpenShift CLI (oc) commands prioritize Cluster api objects over Machine api objects.

This behavior impacts any oc command that acts upon any object that is represented in both the Cluster api and the Machine api. This explanation uses the oc delete machine command, which deletes a machine, as an example.

Cause

When you run an oc command, oc communicates with the Kube api server to determine which objects to act upon. The Kube api server uses the first installed custom resource definition (CRD) it encounters alphabetically when an oc command is run.

CRDs for Cluster api objects are in the cluster.x-k8s.io group, while CRDs for Machine api objects are in the machine.openshift.io group. Because the letter c precedes the letter m alphabetically, the Kube api server matches on the Cluster api object CRD. As a result, the oc command acts upon Cluster api objects.

Consequences

Due to this behavior, the following unintended outcomes can occur on a cluster that uses the Cluster api:

  • For namespaces that contain both types of objects, commands such as oc get machine return only Cluster api objects.

  • For namespaces that contain only Machine api objects, commands such as oc get machine return no results.

Workaround

You can ensure that oc commands act on the type of objects you intend by using the corresponding fully qualified name.

Prerequisites
  • You have access to the cluster using an account with cluster-admin permissions.

  • You have installed the OpenShift CLI (oc).

Procedure
  • To delete a Machine api machine, use the fully qualified name machine.machine.openshift.io when running the oc delete machine command:

    $ oc delete machine.machine.openshift.io <machine_name>
  • To delete a Cluster api machine, use the fully qualified name machine.cluster.x-k8s.io when running the oc delete machine command:

    $ oc delete machine.cluster.x-k8s.io <machine_name>