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

[per-workspace PVC strategy] - When deleting workspace, PVC is not deleted, nor cleaned up. #12521

Closed
rhopp opened this issue Jan 25, 2019 · 9 comments
Assignees
Labels
kind/bug Outline of a bug - must adhere to the bug report template.

Comments

@rhopp
Copy link
Contributor

rhopp commented Jan 25, 2019

Description

When CRW is deployed with "per-workspace" PVC strategy and workspace is deleted, I guess the corresponding PVC should be deleted also, but this isn't happening.

Downstream issue: https://issues.jboss.org/browse/CRW-83

Reproduction Steps

  1. Have CRW with "per-workspace" PVC strategy.
  2. Create workspace
  3. Delete workspace
    EXPECTED: PVC of this workspace is deleted.
    ACTUAL: It is not.

OS and version:

Diagnostics:
Nothing in the logs.

@rhopp rhopp added kind/bug Outline of a bug - must adhere to the bug report template. team/platform labels Jan 25, 2019
@sleshchenko sleshchenko self-assigned this Jan 28, 2019
@sleshchenko sleshchenko added the status/in-progress This issue has been taken by an engineer and is under active development. label Jan 28, 2019
@sleshchenko
Copy link
Member

I think it should be already fixed after next 6.18.0 release. The corresponding commit dda3bf2

@rhopp Do you think manually checking of Che Server built from the master branch is enough or it is needed to check it on CRW assembly?

@rhopp
Copy link
Contributor Author

rhopp commented Jan 28, 2019

@sleshchenko Great to hear the fix is already in place. In case of CRW respin, we will probably have to cherry-pick that commit to 6.17.x branch.

@sleshchenko
Copy link
Member

Checked locally on Multi-User Che deployed on minishift. PVC created for workspace is removed. Files on minishift host are not removed

[root@minishift openshift.local.pv]# tree pv0090
pv0090
`-- workspacej64bcwxvlx1xnqkj
    |-- che-logs
    |   |-- che-plugin-broker
    |   |   |-- eclipse-che-init-plugin-broker-v0-7-1
    |   |   `-- eclipse-che-plugin-broker-v0-7-0
    |   `-- ws
    |       |-- che-machine-exec
    |       |-- dev
    |       |-- dev2
    |       `-- theia-ide
    |-- plugins
    |-- projects
    `-- userdata
        `-- user
            `-- data
                `-- hello.txt

15 directories, 1 file

But Che Server should remove PVC but not files in such configuration (per-workspace PVC). And minishift failed to recycle PVC
screenshot_20190128_150200

@rhopp
Copy link
Contributor Author

rhopp commented Jan 28, 2019

@sleshchenko You tried that with 6.18.0, right? We need to check that cherrypicked to 6.17.x branch.

We pretty much don't care if minishift is capable of recycling PVCs ;-)

@sleshchenko
Copy link
Member

You tried that with 6.18.0, right?

@rhopp Yeah, 6.18.0-SNAPSHOT where the mentioned commit is present
So, please close this issue after check. Note that fix will work only for new workspaces but not existing ones. Do you think it is an issue and the corresponding fix for existing workspaces should be prepared?

@sleshchenko sleshchenko removed the status/in-progress This issue has been taken by an engineer and is under active development. label Jan 28, 2019
@sleshchenko
Copy link
Member

@rhopp It won't help for existing workspaces because Che Server doesn't update existing PVCs where workspace id label is missing.
One more issue that may be caused by it (fact that Che Server doesn't update existing PVCs): changes of che.infra.kubernetes.pvc.quantity or che.infra.kubernetes.pvc.access_mode will affect only new workspaces. But I'm not sure if K8s/OpenShift allows updating these fields in bound PVCs at all. Need to check.

@rhopp rhopp mentioned this issue Jan 28, 2019
@riuvshin
Copy link
Contributor

@rhopp I will start bugfix release once this issue will be closed.

@rhopp
Copy link
Contributor Author

rhopp commented Jan 29, 2019

Closing after discussion with @sleshchenko. The fix (for new workspaces) is already in master. We don't need this one fixed for an "upgrade" path (for existing workspaces)

@rhopp rhopp closed this as completed Jan 29, 2019
@sleshchenko
Copy link
Member

Well, it is not possible to update AccessMode of existing PVCs.
But it is possible to update metadata (like fill in missing workspace id label) and requested resources configured with https://github.com/eclipse/che/blob/076b06ab174eaeffb08c11f711bf0c6c42255d5d/assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/che/che.properties#L429

So, not sure if we need create an issue for that but PVC strategies may be improved to:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template.
Projects
None yet
Development

No branches or pull requests

3 participants