For clusters that were created using older versions of VMware Cloud Director Container Service Extension, it is necessary to perform a one time script upgrade. This allows the clusters to be compatible with the VMware Cloud Director Container Service Extension you want to use.

By default, clusters created in older versions of VMware Cloud Director Container Service Extension, operate on the following older versions of the Kubernetes components. It is necessary to upgrade to newer versions outlined below.
Kubernetes Components Existing Version Upgrade Version for 4.2 Upgrade Version for 4.2.1 Upgrade Version for 4.2.2
Kubernetes Cloud Provider for VMware Cloud Director 1.5.0, 1.4.1, or older versions 1.5.0 1.6.0 1.6.0
Kubernetes Container Storage Interface driver for VMware Cloud Director 1.5.0, 1.4.1, or older versions 1.5.0 1.6.0 1.6.0
Kubernetes Cluster API Provider for VMware Cloud Director 1.2.0, 1.1.1, or older versions 1.2.0 1.3.0 1.3.0
RDE-Projector 0.7.0, 0.6.1, or older versions 0.7.0 0.7.0 0.7.1

Prerequisites

Before you perform this task, ensure the following prerequisites are in place:
  • The machine must use Ubuntu GNU/Linux 20.04 operating system.
  • Ensure kubectl is installed. For more information, see Install and Set Up kubectl on Linux.
  • Ensure you install and operate Docker. For more information, see Install Docker Engine.
  • Ensure the kubeconfig of the cluster is present on the machine at an accessible path.

Procedure

  1. Use the following command to set $HOME directory:
    export $HOME=<directory of choice>
    Note: To confirm $HOME directory is set correctly, use the following command to print the $HOME directory. It should not be empty.
    echo $HOME
  2. Use the following command to create a folder structure for mounting and storing the cluster upgrade script content:
    mkdir -p $HOME/cluster-upgrade-script
  3. Navigate to the folder created, and use the following command to pull the cluster-upgrade-script image from http://projects.registry.vmware.com.
    • For 4.2:

      cd $HOME/cluster-upgrade-script
      docker pull projects.registry.vmware.com/vmware-cloud-director/cluster-upgrade-script-airgapped:v0.1.2
    • For 4.2.1:
      cd $HOME/cluster-upgrade-script
      docker pull projects.registry.vmware.com/vmware-cloud-director/cluster-upgrade-script-airgapped:v0.1.3
    • For 4.2.2:
      cd $HOME/cluster-upgrade-script
      docker pull projects.registry.vmware.com/vmware-cloud-director/cluster-upgrade-script-airgapped:v0.1.4
  4. After you pull the image, use docker to extract the image contents to the folder by creating a container and extracting it.
    • For 4.2:
      docker container create --name "temp_container" projects.registry.vmware.com/vmware-cloud-director/cluster-upgrade-script-airgapped:v0.1.2
      docker export "temp_container" | tar -C $HOME/cluster-upgrade-script -xvf - --strip-components 2
    • For 4.2.1:
      docker container create --name "temp_container" projects.registry.vmware.com/vmware-cloud-director/cluster-upgrade-script-airgapped:v0.1.3
      docker export "temp_container" | tar -C $HOME/cluster-upgrade-script -xvf - --strip-components 2
    • For 4.2.2:
      docker container create --name "temp_container" projects.registry.vmware.com/vmware-cloud-director/cluster-upgrade-script-airgapped:v0.1.4
      docker export "temp_container" | tar -C $HOME/cluster-upgrade-script -xvf - --strip-components 2
  5. After the contents are extracted to the folder, it is safe to remove the temporary container:
    docker container rm "temp_container" 
  6. After all the content is extracted to the main folder, open the directory, and update the permissions for the script:
    cd $HOME/cluster-upgrade-script
    chmod +x upgrade_cluster_components.sh
  7. Run the following command in the main folder:
    ./upgrade_cluster_components.sh kubeconfig-absolute-file-path [image registry] 
    
    Example: ./upgrade_cluster_components.sh $HOME/kubeconfig-cluster.txt projects.registry.vmware.com

    image_registry is an optional parameter, which defines the registry the script should pull images from and expects images such as CSI/CPI CRS, CAPVCD manifests, clusterctl, etc. to be hosted there.

    When you are not using private/local/airgap registry, use projects.registry.vmware.com as the image_registry. Alternatively if the parameter is empty, it defaults to image_registry: projects.registry.vmware.com.

    For private/local registry, use your registry link for the parameter. For example, my-private.registry.com. Ensure that the virtual machine that you run the scripts trust the registry, or it can run into errors such as x509 certificate signed by unknown authority.

    Note:
    • During script execution, all image artifacts are downloaded to $HOME/cluster-upgrade-packages/.
    • If there are any errors during the upgrade from the script, it is safe to remove this folder, and run the script again to create this folder.
    • An additional folder is created for clusterctl at $HOME/.cluster-api. It is safe to delete this folder as re-attempting to run the script creates this folder.

Results

After the upgrade cluster script has ran successfully, the cluster Kuberetes component versions are updated. You can view the updated Kubernetes component versions in the Kubernetes Container Clusters UI.