Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 9. Troubleshooting hosted control planes
If you encounter issues with hosted control planes, see the following information to guide you through troubleshooting.
9.1. Gathering information to troubleshoot hosted control planes Link kopierenLink in die Zwischenablage kopiert!
When you need to troubleshoot an issue with hosted control plane clusters, you can gather information by running the
must-gather
The output for the management cluster contains the following content:
- Cluster-scoped resources: These resources are node definitions of the management cluster.
-
The
hypershift-dumpcompressed file: This file is useful if you need to share the content with other people. - Namespaced resources: These resources include all of the objects from the relevant namespaces, such as config maps, services, events, and logs.
- Network logs: These logs include the OVN northbound and southbound databases and the status for each one.
- Hosted clusters: This level of output involves all of the resources inside of the hosted cluster.
The output for the hosted cluster contains the following content:
- Cluster-scoped resources: These resources include all of the cluster-wide objects, such as nodes and CRDs.
- Namespaced resources: These resources include all of the objects from the relevant namespaces, such as config maps, services, events, and logs.
Although the output does not contain any secret objects from the cluster, it can contain references to the names of secrets.
Prerequisites
-
You must have access to the management cluster.
cluster-admin -
You need the value for the
nameresource and the namespace where the CR is deployed.HostedCluster -
You must have the command line interface installed. For more information, see Installing the hosted control planes command line interface.
hcp -
You must have the OpenShift CLI () installed.
oc -
You must ensure that the file is loaded and is pointing to the management cluster.
kubeconfig
Procedure
To gather the output for troubleshooting, enter the following command:
$ oc adm must-gather --image=registry.redhat.io/multicluster-engine/must-gather-rhel9:v<mce_version> \ /usr/bin/gather hosted-cluster-namespace=HOSTEDCLUSTERNAMESPACE hosted-cluster-name=HOSTEDCLUSTERNAME \ --dest-dir=NAME ; tar -cvzf NAME.tgz NAMEwhere:
-
You replace with the version of multicluster engine Operator that you are using; for example,
<mce_version>.2.4 -
The parameter is optional. If you do not include it, the command runs as though the hosted cluster is in the default namespace, which is
hosted-cluster-namespace=HOSTEDCLUSTERNAMESPACE.clusters -
The parameter is optional. Specify that parameter if you want to save the results of the command to a compressed file, replacing
--dest-dir=NAMEwith the name of the directory where you want to save the results.NAME
-
You replace
9.2. Pausing the reconciliation of a hosted cluster and hosted control plane Link kopierenLink in die Zwischenablage kopiert!
If you are a cluster instance administrator, you can pause the reconciliation of a hosted cluster and hosted control plane. You might want to pause reconciliation when you back up and restore an etcd database or when you need to debug problems with a hosted cluster or hosted control plane.
Procedure
To pause reconciliation for a hosted cluster and hosted control plane, populate the
field of thepausedUntilresource.HostedClusterTo pause the reconciliation until a specific time, enter the following command:
$ oc patch -n <hosted_cluster_namespace> hostedclusters/<hosted_cluster_name> -p '{"spec":{"pausedUntil":"<timestamp>"}}' --type=merge1 - 1
- Specify a timestamp in the RFC339 format, for example,
2024-03-03T03:28:48Z. The reconciliation is paused until the specified time is passed.
To pause the reconciliation indefinitely, enter the following command:
$ oc patch -n <hosted_cluster_namespace> hostedclusters/<hosted_cluster_name> -p '{"spec":{"pausedUntil":"true"}}' --type=mergeThe reconciliation is paused until you remove the field from the
resource.HostedClusterWhen the pause reconciliation field is populated for the
resource, the field is automatically added to the associatedHostedClusterresource.HostedControlPlane
To remove the
field, enter the following patch command:pausedUntil$ oc patch -n <hosted_cluster_namespace> hostedclusters/<hosted_cluster_name> -p '{"spec":{"pausedUntil":null}}' --type=merge
9.3. Scaling down the data plane to zero Link kopierenLink in die Zwischenablage kopiert!
If you are not using the hosted control plane, to save the resources and cost you can scale down a data plane to zero.
Ensure you are prepared to scale down the data plane to zero. Because the workload from the worker nodes disappears after scaling down.
Procedure
Set the
file to access the hosted cluster by running the following command:kubeconfig$ export KUBECONFIG=<install_directory>/auth/kubeconfigGet the name of the
resource associated to your hosted cluster by running the following command:NodePool$ oc get nodepool --namespace <HOSTED_CLUSTER_NAMESPACE>Optional: To prevent the pods from draining, add the
field in thenodeDrainTimeoutresource by running the following command:NodePool$ oc edit nodepool <nodepool_name> --namespace <hosted_cluster_namespace>Example output
apiVersion: hypershift.openshift.io/v1alpha1 kind: NodePool metadata: # ... name: nodepool-1 namespace: clusters # ... spec: arch: amd64 clusterName: clustername1 management: autoRepair: false replace: rollingUpdate: maxSurge: 1 maxUnavailable: 0 strategy: RollingUpdate upgradeType: Replace nodeDrainTimeout: 0s2 # ...NoteTo allow the node draining process to continue for a certain period of time, you can set the value of the
field accordingly, for example,nodeDrainTimeout.nodeDrainTimeout: 1mScale down the
resource associated to your hosted cluster by running the following command:NodePool$ oc scale nodepool/<NODEPOOL_NAME> --namespace <HOSTED_CLUSTER_NAMESPACE> --replicas=0NoteAfter scaling down the data plan to zero, some pods in the control plane stay in the
status and the hosted control plane stays up and running. If necessary, you can scale up thePendingresource.NodePoolOptional: Scale up the
resource associated to your hosted cluster by running the following command:NodePool$ oc scale nodepool/<NODEPOOL_NAME> --namespace <HOSTED_CLUSTER_NAMESPACE> --replicas=1After rescaling the
resource, wait for couple of minutes for theNodePoolresource to become available in aNodePoolstate.Ready
Verification
Verify that the value for the
field is greater thannodeDrainTimeoutby running the following command:0s$ oc get nodepool -n <hosted_cluster_namespace> <nodepool_name> -ojsonpath='{.spec.nodeDrainTimeout}'