Placeholder for https://github.com/openshiftio/openshift.io/issues/1614
This is probably something that should be fixed init-tenant side but may need to involve che-starter as well.
Migration pod can be triggered by init-tenant and reused to do the cleanup.
Now that che-maintenance service is deployed in dedicated we could use it to do the cleanup.
Now that che-maintenance service is deployed in dedicated we could use it to do the cleanup.
A new cleanWorkspaces endpoint has been implemented in the che-tenant-maintainer dsaas service, and will be available (when PR https://github.com/fabric8-services/che-tenant-maintainer/pull/14 is merged) from other dsaas services at the following URL:
http://che-tenant-maintainer:8080/cleanWorkspaces
I assume it should be called, on reset environement from the tenant sevrice.
The required request headers are:
X-Request-Id: the request Id of the reset environment actionX-Identity-Id: the identity Id of the user that triggered the reset environment actionX-User-Namespace: the User OSIO Che namespaceAuthorization: the Bearer <osioToken> value, as usualThe request can be either:
delete-all-workspaces=truedry-run=true query parameter that allow simulating the cleaning process only, without removing anything for real.a POST request with the same parameters as the GET request query parameters, bundled in a JSON object body like this:
{
"delete-all-workspaces":"true"
}
or for a dry run (simulating only):
{
"delete-all-workspaces":"true",
"dry-run":"true"
}
Note that, in *dry run mode, the currently-running workspaces will still be stopped, even if nothing is finally deleted.*
Remark:
This endpoint can also be used, with delete-all-workspaces=false in regular maintenance tasks to remove, in the user workspace-dedicated persistent volume, all "orphan" workspace directories that don't correspond to existing Che workspaces in the user account of the OSIO Che server (old Che 5 workspaces, etc ...).
cc @aslakknutsen
Most helpful comment
A new
cleanWorkspacesendpoint has been implemented in theche-tenant-maintainerdsaas service, and will be available (when PR https://github.com/fabric8-services/che-tenant-maintainer/pull/14 is merged) from other dsaas services at the following URL:I assume it should be called, on
reset environementfrom the tenant sevrice.The required request headers are:
X-Request-Id: the request Id of thereset environmentactionX-Identity-Id: the identity Id of the user that triggered thereset environmentactionX-User-Namespace: the User OSIO Che namespaceAuthorization: theBearer <osioToken>value, as usualThe request can be either:
delete-all-workspaces=truedry-run=truequery parameter that allow simulating the cleaning process only, without removing anything for real.a POST request with the same parameters as the GET request query parameters, bundled in a JSON object body like this:
or for a dry run (simulating only):
Note that, in *dry run mode, the currently-running workspaces will still be stopped, even if nothing is finally deleted.*
Remark:
This endpoint can also be used, with
delete-all-workspaces=falsein regular maintenance tasks to remove, in the user workspace-dedicated persistent volume, all "orphan" workspace directories that don't correspond to existing Che workspaces in the user account of the OSIO Che server (old Che 5 workspaces, etc ...).