Skip to content

Commit

Permalink
update kubernetes component to include deployByDefault information, u…
Browse files Browse the repository at this point in the history
…pdate container component on sprcifying a volumeMount, update parent id reference with version specified

Signed-off-by: Stephanie <yangcao@redhat.com>
  • Loading branch information
yangcao77 committed Mar 30, 2022
1 parent 11f90ad commit 1a8ee6a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
.DS_Store
.vale.ini
.yarnrc
.idea/
/build/
/out/
/node_modules/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ A devfile can contain one or more components of the `container` type. The `compo
.A minimal `container` component
[source,yaml]
----
schemaVersion: 2.2.0
schemaVersion: 2.1.0
metadata:
name: mydevfile
components:
Expand All @@ -67,7 +67,7 @@ For the `container` component to have access to the project sources, you must se
+
[source,yaml]
----
schemaVersion: 2.2.0
schemaVersion: 2.1.0
metadata:
name: mydevfile
components:
Expand All @@ -81,6 +81,26 @@ components:
+
The sources are mounted on a location stored in the `PROJECTS_ROOT` environment variable that is made available in the running container of the image. This location defaults to `/projects`. If `sourceMapping` is defined in the container, it overrides the `PROJECT_ROOT` value and mounts the source to the path defined by `sourceMapping`.

. Specify a volume
+
For the `container` component to have a shared volume. You must define a volume component in the devfile, and reference the volume using `volumeMount` in container component. For more information on volume component, see xref:adding-a-volume-component-to-a-devfile.adoc[]
+
[source,yaml]
----
components:
- name: mycontainer
container:
image: java11-maven:next
memoryLimit: 768Mi
mountSources: true
volumeMounts:
- name: m2
path: /home/user/.m2
- name: m2
volume:
size: 1Gi
----

. Container Entrypoint
+
Use the `command` attribute of the `container` type to modify the `entrypoint` command of the container created from the image. The availability of the `sleep` command and the support for the `infinity` argument depend on the base image used in the particular images.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,7 @@ You can add either a `kubernetes` or `openshift` component to a devfile.
+
. Specify the endpoint through the endpoint property with `kubernetes` or `openshift` components.

. Associate `kubernetes` or `openshift` components with `Apply` commands. If you do not associate `Apply` commands, they are assumed to be applied at start up.
. By default `kubernetes` or `openshift` components are not going to be deployed. Specify `deployByDefault=true` if you want to apply the component at start up.

. Associate `kubernetes` or `openshift` components with `Apply` commands wth `deploy` command group kind. If the `kubernetes` or `openshift` component uses an image built by an image component defined in the devfile, you can create a composite command to build the image and deploy the Kubernetes or openshift component. For more information on `Apply` commands, see xref:adding-apply-commands-to-a-devfile.adoc[]
+
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can refer to a parent devfile in three different ways:
+
.Parent referred by registry
====
Using the `id` when published in a registry.
Using the `id` when published in a registry. Provide the `registryUrl` as well as `version`. `version` can be either the stack version string, or `latest`. If no `version` is provided, the default version for the stack will be used.
[source,yaml]
----
Expand All @@ -31,6 +31,7 @@ metadata:
parent:
id: redhat/nodejs
registryUrl: https://devfile-registry.io/
version: 1.2.0
----
====
+
Expand Down

0 comments on commit 1a8ee6a

Please sign in to comment.