This section details how to upgrade the Kubernetes components in an existing VMware Cloud Director Container Service Extension 4.0.x cluster.

It is necessary to upgrade the Kubernetes components in existing VMware Cloud Director Container Service Extension 4.0.x clusters. By default, VMware Cloud Director Container Service Extension 4.0.x clusters operate on the following older versions of the Kubernetes components:
Kubernetes Component Existing Version Upgrade Version
Kubernetes Cloud Provider for VMware Cloud Director 1.3.0 or older versions 1.4.0
Kubernetes Container Storage Interface driver for VMware Cloud Director 1.3.2 or older versions 1.4.0
Kubernetes Cluster API Provider for VMware Cloud Director 1.0.2 or older versions 1.1.0
RDE-Projector 0.5.0 0.6.0

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:
    cd $HOME/cluster-upgrade-script
    docker pull projects.registry.vmware.com/vmware-cloud-director/cluster-upgrade-script-airgapped:v0.1.0
  4. After you pull the image, use docker to extract the image contents to the folder by creating a container and extracting it:
    docker container create --name "temp_container" projects.registry.vmware.com/vmware-cloud-director/cluster-upgrade-script-airgapped:v0.1.0
    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.