Skip to content

Modified docs to adhere to schema_2nd PR #44

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

Merged
merged 2 commits into from
Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
= Adding attributes to a devfile

[role="_abstract"]
Devfile attributes can be used to configure various features.
Devfile attributes can be used to configure various features and properties according to user and tooling needs. Attributes are implementation-dependant, free-form YAML and can be defined for the following devfile objects: `metadata`, `components`, `commands`, `projects`, and `starterProjects`.

.Prerequisites

Expand All @@ -13,9 +13,9 @@ Devfile attributes can be used to configure various features.
.Procedure


. Define the optional `editorFree` attribute
. Define a custom attribute
+
When an editor is not specified in a devfile, a default is provided. When no editor is needed, use the `editorFree` attribute. The default value of `false` means that the devfile requests the provisioning of the default editor.
When no editor is specified, a default editor is provided. To represent this user-defined example, use the `editorFree` attribute as shown in the following example:
+
.A devfile without an editor
====
Expand All @@ -24,33 +24,12 @@ When an editor is not specified in a devfile, a default is provided. When no edi
schemaVersion: 2.0.0
metadata:
name: petclinic-dev-environment
attributes:
editorFree: true
components:
- name: myApp
- name: myapp
kubernetes:
local: my-app.yaml
attributes:
editorFree: true
----
====

. Define the optional `persistVolumes` attribute (ephemeral mode)
+
By default, volumes and PVCs specified in a devfile are bound to a host folder to persist data even after a container restart. To disable data persistence to make the workspace faster, such as when the volume back end is slow, modify the `persistVolumes` attribute in the devfile. The default value is `true`. Set to `false` to use `emptyDir` for configured volumes and PVC.
+
.A devfile with ephemeral mode enabled
====
[source,yaml]
----
schemaVersion: 2.0.0
metadata:
name: petclinic-dev-environment
projects:
- name: petclinic
git:
remotes:
origin: "https://github.com/che-samples/web-java-spring-petclinic.git"
attributes:
persistVolumes: false
uri: my-app.yaml
----
====

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@ A component type that allows to define a container image-based configuration of
endpoints:
- name: maven-server
targetPort: 3101
configuration:
protocol: tcp
scheme: http
secure: 'true'
public: 'true'
discoverable: 'false'
protocol: https
secure: 'true'
exposure: public
memoryLimit: 1536M
command: ['tail']
args: ['-f', '/dev/null']
Expand All @@ -46,7 +43,7 @@ A component type that allows to define a container image-based configuration of
----
schemaVersion: 2.0.0
metadata:
name: MyDevfile
name: mydevfile
components:
- name: go
container:
Expand All @@ -67,7 +64,7 @@ For the `container` component to have access to the project sources, you must se
----
schemaVersion: 2.0.0
metadata:
name: MyDevfile
name: mydevfile
components:
- name: go
container:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ schemaVersion: 2.0.0
metadata:
name: my-project-dev
parent:
id: redhat/nodejs/11.6
id: redhat/nodejs
registry: https://devfile-registry.io/
----
====
Expand All @@ -39,14 +39,13 @@ schemaVersion: 2.0.0
metadata:
name: my-project-dev
parent:
id: redhat/nodejs/11.6
uri: https://raw.githubusercontent.com/eclipse/che-devfile-registry/master/devfiles/nodejs/devfile.yaml
----
====
+
.Parent identified by a Kubernetes resource
====
Using a Kubernetes resource name, namespace and selector if it has been deployed on a Kubernete cluster.
Using a Kubernetes resource name and namespace if it has been deployed on a Kubernete cluster.

[source,yaml]
----
Expand All @@ -57,7 +56,6 @@ parent:
kubernetes:
name: mydevworkspacetemplate
namespace: mynamespace
selector: mykey=myvalue
----
====

Expand Down