This procedure demonstrates how to generate a devfile from an existing Kubernetes application using the chectl tool.
-
A running instance of Eclipse Che. To install an instance of Eclipse Che, see Che 'quick-starts'.
-
chectlmanagement tool is installed. See Installing thechectlmanagement tool
-
Use the
chectl devfile:generatecommand to generate a devfile:$ chectl devfile:generate
-
The user can also use the
chectl devfile:generatecommand to generate a devfile from, for example, theNodeJS-MongoDBapplication.The following example generates a devfile that includes the
NodeJScomponent:$ chectl devfile:generate --selector="app=nodejs" apiVersion: 1.0.0 metadata: name: chectl-generated components: - type: kubernetes alias: app=nodejs referenceContent: | kind: List apiVersion: v1 metadata: name: app=nodejs items: - apiVersion: apps/v1 kind: Deployment metadata: labels: app: nodejs name: web (...)The NodeJS application YAML definition is included in the devfile, inline, using the
referenceContentattribute. -
To include support for a language, use the
--languageparameter:$ chectl devfile:generate --selector="app=nodejs" --language="typescript" apiVersion: 1.0.0 metadata: name: chectl-generated components: - type: kubernetes alias: app=nodejs referenceContent: | kind: List apiVersion: v1 (...) - type: chePlugin alias: typescript-ls id: che-incubator/typescript/latest
-
-
Use the generated devfile to start a Che workspace with
chectl.