// Module included in the following assemblies:
//
// * rosa_upgrading/rosa-upgrading.adoc
// * rosa_upgrading/rosa-upgrading-sts.adoc

ifeval::["{context}" == "rosa-upgrading-sts"]
:sts:
endif::[]

:_content-type: PROCEDURE
[id="rosa-upgrading-cli_{context}"]
= Upgrading with the rosa CLI

You can upgrade a {product-title} cluster
ifdef::sts[]
that uses the AWS Security Token Service (STS)
endif::sts[]
manually by using the `rosa` CLI.

This method schedules the cluster for an immediate upgrade, if a more recent version is available.

.Prerequisites

* You have installed and configured the latest ROSA CLI on your installation host.
ifdef::sts[]
* If you are upgrading your cluster from 4.7 to 4.8, you have upgraded the AWS Identity and Access Management (IAM) account-wide roles and policies to version 4.8. You have also updated the `cloudcredential.openshift.io/upgradeable-to` annotation in the `CloudCredential` custom resource.
endif::sts[]

.Procedure

. To verify the current version of your cluster, enter the following command:
+
[source,terminal]
----
$ rosa describe cluster --cluster=<cluster_name|cluster_id> <1>
----
<1> Replace `<cluster_name|cluster_id>` with the cluster name or the ID of the cluster.

. To verify that an upgrade is available, enter the following command:
+
[source,terminal]
----
$ rosa list upgrade --cluster=<cluster_name|cluster_id>
----
+
The command returns a list of versions to which the cluster can be upgraded, including a recommended version.

. To upgrade a cluster to the latest available version, enter the following command:
+
[source,terminal]
----
$ rosa upgrade cluster --cluster=<cluster_name|cluster_id>
----
+
The cluster is scheduled for an immediate upgrade. This action can take an hour or longer, depending on your workload configuration, such as pod disruption budgets.
+
You will receive an email when the upgrade is complete. You can also check the status by running `rosa describe cluster` again from the `rosa` CLI or view the status in {cluster-manager} console.

ifeval::["{context}" == "rosa-upgrading-sts"]
:!sts:
endif::[]
