Description
Is your feature request related to a problem? Please describe.
Currently, Volume components in a devfile only support a size field. It would be useful to be able to specify more information about what sort of volume is needed:
- Specify that a volume does not require persistent storage (e.g. can be provisioned as an emptyDir volume) -- such volumes are useful for sharing data between containers
- Specify that a volume should exist already (i.e. don't create a volume from this file) -- this would be useful for specifying e.g. a shared ROX assets volume that can be mounted to multiple workspaces
- Specify an external volume's type (e.g. link to a secret that exists on the cluster; link to a configmap on the cluster) -- this would allow mounting secrets/configmaps that already exist into new workspaces.
Describe the solution you'd like
Introduce additional fields on volume components:
persistent
- whether persistent volume is expected to be available after workspace is stopped (default:true
)external
- defines volume as external to the current workspace (i.e. its lifecycle is separate)external.type
- type of external volume, e.g. "secret", "configmap", or "storage"external.name
- name of existing resource on cluster
Something like
spec:
components:
- name: my-ephemeral-volume
volume:
persistent: false # Volume my-ephemeral-volume will be mounted as emptyDir
- name: my-external-volume
volume:
external: # Setting fields indicates that this is an external volume
type: storage
name: my-pvc
- name: my-existing-secret
volume:
external:
type: secret # or configmap
name: my-secret
Describe alternatives you've considered
Suggestions are more than welcome