Specifying persistent storage
Components of any type can specify the custom volumes to be mounted on specific locations within the image. Note that the volume names are shared across all components and therefore this mechanism can also be used to share file systems between components.
Procedure
-
Specify volumes for
containertype:Example 1. Specifying volumes forcontainertype:schemaVersion: 2.0.0 metadata: name: MyDevfile components: - name: MyDevfile container: image: golang memoryLimit: 512Mi mountSources: true command: ['sleep', 'infinity'] volumeMounts: - name: cache path: /.cache -
Specify volumes for
plugintype:Example 2. Specifying volumes forplugintype:scheamVersion: 2.0.0 metadata: name: MyDevfile components: - name: theia-editor plugin: id: eclipse/che-theia/next env: - name: HOME value: $(PROJECTS_ROOT) volumeMounts: - name: cache path: /.cache -
Specify volumes for
kubernetes/openshifttype:Example 3. Specifying volumes forkubernetes/openshifttype:schemaVersion: 2.0.0 metadata: name: MyDevfile components: - name: mongo openshift: reference: mongo-db.yaml volumeMounts: - name: mongo-persistent-storage path: /data/db