-
Notifications
You must be signed in to change notification settings - Fork 67
Configurable default PVC size for common and per-workspace storage classes #827
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
Configurable default PVC size for common and per-workspace storage classes #827
Conversation
|
Hi @AObuchow. Thanks for your PR. I'm waiting for a devfile member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
00bb54c to
30d5d73
Compare
|
You'll need to rebase onto |
30d5d73 to
7266ce6
Compare
| x-kubernetes-int-or-string: true | ||
| description: 'StorageClassSize defines an optional map of sizes | ||
| of persistent volume claims for each storage class used by DevWorkspaces. | ||
| The available keys to the map are: "common", "per-workspace". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why these files don't have the mention of async using the common storage class PVC size that I added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI is also complaining about this :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to run make generate to regenerate CRDs after changing the go definition. I use
make generate manifests fmt generate_default_deployment generate_olm_bundle_yaml
to make sure all autogenerated files are in sync.
amisevsk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some discussion with Andrew, we've decided that it makes more sense to define the default storage size configuration fields as a struct rather than map[string]string. This will allow for better documentation and easier validation (since we can rely on the k8s API).
|
I'm 👍 on setting the default per-workspace storage size to |
|
Not sure yet why the go: downloading golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba
Error: ../../../go/pkg/mod/golang.org/x/tools@v0.1.10/cmd/goimports/goimports.go:14:2: //go:build comment without // +build comment
Error: Process completed with exit code 1. |
|
#831 should fix PR check |
pkg/config/sync.go
Outdated
| config = append(config, fmt.Sprintf("workspace.defaultStorageSize.%s=%s", constants.CommonStorageClassType, Workspace.DefaultStorageSize.Common.String())) | ||
| } | ||
| if Workspace.DefaultStorageSize.PerWorkspace != nil { | ||
| config = append(config, fmt.Sprintf("workspace.defaultStorageSize.%s=%s", constants.PerWorkspaceStorageClassType, Workspace.DefaultStorageSize.PerWorkspace.String())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should hard-code the config names, this will result in logging e.g.
workspace.defaultStorageSize.per-workspace=5Gi
even though the actual config field is
workspace.defaultStorageSize.perWorkspace
| config = append(config, fmt.Sprintf("workspace.defaultStorageSize.%s=%s", constants.CommonStorageClassType, Workspace.DefaultStorageSize.Common.String())) | |
| } | |
| if Workspace.DefaultStorageSize.PerWorkspace != nil { | |
| config = append(config, fmt.Sprintf("workspace.defaultStorageSize.%s=%s", constants.PerWorkspaceStorageClassType, Workspace.DefaultStorageSize.PerWorkspace.String())) | |
| config = append(config, fmt.Sprintf("workspace.defaultStorageSize.common=%s", Workspace.DefaultStorageSize.Common.String())) | |
| } | |
| if Workspace.DefaultStorageSize.PerWorkspace != nil { | |
| config = append(config, fmt.Sprintf("workspace.defaultStorageSize.perWorkspace=%s", Workspace.DefaultStorageSize.PerWorkspace.String())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, I went with per-workspace instead of perWorkspace. Let me know if you rather it be perWorkspace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should match the actual field in the config though -- the dot delimited format is meaningful here. If you try to set workspace.defaultStorageSize.per-workspace in the DevWorkspaceOperatorConfig, it will be invalid.
276e56f to
9a6e005
Compare
ibuziuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AObuchow could you please resolve the conficts?
Sorry about that - will be done in a moment. |
57f4be1 to
c2aa8d0
Compare
ibuziuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
pkg/config/sync.go
Outdated
| config = append(config, fmt.Sprintf("workspace.defaultStorageSize.common=%s", Workspace.DefaultStorageSize.Common.String())) | ||
| } | ||
| if Workspace.DefaultStorageSize.PerWorkspace != nil { | ||
| config = append(config, fmt.Sprintf("workspace.defaultStorageSize.per-workspace=%s", Workspace.DefaultStorageSize.PerWorkspace.String())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| config = append(config, fmt.Sprintf("workspace.defaultStorageSize.per-workspace=%s", Workspace.DefaultStorageSize.PerWorkspace.String())) | |
| config = append(config, fmt.Sprintf("workspace.defaultStorageSize.perWorkspace=%s", Workspace.DefaultStorageSize.PerWorkspace.String())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :) Will autosquash when ready for merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be good for merge assuming nothing else needs to be changed 😎
ae1cfd2 to
3932e90
Compare
Both common and per-workspace storage class PVC sizes can be configured through CRD's Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
Part of devfile#740 Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
Fix devfile#836 Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
3932e90 to
ac607df
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amisevsk, AObuchow, ibuziuk The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |


What does this PR do?
DevWorkspaceOperatorConfigCRDIn order to configure the default PVC size for a storage class, a
DevWorkspaceOperatorConfigCRD must be applied to the cluster with theDefaultStorageSizeworkspaceproperty set. This property takes a struct where theresource.Quantityfields define the PVC sizes forcommon/asyncandper-workspacestorage classes.What issues does this PR fix or reference?
Fix #792.
Is it tested? How?
controller.devfile.io/storage-typeattribute set toper-workspaceand verifying the newly created PVC size is set to the default size for per-workspace storage.commonstorage still needs to be done, however the "new" default is currently the same as it used to be (10Gi)commonStoragetest has been modified to support this new change. Both thecommonandper-workspacestorage class tests are passing with this new change.synctests have been modified to support this new change.Additional WIP notes
PR Checklist
/test v8-devworkspace-operator-e2e, v8-che-happy-pathto trigger)v8-devworkspace-operator-e2e: DevWorkspace e2e testv8-che-happy-path: Happy path for verification integration with Che