Developing with devfiles
Use the devfile specification to develop a Node.js “Hello World” application. Developing this application introduces you to how a devfile automates and simplifies your development process.
To make developing with the devfile specification easier, consider doing the following:
-
Install minikube to create a Kubernetes cluster on your local machine.
-
Download kubectl to access your namespace.
-
Enable ingress on minikube to access your devfile project.
-
Install the odo command line interface (CLI) tool to execute the devfile specification.
-
View the available devfiles:
$ odo catalog list components
-
Run
odo create nodejs <name of your project> --starter
to create a devfile project.-
Add the
--starter
parameter to include the starter project currently inside the Node.js devfile specification, which makes it easier for you to develop an application.
-
-
Run
minikube IP
to find your cluster IP address. -
Run
odo url create <name you give the url> --ingress --host <IP address>.nip.io
. Doing so creates an ingress inside your cluster that you can use to access your application using the cluster IP address.-
Example:
odo url create myfirstproject --ingress --host 192.168.64.2.nip.io
.
-
-
Run
odo push
to build the URL.
-
To verify that you built your Node.js "Hello World" application successfully, view the application in a web browser by copying and pasting the URL that was produced by running the
odo push
command. Go to the URL and view your "Hello World" application.
To continue working with devfiles, go to Authoring devfiles.