diff --git a/backend/src/types.ts b/backend/src/types.ts index 71b2d4e512..f904b3a0aa 100644 --- a/backend/src/types.ts +++ b/backend/src/types.ts @@ -34,6 +34,7 @@ export type DashboardConfig = K8sResourceCommon & { enabled: boolean; key: string; }; + storageClassName?: string; }; }; }; diff --git a/backend/src/utils/notebookUtils.ts b/backend/src/utils/notebookUtils.ts index c2abc710cf..32512311bd 100644 --- a/backend/src/utils/notebookUtils.ts +++ b/backend/src/utils/notebookUtils.ts @@ -593,7 +593,8 @@ const createPvc = async ( pvcName: string, ): Promise => { const pvcSize = getDashboardConfig().spec?.notebookController?.pvcSize ?? DEFAULT_PVC_SIZE; - const pvc = assemblePvc(pvcName, namespace, pvcSize); + const storageClassName = getDashboardConfig().spec.notebookController?.storageClassName; + const pvc = assemblePvc(pvcName, namespace, pvcSize, storageClassName); try { const pvcResponse = await fastify.kube.coreV1Api.createNamespacedPersistentVolumeClaim( @@ -610,6 +611,7 @@ const assemblePvc = ( pvcName: string, namespace: string, pvcSize: string, + storageClassName?: string, ): V1PersistentVolumeClaim => ({ apiVersion: 'v1', kind: 'PersistentVolumeClaim', @@ -628,6 +630,7 @@ const assemblePvc = ( }, }, volumeMode: 'Filesystem', + storageClassName, }, status: { phase: 'Pending', diff --git a/docs/dashboard_config.md b/docs/dashboard_config.md index 998aede184..5cd3a19c81 100644 --- a/docs/dashboard_config.md +++ b/docs/dashboard_config.md @@ -29,7 +29,7 @@ In its default state the Dashboard config is in this form: spec: dashboardConfig: enablement: true - disableInfo: fals + disableInfo: false disableSupport: false disableClusterManager: false disableTracking: true @@ -88,6 +88,7 @@ notebookController: notebookTolerationSettings: enabled: true key: NotebooksOnly + storageClassName: gp2 ``` ### Notebook Controller State diff --git a/manifests/crd/odhdashboardconfigs.opendatahub.io.crd.yaml b/manifests/crd/odhdashboardconfigs.opendatahub.io.crd.yaml index 20c352ad5c..88f96b121b 100644 --- a/manifests/crd/odhdashboardconfigs.opendatahub.io.crd.yaml +++ b/manifests/crd/odhdashboardconfigs.opendatahub.io.crd.yaml @@ -132,3 +132,5 @@ spec: type: boolean key: type: string + storageClassName: + type: string