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 !
I would also look into PodMerger and into KubernetesInternalRuntime.
And thank you for the willingness to help us out with this. Much appreciated! Please don't hesitate to bombard us with further questions :smile:
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 ...
@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
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:
/home/huge-set-of-files that exists in my local PC/home/huge-set-of-files in the IDE container of the workspaceHope this sounds okay ?
Finally, if this works, I would like to change the hostPath-based PV into a NFS-based PV.
@svkr2k 锛宧i, 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.
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?
@skabashnyuk
thanks for your reply.
I tried the configuration you recommended above . Unfortunately 锛孖t 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:
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)
I tried the configuration you recommended above . Unfortunately 锛孖t did not work.
Did you implement that in the che-server code? https://github.com/eclipse/che/issues/17653#issuecomment-679921862 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.
@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 .
@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 ... :-)
Possible duplicate for #15652
Most helpful comment
And thank you for the willingness to help us out with this. Much appreciated! Please don't hesitate to bombard us with further questions :smile: