Skip to content
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

Add storageClassName field to dashboard config for notebook controller #1055

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export type DashboardConfig = K8sResourceCommon & {
enabled: boolean;
key: string;
};
storageClassName?: string;
};
};
};
Expand Down
5 changes: 4 additions & 1 deletion backend/src/utils/notebookUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,8 @@ const createPvc = async (
pvcName: string,
): Promise<V1PersistentVolumeClaim> => {
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(
Expand All @@ -610,6 +611,7 @@ const assemblePvc = (
pvcName: string,
namespace: string,
pvcSize: string,
storageClassName?: string,
): V1PersistentVolumeClaim => ({
apiVersion: 'v1',
kind: 'PersistentVolumeClaim',
Expand All @@ -628,6 +630,7 @@ const assemblePvc = (
},
},
volumeMode: 'Filesystem',
storageClassName,
},
status: {
phase: 'Pending',
Expand Down
3 changes: 2 additions & 1 deletion docs/dashboard_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -88,6 +88,7 @@ notebookController:
notebookTolerationSettings:
enabled: true
key: NotebooksOnly
storageClassName: gp2
```

### Notebook Controller State
Expand Down
2 changes: 2 additions & 0 deletions manifests/crd/odhdashboardconfigs.opendatahub.io.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,5 @@ spec:
type: boolean
key:
type: string
storageClassName:
type: string