Update precheck command 'oc adm upgrade recommend' in OpenShift
Environment
- Red Hat OpenShift Container Platform (RHOCP)
- 4
ocCLI
Issue
- Customer upgrades a cluster and encounters failures that could have been detected beforehand.
- Usage of the
oc adm upgrade recommendpre-check command before upgrades to identify possible issues.
Resolution
Starting with OpenShift 4.20.1, a new pre-check command oc adm upgrade recommend has been introduced for updates, in addition to oc adm upgrade status command. Refer to the OpenShift CLI (oc) release notes for the additional information.
Usage
-
Before starting any update, run the pre-check command:
$ oc adm upgrade recommend -
If the
ocbinary version used is older than 4.20.1, it will be needed to install a newer OpenShift CLI binary:$ oc version Client Version: 4.19.7
Refer to the official documentation for updating a cluster by using the CLI and using the oc adm upgrade recommend command to identify update risks for more details.
Root Cause
A new pre-check command oc adm upgrade recommend has been introduced for use before starting updates in OpenShift 4.20.
This command surfaces warnings about unschedulable nodes, MCP health, firing alerts, ODF readiness, and CNV compatibility. It does not block the upgrade; it provides information for the administrator to make an informed decision.
Note: this feature has been improved in 4.22
ocCLI.
Diagnostic Steps
-
Run the pre-check:
$ oc adm upgrade recommend -
Review each warning and its risk level before proceeding with the upgrade.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.