A new storage profile has been created and added to a vSphere namespace from vCenter UI, but a guest cluster in the same namespace doesn't get the corresponding storageclass.
Example:
- A new storage profile 'new-added-profile' is assigned to the namespace from vCenter UI
- Now, the Supervisor Cluster shows the corresponding storageclass
# kubectl get storageclass
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
new-added-profile csi.vsphere.vmware.com Delete Immediate true 1h <<< Newly added one.
existing-storage-profile csi.vsphere.vmware.com Delete Immediate true 24h
- but Guest Cluster doesn't show the same storageclass
$ kubectl get storageclass
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
existing-storage-profile (default) csi.vsphere.vmware.com Delete Immediate true 26m
There may be no outstanding error message complaining about the newly added storage profile or corresponding storageclass.
vSphere with Tanzu
TanuKubernetesCluster API v1/alpha3
According to the doc https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere-supervisor/8-0/using-tkg-service-with-vsphere-supervisor/provisioning-tkg-service-clusters/using-the-tanzukubernetescluster-v1alpha3-api/tanzukubernetescluster-v1alpha3-api.html there is following explanation -
settings:
#storage defines persistent volume (PV) storage entries
#for container workloads; note that the storage used for
#node disks is defined by topology.controlPlane.storageClass
#and by spec.topology.nodePools[*].storageClass
storage:
#classes is a list of persistent volume (PV) storage
#classes to expose for container workloads on the cluster
#any class specified must be associated with the
#vSphere Namespace where the cluster is provisioned
#if omitted, all storage classes associated with the
#namespace will be exposed in the cluster
classes: [string]
In this case, the customer created the guest cluster with spec.settings.storage.classes set to one storage class, so no other storageclass in the same vSphere namespace will be automatically added to the guest cluster.
There are two options -
1. Delete all the existing classes from spec.settings.storage.classes of the guest cluster
Example:
# kubectl edit tkc my-tkc -n my-ns
:
storage:
classes:
- existing-storage-profile ## << Delete all lines under the classes and save & quit.
:
OR
2. Add the newly added storage class to the spec.settings.storage.classes
In this case, you'll have to do the same whenever new storage profiles are added to the vSphere namespace.
# kubectl edit tkc my-tkc -n my-ns
:
storage:
classes:
- existing-storage-profile
- new-added-profile ## Add the newly added profile here and save & quite.
Related SR 36220389 / PR 398315