Adding components to a devfile
Each component in a single devfile must have a unique name and use one of the objects: container
, kubernetes
, openshift
, or volume
. See the following tables for component properties in a devfile:
Key | Type | Required | Description |
---|---|---|---|
container |
componentObject |
no |
The list of containers that you use. |
Key | Type | Required | Description |
---|---|---|---|
name |
string |
yes |
The name of your container. |
image |
string |
yes |
The image version. |
memoryLimit |
string |
no |
The memory limit that you use with your container. |
mountSources |
boolean |
no |
Choose to mount the source or not. |
sourceMapping |
string |
no |
The path in the container where you transfer and mount the project sources. This path is available in the container through the environment, |
endpoints |
endpointObject |
no |
The list of endpoints to use. |
volumeMounts |
volumeMountsObject |
no |
The list of volumes to mount. |
environment |
envObject |
no |
The list of environment variables to use. |
Key | Type | Required | Description |
---|---|---|---|
name |
string |
yes |
The name of your endpoint. |
targetPort |
integer |
yes |
The port number that you target. |
exposure |
string |
no |
Use the following attributes to describe how to expose the endpoints on the network: |
path |
string |
no |
The path to the endpoint URL. |
protocol |
string |
no |
Use the following attributes to describe the application and transport protocols of the traffic that goes through the endpoint: |
secure |
boolean |
no |
Choose to define the endpoint as secure or not. |
Key | Type | Required | Description |
---|---|---|---|
name |
string |
yes |
The name of the volume components that you use. |
path |
string |
no |
The path in the component container where you mount the volume. |
name |
string |
yes |
The name of the volume component. |
size |
string |
no |
The size of the storage you create. |
-
Add a
components
section in the devfile, containing a list of one or more components. -
For each component, define an unique value for the mandatory
name
attribute. -
For each component, define a mandatory type of one of the following types:
kubernetes
,container
orvolume
.