Uh oh!
There was an error while loading. Please reload this page.
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
30d5d73CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
amisevsk
commented
Apr 26, 2022
You'll need to rebase onto |
30d5d73 to
7266ce6Compare| 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.
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.
The CI is also complaining about this :P
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
AObuchow
commented
Apr 28, 2022
AObuchow
commented
Apr 28, 2022
amisevsk
left a comment
There was a problem hiding this comment.
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).
amisevsk
commented
Apr 28, 2022
I'm 👍 on setting the default per-workspace storage size to |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
AObuchow
commented
May 2, 2022
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. |
amisevsk
commented
May 3, 2022
#831 should fix PR check |
| 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.
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())) | |
| } | |
| ifWorkspace.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())) | |
| } | |
| ifWorkspace.DefaultStorageSize.PerWorkspace!=nil { | |
| config=append(config, fmt.Sprintf("workspace.defaultStorageSize.perWorkspace=%s", Workspace.DefaultStorageSize.PerWorkspace.String())) |
There was a problem hiding this comment.
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.
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
9a6e005CompareAObuchow
commented
May 18, 2022
Sorry about that - will be done in a moment. |
57f4be1 to
c2aa8d0Compare| 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.
| 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.
Done :) Will autosquash when ready for merge
There was a problem hiding this comment.
Should be good for merge assuming nothing else needs to be changed 😎
ae1cfd2 to
3932e90CompareBoth 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>
Fixdevfile#836 Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
3932e90 to
ac607dfCompare[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 |
amisevsk
commented
May 25, 2022
/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