-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure PVC is working in dev environment #10017
Comments
Depends on this being merged first: #9475 |
I'd like to handle this one @sagor999 |
@jenting assigned you. Thank you! ❤️ |
The current code, creating the PVC uses the "default" storageClass (which is empty) in ws-manager config. According to https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reserving-a-persistentvolume, if we create the PVC with PVCConfig := m.Config.WorkspaceClasses[config.DefaultWorkspaceClass].PVC
if startContext.Class != nil {
PVCConfig = startContext.Class.PVC
}
storageClassName := PVCConfig.StorageClass
PVC := &corev1.PersistentVolumeClaim{
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("%s-%s", prefix, req.Id),
Namespace: m.Config.Namespace,
},
Spec: corev1.PersistentVolumeClaimSpec{
AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce},
StorageClassName: &storageClassName,
Resources: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceName(corev1.ResourceStorage): PVCConfig.Size,
},
},
},
} Therefore, we could either update the ws-manager config, "default" storageClass to Probably go with update the ws-manager config way better for different environments (SaaS, Self-hosted). |
Oh. Good find! I think we should update the code then to not set storageClassName in that case. 🤔 |
I think we could use this issue to track. |
If we create the PVC with
spec.storageClassName=""
, the Kubernetes will search the storage class name "" rather than using the default storage class (which is local-path) in the cluster, ref to https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reserving-a-persistentvolume.We should update the code then to not set storageClassName in that case. As that would be what users in self hosted would probably do as well, do not set (keep empty) storage class to use default one.
The text was updated successfully, but these errors were encountered: