Description
It's needed to implement Volume component that will define PVC or emptyDir with size configuration.
components:
- name: maven
container:
image: registry.redhat.io/codeready-workspaces/stacks-java-rhel8:2.1
mountSources: true
volumeMounts:
- name: my-storage
path: /home/jboss/.settings
- name: my-storage
volume:
size: 500Mi
If component references non-declared volume - devworkspace should fail to start or failed to be created?
Probably failed to start since such validation needs external resources to be fetched like in plugins case. See below.
? mountSource: true
should be converted to volume with name projects?
Volume can be reused/configured from plugin. Like here https://github.com/devfile/api/blob/master/samples/devfiles/spring-boot-http-booster-devfile.yaml.
...
components:
- name: java-support
plugin:
id: redhat/java8/latest
components:
- name: vscode-java
container:
memoryLimit: 2Gi
- name: m2 # it already has volume define we just configure it
volume:
size: 2G
...
- name: maven-tooling
container:
image: registry.redhat.io/codeready-workspaces/stacks-java-rhel8:2.1
mountSources: true
memoryLimit: 768Mi
volumeMounts:
- name: m2 # using volume from plugin definition
path: /home/jboss/.m2
Which PVC strategy we should support in devworkspace? Probably common only - one PVC for one namespace. Should we implement the same isolation mechanism as for Che?
- PVC structure:
/workspaceId1
/volumeName1
/volumeName2
/workspaceId2
/volumeName1
/volumeName2
? Since plugins need volumes in initContainers, we can face issues with initSubpaths from initContainer
and probably we need to run a separate job to do it