upgrade

package
v0.0.0-...-a84f233 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 40 Imported by: 0

README

Upgrade

The upgrade package tests upgrading a downstream cluster to a higher specified K8s version in Rancher. The following workflow is followed:

  1. Provision a downstream cluster that
  2. Perform post-cluster provisioning checks
  3. Upgrade the K8s version of the downstream cluster
  4. Validate that the upgrade was successful

Table of Contents

  1. Getting Started
  2. Cloud Provider Migration

Getting Started

Please see an example config below using AWS as the node provider to first provision the cluster:

rancher:
  host: ""
  adminToken: ""
  insecure: true

provisioningInput:
  cni: ["calico"]
  providers: ["aws"]
  nodeProviders: ["ec2"]

clusterConfig:
  cni: "calico"
  provider: "aws"
  nodeProvider: "ec2"

awsCredentials:
  secretKey: ""
  accessKey: ""
  defaultRegion: "us-east-2"

awsMachineConfigs:
  region: "us-east-2"
  awsMachineConfig:
  - roles: ["etcd", "controlplane", "worker"]
    ami: ""
    instanceType: ""
    sshUser: ""
    vpcId: ""
    volumeType: ""
    zone: "a"
    retries: ""
    rootSize: ""
    securityGroup: [""]

amazonec2Config:
  accessKey: ""
  ami: ""
  blockDurationMinutes: "0"
  encryptEbsVolume: false
  httpEndpoint: "enabled"
  httpTokens: "optional"
  iamInstanceProfile: ""
  insecureTransport: false
  instanceType: ""
  monitoring: false
  privateAddressOnly: false
  region: "us-east-2"
  requestSpotInstance: true
  retries: ""
  rootSize: ""
  secretKey: ""
  securityGroup: [""]
  securityGroupReadonly: false
  spotPrice: ""
  sshKeyContents: ""
  sshUser: ""
  subnetId: ""
  tags: ""
  type: "amazonec2Config"
  useEbsOptimizedInstance: false
  usePrivateAddress: false
  volumeType: ""
  vpcId: ""
  zone: "a"           

Note: To see the provisioningInput in further detail, please review over the Provisioning README. See below how to run the test:

Kubernetes Upgrade
RKE1

gotestsum --format standard-verbose --packages=github.com/rancher/tests/validation/upgrade/rke1 --junitfile results.xml -- -timeout=60m -tags=validation -v -run "TestUpgradeRKE1KubernetesTestSuite/TestUpgradeRKE1Kubernetes"

RKE2/K3S

gotestsum --format standard-verbose --packages=github.com/rancher/tests/validation/upgrade/rke1 --junitfile results.xml -- -timeout=60m -tags=validation -v -run "TestUpgradeKubernetesTestSuite/TestUpgradeKubernetes"

Windows

gotestsum --format standard-verbose --packages=github.com/rancher/tests/validation/upgrade/rke2k3s --junitfile results.xml -- -timeout=60m -tags=validation -v -run "TestWindowsKubernetesUpgradeTestSuite/TestUpgradeWindowsKubernetes"

Cloud Provider Migration

Migrates a cluster's cloud provider from in-tree to out-of-tree

Current Support:
  • AWS
    • RKE1
    • RKE2
Pre-Requisites in the provided cluster
  • in-tree provider is enabled
  • out-of-tree provider is supported with your selected kubernetes version
Running the test
rancher:
  host: <your_host>
  adminToken: <your_token>
  insecure: true/false
  cleanup: false/true
  clusterName: "<your_cluster_name>"

note that no upgradeInput is required. See below how to run each of the tests:

gotestsum --format standard-verbose --packages=github.com/rancher/tests/validation/upgrade --junitfile results.xml -- -timeout=60m -tags=validation -v -run "TestCloudProviderMigrationTestSuite/TestAWS"

Cloud Provider Upgrade

Upgrades the chart version of cloud provider (CPI/CSI)

Current Support:
  • Vsphere
    • RKE1
Pre-Requisites on the cluster
  • cluster should have upgradeable CPI/CSI charts installed. You can do this via automation in provisioning/rke1 with the following option, chartUpgrade, which will install a version of the chart (latest - 1) that can later be upgraded to the latest version.
chartUpgrade:
  isUpgradable: true
Running the test
rancher:
  host: <your_host>
  adminToken: <your_token>
  insecure: true/false
  cleanup: false/true
  clusterName: "<your_cluster_name>"
vmwarevsphereCredentials:
  ...
vmwarevsphereConfig: 
  ...

See below how to run each of the tests:

gotestsum --format standard-verbose --packages=github.com/rancher/tests/validation/upgrade --junitfile results.xml -- -timeout=60m -tags=validation -v -run ^TestCloudProviderVersionUpgradeSuite$"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RKE1AWSCloudProviderMigration

func RKE1AWSCloudProviderMigration(t *testing.T, client *rancher.Client, clusterName string)

RKE1AWSCloudProviderMigration is a helper function to migrate from aws in-tree to out-of-tree on rke1 clusters

func RKE2AWSCloudProviderMigration

func RKE2AWSCloudProviderMigration(t *testing.T, client *rancher.Client, steveClusterObject *steveV1.SteveAPIObject)

RKE2AWSCloudProviderMigration is a helper function to migrate from aws in-tree to out-of-tree on rke2 clusters

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL