Closed behniafb closed 11 months ago
Could you please share the list of the available the storage class in your cluster, with the command:
kubectl get sc
Could you please share the list of the available the storage class in your cluster, with the command:
kubectl get sc
I'm sorry that I can't do it right now, because I deleted the SC that I created (the local-path
- the one that Kubegres had problem with), and currently, I only have local-storage
, so Kubegres can work with it correctly:
ubuntu@localhost:~$ kubectl get sc
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
local-storage rancher.io/local-path Delete WaitForFirstConsumer false 3d22h
But I can assure you that, before deleting that SC, it was like this:
ubuntu@localhost:~$ kubectl get sc
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
local-storage kubernetes.io/no-provisioner Delete WaitForFirstConsumer false 3d22h
local-path(default) rancher.io/local-path Delete WaitForFirstConsumer false 3d22h
What I've done was, deleting all SCs, and deploying local-storage
SC again so Kubegres can work with it, but with my specific provisioned(which is rancher.io/local-path).
Thank you.
I checked the code and the only time Kubegres attempts to set the default storage class is when the property 'database.storageClassName' is not set. I use the method below to check whether a storage class name was set:
func (r *UndefinedSpecValuesChecker) isStorageClassNameUndefinedInSpec() bool {
storageClassName := r.kubegresContext.Kubegres.Spec.Database.StorageClassName
return storageClassName == nil || *storageClassName == ""
}
The method above is used as follows:
if r.isStorageClassNameUndefinedInSpec() {
wasSpecChanged = true
defaultStorageClassName, err := r.defaultStorageClass.GetDefaultStorageClassName()
if err != nil {
return err
}
kubegresSpec.Database.StorageClassName = &defaultStorageClassName
r.createLog("spec.Database.StorageClassName", defaultStorageClassName)
}
If you can reproduce it, I am happy to investigate further.
Closing this ticket if there is not any more update.
As you can see in my Kubegres.yaml config below, I've set the storageClass to be "local-path":
BUT when it deploys, and creates the related PVC, I see that the storageClass is set to "local-storage" instead of "local-path":
postgres-db-mypostgres-1-0 PVC:
SO -> it's always requesting for that SC, which doesn't exist, and because I'm on bare-metal and I don't have any cloud storage provisioned, the database can't deploy, and produces error:
My k8s cluster is on bare-metal.