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 additional PVC for workspace #17653

Closed
svkr2k opened this issue Aug 18, 2020 · 13 comments
Closed

Add additional PVC for workspace #17653

svkr2k opened this issue Aug 18, 2020 · 13 comments
Labels
engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. kind/question Questions that haven't been identified as being feature requests or bugs. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. severity/P2 Has a minor but important impact to the usage or development of the system.

Comments

@svkr2k
Copy link

svkr2k commented Aug 18, 2020

Dear forum members,

I'm running che in Minikube. I have a Persistent Volume (PV) created within the minikube single node.

and would like to access this PV from within my workspace. As this is not currently supported, I would like to try implementing it with your guidance.

Kindly provide me guidance on where I need to look to make changes to the code.
So far, I have seen the code in infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes.
I have read UniqueWorkspacePVCStrategy, PVCProvisioner.java, etc.

@skabashnyuk , forum members recommended that I get in touch with you regarding this. Thank you !

@svkr2k svkr2k added the kind/question Questions that haven't been identified as being feature requests or bugs. label Aug 18, 2020
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Aug 18, 2020
@metlos
Copy link
Contributor

metlos commented Aug 19, 2020

I would also look into PodMerger and into KubernetesInternalRuntime.

@metlos metlos added area/che-server severity/P2 Has a minor but important impact to the usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Aug 19, 2020
@metlos
Copy link
Contributor

metlos commented Aug 19, 2020

And thank you for the willingness to help us out with this. Much appreciated! Please don't hesitate to bombard us with further questions 😄

@svkr2k
Copy link
Author

svkr2k commented Aug 19, 2020

Thank you @metlos for encouraging ...
I would like to create a prototype first as a proof of concept... looking for a quick and dirty way to "hard-code" the pvc creation ...

@skabashnyuk
Copy link
Contributor

skabashnyuk commented Aug 19, 2020

@svkr2k how this feature will work? What if we use the same approach as we use with secrets? If PV exists in the namespace with some labels we can mount it to the workspace? See https://www.eclipse.org/che/docs/che-7/mounting-a-secret-as-a-file-or-an-environment-variable-into-a-workspace-container/
CC @l0rd

@svkr2k
Copy link
Author

svkr2k commented Aug 19, 2020

Thank you for letting me know your thoughts, @skabashnyuk

The approach for prototype (che on minikube) that I'm going to try is as follows:

  1. I shall create a PV for a host path such as /home/huge-set-of-files that exists in my local PC
  2. When a workspace is created, create a PVC (in the namespace of workspace) that claims the PV created in step 1
  3. Mount the PVC to a path /home/huge-set-of-files in the IDE container of the workspace

Hope this sounds okay ?
Finally, if this works, I would like to change the hostPath-based PV into a NFS-based PV.

@whafra
Copy link

whafra commented Aug 24, 2020

@svkr2k ,hi, how is the result?
i have the same demand and i deployed eclipse-che in k8s (private cloud enviroment and operator installer ).
i tested the hostPath PV and NFS PV , i can get it using kubectl command , however the pv or pvc can not be mounted into the workspace.
It seemed that the Volume attribute in devfile is not valid.
@skabashnyuk ,could you give me some advice ?
thanks a lot.

@skabashnyuk
Copy link
Contributor

skabashnyuk commented Aug 25, 2020

What about

A volume that is going to be mounted to the all containers of the workspace pod.

apiVersion: v1
kind: PersistentVolume
metadata:
  name: task-pv-volume
  labels:
    type: local
    app.kubernetes.io/part-of: che.eclipse.org
    app.kubernetes.io/component: workspace-shared-volume
  annotations:
    che.eclipse.org/automount-workspace-shared-volume: 'true'
    che.eclipse.org/mount-path:/home/huge-set-of-files 
spec:
  storageClassName: manual
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/mnt/data"

A volume that is going to be mounted to the specific container of the workspace pod.

apiVersion: v1
kind: PersistentVolume
metadata:
  name: task-m2-voluem
  labels:
    type: local
    app.kubernetes.io/part-of: che.eclipse.org
    app.kubernetes.io/component: workspace-shared-volume
  annotations:
    che.eclipse.org/target-container: maven
    che.eclipse.org/mount-path:/home/user/.m2/repository
spec:
  storageClassName: manual
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/mnt/data"

CC @mshaposhnik @l0rd @metlos @sparkoo Wdyt?

@whafra
Copy link

whafra commented Aug 26, 2020

@skabashnyuk
thanks for your reply.
I tried the configuration you recommended above . Unfortunately ,It did not work.
Whether i put the volumes part into the devfile or not ,the external volume could not be mounted into the container .
The following is devfile.yaml

metadata:
generateName: wksp-test-
components:

  • mountSources: true
    command:
    • sleep
    • infinity
      memoryLimit: 600Mi
      type: dockerimage
      volumes:
    • name: task-pv-volume
      containerPath: /external_tool
      image:
      alias: test
      apiVersion: 1.0.0

BTW ,
che.eclipse.org/mount-path:/home/huge-set-of-files ----is this path the container path?
What is the correlation between the che.eclipse.org/mount-path and containerPath in devfiles ?(componet->volumes)

@skabashnyuk
Copy link
Contributor

skabashnyuk commented Aug 26, 2020

I tried the configuration you recommended above . Unfortunately ,It did not work.

Did you implement that in the che-server code? #17653 (comment) this is a proposal for configuration. It's not implemented yet.

che.eclipse.org/mount-path:/home/huge-set-of-files ----is this path the container path?

yes. Similar to the secrets mount path see https://www.eclipse.org/che/docs/che-7/mounting-a-secret-as-a-file-or-an-environment-variable-into-a-workspace-container/

What is the correlation between the che.eclipse.org/mount-path and containerPath in devfiles ?(componet->volumes)

I don't know. Probably none.

@whafra
Copy link

whafra commented Aug 28, 2020

@skabashnyuk
oh , i got it. Yes, i did not modify the che-server code ,i just used the original image (7.17.0).
The feature is expected strongly .

And , another confusing problem , that is , what is the recommended size limit of the workspace container .
Since at present i can not add the external pvc into workspace ,i want to try to load the files into workspace .
Is the capacity relevant to the che server cofig (server-storage-pvcClaimSize)?
thank you for your help .

@svkr2k
Copy link
Author

svkr2k commented Aug 28, 2020

@skabashnyuk , @whafra

Did you implement that in the che-server code? #17653 (comment) this is a proposal for configuration. It's not implemented yet.

I havent got a chance to implement it yet. Had a look at the code for a couple of days and as I'm not familiar with che server code, I believe that I will need more help in understanding where to start ... :-)

@yxlwfds
Copy link

yxlwfds commented Mar 10, 2021

@svkr2k @metlos do you have some solution for mount NFS to eclipse/che

@skabashnyuk skabashnyuk added engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. and removed area/che-server labels Aug 17, 2021
@che-bot
Copy link
Contributor

che-bot commented Feb 13, 2022

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 13, 2022
@che-bot che-bot closed this as completed Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. kind/question Questions that haven't been identified as being feature requests or bugs. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. severity/P2 Has a minor but important impact to the usage or development of the system.
Projects
None yet
Development

No branches or pull requests

6 participants