VKS Supervisor upgrade failure due to missing StorageClass
search cancel

VKS Supervisor upgrade failure due to missing StorageClass

book

Article ID: 425581

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

The Supervisor upgrade fails with the following error.

You can check the error via CLI in the Supervisor.

# /usr/lib/vmware-wcp/upgrade/upgrade-ctl.py get-status | jq .messages
[
  {
    "level": "error",
    "message": "Component StoragePolicyQuotaUpgrade failed: Failed to run command: ['kubectl', 'get', 'StorageClass', 'vsan-default-storage-policy', '--output=json'] ret=1 out= err=Error from server (NotFound): storageclasses.storage.k8s.io \"vsan-default-storage-policy\" not found\n"
  },
  {
    "level": "error",
    "message": "Component upgrade failed."
  }
]

Environment

vSphere Kubernetes Service

Cause

This issue occurs when a StorageClass assigned to the vSphere Namespace is missing from the Supervisor(k8s), likely due to accidental manual deletion.

In the example below, the "vSAN Default Storage Policy" is configured on the vSphere Namespace (Total 8 StorageClass objects).

 

However, this StorageClass does not exist in the Kubernetes layer of the Supervisor (Total 7 StorageClass objects).

# kubectl get sc
NAME                                       PROVISIONER
management-storage-policy-encryption       csi.vsphere.vmware.com
management-storage-policy-regular          csi.vsphere.vmware.com
management-storage-policy-single-node      csi.vsphere.vmware.com
management-storage-policy-stretched-lite   csi.vsphere.vmware.com
management-storage-policy-thin             csi.vsphere.vmware.com
vm-encryption-policy                       csi.vsphere.vmware.com
vsan-esa-default-policy-raid5              csi.vsphere.vmware.com

 

Resolution

To resolve this issue, you must manually create the missing StorageClass object within the Supervisor.

1. Log in to the target Supervisor Cluster

https://knowledge.broadcom.com/external/article/323407

2. Verify the missing StorageClass

kubectl get sc

3. Create the missing StorageClass object

Note: The following YAML is a sample for the vsan-default-storage-policy. You must adjust the name and other parameters within the YAML to match your specific environment if necessary.

# 1. Set the Storage Policy name (Change this value if needed)
STORAGEPOLICY=vsan-default-storage-policy

# 2. Create the YAML file
cat > ${STORAGEPOLICY}.yaml <<EOF
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ${STORAGEPOLICY}
allowVolumeExpansion: true
provisioner: csi.vsphere.vmware.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
EOF

# 3. Apply the configuration
kubectl apply -f ${STORAGEPOLICY}.yaml

4. Return to the vSphere Client and attempt to retry the Supervisor Upgrade

  • If the upgrade task is currently in progress or "hanging," please wait for the task to time out or fail before retrying
  • Once the task has cleared, re-initiate the upgrade process.

Additional Information

Japanese KB: StorageClass 欠損による VKS Supervisor のアップグレード失敗