Skip to content

How to upgrade an RKE2 downstream cluster using curl

This document (000021207) is provided subject to the disclaimer at the end of this document.

Environment

  • Rancher v2.7 or v2.8
  • A Rancher-managed RKE2 cluster

Situation

It is possible that the version of Kubernetes that you are upgrading to is not listed in the Rancher UI. Prior to Rancher v2.9, this is the case for deprecated versions, per this GitHub issue.

Resolution

The curl command below can be used to initiate the upgrade from the command line. You will need to set $token-bearer to a Rancher API Bearer Token, which can be created per the Rancher API Key documentation.

The format of the curl command:

curl -v -u "$token-bearer" \
-X PUT \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"rke2Config": {"kubernetesVersion": "v1.24.15+rke2r1"},"name": "$downstream-name"}' \
'$Rancher-URL-With-ClusterID'

Example:

curl -v -u "$token-bearer" \
-X PUT \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"rke2Config": {"kubernetesVersion": "v1.24.15+rke2r1"},"name": "test-rancher"}' \
'https://pitshou.rancher.cloud/v3/clusters/c-m-74phsk89'

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.