From c9fd0d865be9bcfe752958cd05098c79c7f84a56 Mon Sep 17 00:00:00 2001 From: Aditi Sharma Date: Fri, 3 Jul 2020 16:24:50 +0530 Subject: [PATCH 1/8] Create deploying-quarkus-app.adoc Add starting doc for quarkus app --- docs/public/deploying-quarkus-app.adoc | 112 +++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 docs/public/deploying-quarkus-app.adoc diff --git a/docs/public/deploying-quarkus-app.adoc b/docs/public/deploying-quarkus-app.adoc new file mode 100644 index 00000000000..579209ae8cf --- /dev/null +++ b/docs/public/deploying-quarkus-app.adoc @@ -0,0 +1,112 @@ +== Deploying a Quarkus Application + + +== Deploying a quarkus component to an Kubernetes/Openshift/Docker cluster + +In this example we will be deploying an https://github.com/odo-devfiles/springboot-ex[example Spring Boot® component] that uses https://maven.apache.org/install.html[Maven] and Java 8 JDK. + +. Download the example quarkus component. ++ +[source,sh] +---- + $ git clone https://github.com/odo-devfiles/quarkus-ex +---- +Alternatively, you can pass in `--downloadSource` to `odo create` to have odo download a sample project. + +. Change the current directory to the component directory: ++ +[source,sh] +---- + $ cd +---- + +. Create a component configuration using the `java-spring-boot` component-type named `myspring`: ++ +[source,sh] +---- + $ odo create quarkus myquarkus + Experimental mode is enabled, use at your own risk + + Validation + ✓ Checking devfile compatibility [195728ns] + ✓ Creating a devfile component from registry: DefaultDevfileRegistry [170275ns] + ✓ Validating devfile component [281940ns] + + Please use odo push command to create the component with source deployed +---- + +. List the contents of the directory to see the devfile and sample Java application source code: ++ +[source,sh] +---- + $ ls + mvnw mvnw.cmd pom.xml README.md src +---- + +. Create a URL in order to access the deployed component: ++ +[source,sh] +---- + $ odo url create --host apps-crc.testing + ✓ URL myquarkus-8080 created for component: myquarkus + + To apply the URL configuration changes, please use odo push +---- ++ +NOTE: You must use your cluster host domain name when creating your URL. + +. Push the component to the cluster: ++ +[source,sh] +---- + $ odo push + +Validation + ✓ Validating the devfile [44008ns] + +Creating Kubernetes resources for component myquarkus + ✓ Waiting for component to start [10s] + +Applying URL changes + ✓ URLs are synced with the cluster, no changes are required. + +Syncing to component quarkus-july + ✓ Checking files for pushing [951138ns] + ✓ Syncing files to the component [204ms] + +Executing devfile commands for component myquarkus + ✓ Executing init-compile command "mvn compile" [3m] + ✓ Executing dev-run command "mvn quarkus:dev" [1s] + +Pushing devfile component myquarkus + ✓ Changes successfully pushed to component + +---- + +. List the URLs of the component: ++ +[source,sh] +---- + $ odo url list + Found the following URLs for component myspring + NAME URL PORT SECURE + myquarkus-8080 http://myquarkus-8080.apps-crc.testing 8080 false +---- + +. View your deployed application using the generated URL: ++ +[source,sh] +---- + $ curl http://myspring-8080.apps-crc.testing +---- + +. To delete your deployed application: ++ +[source,sh] +---- + $ odo delete + ? Are you sure you want to delete the devfile component: myspring? Yes + ✓ Deleting devfile component myspring [152ms] + ✓ Successfully deleted component +---- + From a3f6e97b2d01f5c5b77d17b293444a7212f20702 Mon Sep 17 00:00:00 2001 From: Aditi Sharma Date: Fri, 3 Jul 2020 16:58:41 +0530 Subject: [PATCH 2/8] Update the doc update the doc with odo watch --- docs/public/deploying-quarkus-app.adoc | 37 +++++++++++--------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/docs/public/deploying-quarkus-app.adoc b/docs/public/deploying-quarkus-app.adoc index 579209ae8cf..cb97cc2840e 100644 --- a/docs/public/deploying-quarkus-app.adoc +++ b/docs/public/deploying-quarkus-app.adoc @@ -1,9 +1,6 @@ -== Deploying a Quarkus Application +== Deploying a Quarkus Application to Kubernetes/Openshift/Docker cluster - -== Deploying a quarkus component to an Kubernetes/Openshift/Docker cluster - -In this example we will be deploying an https://github.com/odo-devfiles/springboot-ex[example Spring Boot® component] that uses https://maven.apache.org/install.html[Maven] and Java 8 JDK. +In this example we will be deploying a https://github.com/odo-devfiles/quarkus-ex[quarkus component] that uses GraalVM and JDK1.8+. . Download the example quarkus component. + @@ -13,14 +10,14 @@ In this example we will be deploying an https://github.com/odo-devfiles/springbo ---- Alternatively, you can pass in `--downloadSource` to `odo create` to have odo download a sample project. -. Change the current directory to the component directory: +. Change the current directory to the application directory: + [source,sh] ---- $ cd ---- -. Create a component configuration using the `java-spring-boot` component-type named `myspring`: +. Create an quarkus odo component + [source,sh] ---- @@ -35,14 +32,6 @@ Alternatively, you can pass in `--downloadSource` to `odo create` to have odo do Please use odo push command to create the component with source deployed ---- -. List the contents of the directory to see the devfile and sample Java application source code: -+ -[source,sh] ----- - $ ls - mvnw mvnw.cmd pom.xml README.md src ----- - . Create a URL in order to access the deployed component: + [source,sh] @@ -83,7 +72,7 @@ Pushing devfile component myquarkus ---- -. List the URLs of the component: +. View your deployed application in a browser using the generated url + [source,sh] ---- @@ -93,20 +82,24 @@ Pushing devfile component myquarkus myquarkus-8080 http://myquarkus-8080.apps-crc.testing 8080 false ---- -. View your deployed application using the generated URL: -+ +. Run odo watch in application source directory, it would watch the directory for any file changes and push the changes to the cluster. We are running quarkus in https://quarkus.io/guides/getting-started#development-mode[development mode], just refreshing your browser will render the source code changes [source,sh] ---- - $ curl http://myspring-8080.apps-crc.testing + $ odo watch + Waiting for something to change in ~/myquarkus + File ~/myquarkus/src/main/resources/META-INF/resources/.index.html changed + Pushing files... + ---- + + If you do not want to use`odo watch`, just run `odo push` and referesh your browser to render the changes. . To delete your deployed application: + [source,sh] ---- $ odo delete - ? Are you sure you want to delete the devfile component: myspring? Yes - ✓ Deleting devfile component myspring [152ms] + ? Are you sure you want to delete the devfile component: myquarkus? Yes + ✓ Deleting devfile component myquarkus [152ms] ✓ Successfully deleted component ---- - From d8af4953bdff6644e5717da4848045bce5acdb0c Mon Sep 17 00:00:00 2001 From: Aditi Sharma Date: Fri, 3 Jul 2020 17:10:46 +0530 Subject: [PATCH 3/8] update quarkus doc update quarkus doc with formatting changes. --- docs/public/deploying-quarkus-app.adoc | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/docs/public/deploying-quarkus-app.adoc b/docs/public/deploying-quarkus-app.adoc index cb97cc2840e..a2c42624f07 100644 --- a/docs/public/deploying-quarkus-app.adoc +++ b/docs/public/deploying-quarkus-app.adoc @@ -1,7 +1,9 @@ -== Deploying a Quarkus Application to Kubernetes/Openshift/Docker cluster +== Deploying a Quarkus Application to Kubernetes/Openshift cluster In this example we will be deploying a https://github.com/odo-devfiles/quarkus-ex[quarkus component] that uses GraalVM and JDK1.8+. +Before you start make sure you have running openshift/kubernetes cluster and do not forget to login if it is openshift cluster. + . Download the example quarkus component. + [source,sh] @@ -82,24 +84,8 @@ Pushing devfile component myquarkus myquarkus-8080 http://myquarkus-8080.apps-crc.testing 8080 false ---- -. Run odo watch in application source directory, it would watch the directory for any file changes and push the changes to the cluster. We are running quarkus in https://quarkus.io/guides/getting-started#development-mode[development mode], just refreshing your browser will render the source code changes -[source,sh] ----- - $ odo watch - Waiting for something to change in ~/myquarkus - File ~/myquarkus/src/main/resources/META-INF/resources/.index.html changed - Pushing files... - ----- +Continue devloping your application and just run `odo push`, refresh your browser to view the latest changes. +You can also run `odo watch` to watch changes in the source code, just refreshing the browser will render the source code changes. +Run `odo delete` to delete the application from cluster - If you do not want to use`odo watch`, just run `odo push` and referesh your browser to render the changes. -. To delete your deployed application: -+ -[source,sh] ----- - $ odo delete - ? Are you sure you want to delete the devfile component: myquarkus? Yes - ✓ Deleting devfile component myquarkus [152ms] - ✓ Successfully deleted component ----- From 4d4f24a3b470070854c1f634bba4601319fc14aa Mon Sep 17 00:00:00 2001 From: Aditi Sharma Date: Fri, 3 Jul 2020 17:14:40 +0530 Subject: [PATCH 4/8] correct formatting --- docs/public/deploying-quarkus-app.adoc | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/docs/public/deploying-quarkus-app.adoc b/docs/public/deploying-quarkus-app.adoc index a2c42624f07..757cf461721 100644 --- a/docs/public/deploying-quarkus-app.adoc +++ b/docs/public/deploying-quarkus-app.adoc @@ -1,4 +1,4 @@ -== Deploying a Quarkus Application to Kubernetes/Openshift cluster +== Deploying a Quarkus Application on Kubernetes/Openshift cluster In this example we will be deploying a https://github.com/odo-devfiles/quarkus-ex[quarkus component] that uses GraalVM and JDK1.8+. @@ -8,15 +8,7 @@ Before you start make sure you have running openshift/kubernetes cluster and do + [source,sh] ---- - $ git clone https://github.com/odo-devfiles/quarkus-ex ----- -Alternatively, you can pass in `--downloadSource` to `odo create` to have odo download a sample project. - -. Change the current directory to the application directory: -+ -[source,sh] ----- - $ cd + $ git clone https://github.com/odo-devfiles/quarkus-ex && cd quarkus-ex ---- . Create an quarkus odo component @@ -84,8 +76,9 @@ Pushing devfile component myquarkus myquarkus-8080 http://myquarkus-8080.apps-crc.testing 8080 false ---- + Continue devloping your application and just run `odo push`, refresh your browser to view the latest changes. You can also run `odo watch` to watch changes in the source code, just refreshing the browser will render the source code changes. -Run `odo delete` to delete the application from cluster +Run `odo delete` to delete the application from cluster. From 3dc7c202acfaaccbcc4c6003ae434a5599892d35 Mon Sep 17 00:00:00 2001 From: Aditi Sharma Date: Wed, 8 Jul 2020 17:03:42 +0530 Subject: [PATCH 5/8] Update deploying-a-devfile-using-odo.adoc Add quarkus doc Update for kubernetes update new v2 registry update output of odo catalog list components --- .../public/deploying-a-devfile-using-odo.adoc | 181 ++++++++++++++---- docs/public/deploying-quarkus-app.adoc | 84 -------- 2 files changed, 147 insertions(+), 118 deletions(-) delete mode 100644 docs/public/deploying-quarkus-app.adoc diff --git a/docs/public/deploying-a-devfile-using-odo.adoc b/docs/public/deploying-a-devfile-using-odo.adoc index 5ac2af9d9f2..21e03f194d0 100644 --- a/docs/public/deploying-a-devfile-using-odo.adoc +++ b/docs/public/deploying-a-devfile-using-odo.adoc @@ -13,11 +13,11 @@ With a devfile you can describe: Odo takes this devfile and transforms it into a workspace of multiple containers running on OpenShift, Kubernetes or Docker. -Devfiles are YAML files with a defined https://github.com/redhat-developer/devfile/blob/master/docs/devfile.md[schema]. +Devfiles are YAML files with a defined https://devfile.github.io/devfile/_attachments/api-reference.html[schema]. == Odo and devfile -Odo can now create components from devfiles as recorded in registries. Odo automatically consults the default https://github.com/elsony/devfile-registry[devfile] https://github.com/eclipse/che-devfile-registry/[registries] but users can also add their own registries. Devfiles contribute new component types that users can pull to begin development immediately. +Odo can now create components from devfiles as recorded in registries. Odo automatically consults the https://github.com/odo-devfiles/registry[default registry] but users can also add their own registries. Devfiles contribute new component types that users can pull to begin development immediately. An example deployment scenario: @@ -31,32 +31,22 @@ An example deployment scenario: == Deploying your first devfile [discrete] -===== Prerequisites -* Before proceeding, you must know your ingress domain cluster name. For example: `apps-crc.testing` is the cluster domain name for https://github.com/code-ready/crc[Red Hat CodeReady Containers] +==== Prerequisites for Openshift Cluster + * Enable experimental mode for odo. This can be done by: `odo preference set experimental true` -== Creating a project +* Log in to a OpenShift cluster: `odo login -u developer -p developer` -Create a project to keep your source code, tests, and libraries -organized in a separate single unit. +* Create a project: `odo project create myproject` -. Log in to a OpenShift cluster: -+ -[source,sh] ----- - $ odo login -u developer -p developer ----- -. Create a project: -+ -[source,sh] ----- - $ odo project create myproject - ✓ Project 'myproject' is ready for use - ✓ New project created and now using project : myproject ----- -+ +==== Prerequisites for Kubernetes Cluster + +* Enable experimental mode for odo. This can be done by: `odo preference set experimental true` + +* Before proceeding, you must know your cluster domain name to specify host for ingress. + == Listing all available devfile components @@ -80,16 +70,18 @@ organized in a separate single unit. ruby openshift 2.4,2.5,latest NO Odo Devfile Components: - NAME DESCRIPTION SUPPORTED - java-maven Upstream Maven and OpenJDK 11 YES - nodejs Stack with NodeJS 10 YES - java-openliberty Open Liberty microservice in Java YES - java-springboot Spring Boot® using Java YES + NAME DESCRIPTION REGISTRY + java-maven Upstream Maven and OpenJDK 11 DefaultDevfileRegistry + java-openliberty Open Liberty microservice in Java DefaultDevfileRegistry + java-quarkus Upstream Quarkus with Java+GraalVM DefaultDevfileRegistry + java-springboot Spring Boot® using Java DefaultDevfileRegistry + nodejs Stack with NodeJS 12 DefaultDevfileRegistry + ---- In our example, we will be using `java-spring-boot` to deploy a sample https://spring.io/projects/spring-boot[Springboot] component. -== Deploying a Java Spring Boot® component to an OpenShift cluster +== Deploying a Java Spring Boot® component to an OpenShift/Kubernetes cluster In this example we will be deploying an https://github.com/odo-devfiles/springboot-ex[example Spring Boot® component] that uses https://maven.apache.org/install.html[Maven] and Java 8 JDK. @@ -133,15 +125,28 @@ Alternatively, you can pass in `--starter` to `odo create` to have odo download . Create a URL in order to access the deployed component: + +* Run below for Kubernetes cluster ++ [source,sh] ---- - $ odo url create --host apps-crc.testing - ✓ URL myspring-8080.apps-crc.testing created for component: myspring + $ odo url create --host my-cluster.info + ✓ URL myspring-8080.my-cluster.info created for component: myspring To apply the URL configuration changes, please use odo push ---- + + NOTE: You must use your cluster host domain name when creating your URL. ++ +* Run below for Openshift cluster ++ +[source,sh] +---- + $ odo url create + ✓ URL myspring-8080.apps-crc.testing created for component: myspring + + To apply the URL configuration changes, please use odo push +---- . Push the component to the cluster: + @@ -197,7 +202,7 @@ NOTE: You must use your cluster host domain name when creating your URL. ✓ Successfully deleted component ---- -== Deploying a Node.js® component to an OpenShift cluster +== Deploying a Node.js® component to an OpenShift/Kubernetes cluster In this example we will be deploying an https://github.com/odo-devfiles/nodejs-ex[example Node.js® component] that uses https://www.npmjs.com/[NPM]. @@ -240,15 +245,28 @@ In this example we will be deploying an https://github.com/odo-devfiles/nodejs-e . Create a URL in order to access the deployed component: + +* Run below for Kubernetes cluster ++ [source,sh] ---- - $ odo url create --host apps-crc.testing - ✓ URL mynodejs-8080.apps-crc.testing created for component: mynodejs + $ odo url create --host my-cluster.info + ✓ URL mynodejs-8080.my-cluster.info created for component: mynodejs To apply the URL configuration changes, please use odo push ---- + + NOTE: You must use your cluster host domain name when creating your URL. ++ +* Run below for Openshift cluster ++ +[source,sh] +---- + $ odo url create + ✓ URL mynodejs-8080.apps-crc.testing created for component: mynodejs + + To apply the URL configuration changes, please use odo push +---- . Push the component to the cluster: + @@ -304,6 +322,101 @@ NOTE: You must use your cluster host domain name when creating your URL. ✓ Successfully deleted component ---- +== Deploying a Quarkus Application on Kubernetes/Openshift cluster + +In this example we will be deploying a https://github.com/odo-devfiles/quarkus-ex[quarkus component] that uses GraalVM and JDK1.8+. + +. Download the example quarkus component. ++ +[source,sh] +---- + $ git clone https://github.com/odo-devfiles/quarkus-ex && cd quarkus-ex +---- + +. Create an quarkus odo component ++ +[source,sh] +---- + $ odo create java-quarkus myquarkus + Experimental mode is enabled, use at your own risk + + Validation + ✓ Checking devfile compatibility [195728ns] + ✓ Creating a devfile component from registry: DefaultDevfileRegistry [170275ns] + ✓ Validating devfile component [281940ns] + + Please use odo push command to create the component with source deployed +---- + +. Create a URL in order to access the deployed component: ++ +* Run below for Kubernetes cluster ++ +[source,sh] +---- + $ odo url create --host my-cluster.info + ✓ URL myquarkus-8080.my-cluster.info created for component: myquarkus + + To apply the URL configuration changes, please use odo push +---- ++ + +NOTE: You must use your cluster host domain name when creating your URL. ++ +* Run below for Openshift cluster ++ +[source,sh] +---- + $ odo url create + ✓ URL myquarkus-8080.apps-crc.testing created for component: myquarkus + + To apply the URL configuration changes, please use odo push +---- + +. Push the component to the cluster: ++ +[source,sh] +---- + $ odo push + +Validation + ✓ Validating the devfile [44008ns] + +Creating Kubernetes resources for component myquarkus + ✓ Waiting for component to start [10s] + +Applying URL changes + ✓ URLs are synced with the cluster, no changes are required. + +Syncing to component myquarkus + ✓ Checking files for pushing [951138ns] + ✓ Syncing files to the component [204ms] + +Executing devfile commands for component myquarkus + ✓ Executing init-compile command "mvn compile" [3m] + ✓ Executing dev-run command "mvn quarkus:dev" [1s] + +Pushing devfile component myquarkus + ✓ Changes successfully pushed to component + +---- + +. View your deployed application in a browser using the generated url ++ +[source,sh] +---- + $ odo url list + Found the following URLs for component myspring + NAME URL PORT SECURE + myquarkus-8080 http://myquarkus-8080.apps-crc.testing 8080 false +---- ++ +You can now continue developing your application. Just run `odo push` and refresh your browser to view the latest changes. ++ +You can also run `odo watch` to watch changes in the source code. Just refreshing the browser will render the source code changes. ++ +Run `odo delete` to delete the application from cluster. + == Deploying a Java Spring Boot® component locally to Docker In this example, we will be deploying the same Java Spring Boot® component we did earlier, but to a locally running Docker instance. @@ -410,4 +523,4 @@ Docker volumes are created for the project source, and any other volumes defined ? Are you sure you want to delete the devfile component: java-spring-boot? Yes ✓ Deleting devfile component java-spring-boot [139ms] ✓ Successfully deleted component ----- \ No newline at end of file +---- diff --git a/docs/public/deploying-quarkus-app.adoc b/docs/public/deploying-quarkus-app.adoc deleted file mode 100644 index 757cf461721..00000000000 --- a/docs/public/deploying-quarkus-app.adoc +++ /dev/null @@ -1,84 +0,0 @@ -== Deploying a Quarkus Application on Kubernetes/Openshift cluster - -In this example we will be deploying a https://github.com/odo-devfiles/quarkus-ex[quarkus component] that uses GraalVM and JDK1.8+. - -Before you start make sure you have running openshift/kubernetes cluster and do not forget to login if it is openshift cluster. - -. Download the example quarkus component. -+ -[source,sh] ----- - $ git clone https://github.com/odo-devfiles/quarkus-ex && cd quarkus-ex ----- - -. Create an quarkus odo component -+ -[source,sh] ----- - $ odo create quarkus myquarkus - Experimental mode is enabled, use at your own risk - - Validation - ✓ Checking devfile compatibility [195728ns] - ✓ Creating a devfile component from registry: DefaultDevfileRegistry [170275ns] - ✓ Validating devfile component [281940ns] - - Please use odo push command to create the component with source deployed ----- - -. Create a URL in order to access the deployed component: -+ -[source,sh] ----- - $ odo url create --host apps-crc.testing - ✓ URL myquarkus-8080 created for component: myquarkus - - To apply the URL configuration changes, please use odo push ----- -+ -NOTE: You must use your cluster host domain name when creating your URL. - -. Push the component to the cluster: -+ -[source,sh] ----- - $ odo push - -Validation - ✓ Validating the devfile [44008ns] - -Creating Kubernetes resources for component myquarkus - ✓ Waiting for component to start [10s] - -Applying URL changes - ✓ URLs are synced with the cluster, no changes are required. - -Syncing to component quarkus-july - ✓ Checking files for pushing [951138ns] - ✓ Syncing files to the component [204ms] - -Executing devfile commands for component myquarkus - ✓ Executing init-compile command "mvn compile" [3m] - ✓ Executing dev-run command "mvn quarkus:dev" [1s] - -Pushing devfile component myquarkus - ✓ Changes successfully pushed to component - ----- - -. View your deployed application in a browser using the generated url -+ -[source,sh] ----- - $ odo url list - Found the following URLs for component myspring - NAME URL PORT SECURE - myquarkus-8080 http://myquarkus-8080.apps-crc.testing 8080 false ----- - - -Continue devloping your application and just run `odo push`, refresh your browser to view the latest changes. -You can also run `odo watch` to watch changes in the source code, just refreshing the browser will render the source code changes. -Run `odo delete` to delete the application from cluster. - - From d30ca082facc92f200103e0aadee26ef4b9b6acb Mon Sep 17 00:00:00 2001 From: Aditi Sharma Date: Thu, 9 Jul 2020 13:42:19 +0530 Subject: [PATCH 6/8] Addressed review comments Removed docker doc Addressed review comments. --- .../public/deploying-a-devfile-using-odo.adoc | 207 ++++-------------- 1 file changed, 37 insertions(+), 170 deletions(-) diff --git a/docs/public/deploying-a-devfile-using-odo.adoc b/docs/public/deploying-a-devfile-using-odo.adoc index 21e03f194d0..d97647a6857 100644 --- a/docs/public/deploying-a-devfile-using-odo.adoc +++ b/docs/public/deploying-a-devfile-using-odo.adoc @@ -32,20 +32,34 @@ An example deployment scenario: [discrete] -==== Prerequisites for Openshift Cluster +==== Prerequisites for an OpenShift Cluster * Enable experimental mode for odo. This can be done by: `odo preference set experimental true` -* Log in to a OpenShift cluster: `odo login -u developer -p developer` +* Creating a project to keep your source code, tests, and libraries organized in a separate single unit. -* Create a project: `odo project create myproject` +. Log in to an OpenShift cluster: ++ +[source,sh] +---- + $ odo login -u developer -p developer +---- + +. Create a project: ++ +[source,sh] +---- + $ odo project create myproject + ✓ Project 'myproject' is ready for use + ✓ New project created and now using project : myproject +---- -==== Prerequisites for Kubernetes Cluster +==== Prerequisites for a Kubernetes Cluster * Enable experimental mode for odo. This can be done by: `odo preference set experimental true` -* Before proceeding, you must know your cluster domain name to specify host for ingress. +* Before proceeding, you must know your ingress domain name to specify host for url. == Listing all available devfile components @@ -81,7 +95,7 @@ An example deployment scenario: In our example, we will be using `java-spring-boot` to deploy a sample https://spring.io/projects/spring-boot[Springboot] component. -== Deploying a Java Spring Boot® component to an OpenShift/Kubernetes cluster +== Deploying a Java Spring Boot® component to an OpenShift / Kubernetes cluster In this example we will be deploying an https://github.com/odo-devfiles/springboot-ex[example Spring Boot® component] that uses https://maven.apache.org/install.html[Maven] and Java 8 JDK. @@ -123,22 +137,7 @@ Alternatively, you can pass in `--starter` to `odo create` to have odo download README.md devfile.yaml pom.xml src ---- -. Create a URL in order to access the deployed component: -+ -* Run below for Kubernetes cluster -+ -[source,sh] ----- - $ odo url create --host my-cluster.info - ✓ URL myspring-8080.my-cluster.info created for component: myspring - - To apply the URL configuration changes, please use odo push ----- -+ - -NOTE: You must use your cluster host domain name when creating your URL. -+ -* Run below for Openshift cluster +. Create an URL in order to access the deployed component: + [source,sh] ---- @@ -147,6 +146,8 @@ NOTE: You must use your cluster host domain name when creating your URL. To apply the URL configuration changes, please use odo push ---- ++ +NOTE: If deploying on kubernetes, you need to pass ingress domain name via `--host` flag. . Push the component to the cluster: + @@ -202,7 +203,7 @@ NOTE: You must use your cluster host domain name when creating your URL. ✓ Successfully deleted component ---- -== Deploying a Node.js® component to an OpenShift/Kubernetes cluster +== Deploying a Node.js® component to an OpenShift / Kubernetes cluster In this example we will be deploying an https://github.com/odo-devfiles/nodejs-ex[example Node.js® component] that uses https://www.npmjs.com/[NPM]. @@ -243,22 +244,7 @@ In this example we will be deploying an https://github.com/odo-devfiles/nodejs-e Please use odo push command to create the component with source deployed ---- -. Create a URL in order to access the deployed component: -+ -* Run below for Kubernetes cluster -+ -[source,sh] ----- - $ odo url create --host my-cluster.info - ✓ URL mynodejs-8080.my-cluster.info created for component: mynodejs - - To apply the URL configuration changes, please use odo push ----- -+ - -NOTE: You must use your cluster host domain name when creating your URL. -+ -* Run below for Openshift cluster +. Create an URL in order to access the deployed component: + [source,sh] ---- @@ -267,6 +253,8 @@ NOTE: You must use your cluster host domain name when creating your URL. To apply the URL configuration changes, please use odo push ---- ++ +NOTE: If deploying on kubernetes, you need to pass ingress domain name via `--host` flag. . Push the component to the cluster: + @@ -322,18 +310,18 @@ NOTE: You must use your cluster host domain name when creating your URL. ✓ Successfully deleted component ---- -== Deploying a Quarkus Application on Kubernetes/Openshift cluster +== Deploying a Quarkus Application on OpenShift / Kubernetes cluster -In this example we will be deploying a https://github.com/odo-devfiles/quarkus-ex[quarkus component] that uses GraalVM and JDK1.8+. +In this example we will be deploying a https://github.com/odo-devfiles/quarkus-ex[Quarkus component] that uses GraalVM and JDK1.8+. -. Download the example quarkus component. +. Download the example Quarkus component + [source,sh] ---- $ git clone https://github.com/odo-devfiles/quarkus-ex && cd quarkus-ex ---- -. Create an quarkus odo component +. Create a Quarkus odo component + [source,sh] ---- @@ -348,22 +336,7 @@ In this example we will be deploying a https://github.com/odo-devfiles/quarkus-e Please use odo push command to create the component with source deployed ---- -. Create a URL in order to access the deployed component: -+ -* Run below for Kubernetes cluster -+ -[source,sh] ----- - $ odo url create --host my-cluster.info - ✓ URL myquarkus-8080.my-cluster.info created for component: myquarkus - - To apply the URL configuration changes, please use odo push ----- -+ - -NOTE: You must use your cluster host domain name when creating your URL. -+ -* Run below for Openshift cluster +. Create an URL in order to access the deployed component: + [source,sh] ---- @@ -372,6 +345,8 @@ NOTE: You must use your cluster host domain name when creating your URL. To apply the URL configuration changes, please use odo push ---- ++ +NOTE: If deploying on kubernetes, you need to pass ingress domain name via `--host` flag. . Push the component to the cluster: + @@ -410,117 +385,9 @@ Pushing devfile component myquarkus NAME URL PORT SECURE myquarkus-8080 http://myquarkus-8080.apps-crc.testing 8080 false ---- -+ -You can now continue developing your application. Just run `odo push` and refresh your browser to view the latest changes. -+ -You can also run `odo watch` to watch changes in the source code. Just refreshing the browser will render the source code changes. -+ -Run `odo delete` to delete the application from cluster. -== Deploying a Java Spring Boot® component locally to Docker - -In this example, we will be deploying the same Java Spring Boot® component we did earlier, but to a locally running Docker instance. - -*Prerequisites:* Docker `17.05` or higher installed - -. Enabling a separate push target, using the `pushtarget` preference: -+ -[source,sh] ----- - $ odo preference set pushtarget docker - Global preference was successfully updated ----- -+ - -. Download the example Spring Boot® component. -+ -[source,sh] ----- - $ git clone https://github.com/odo-devfiles/springboot-ex ----- -Alternatively, you can pass in `--starter` to `odo create` to have odo download a project specified in the devfile. - -. Change the current directory to the component directory: -+ -[source,sh] ----- - $ cd ----- - -. Create a component configuration using the `java-spring-boot` component-type named `mydockerspringboot`: -+ -[source,sh] ----- - $ odo create java-spring-boot mydockerspringboot - Experimental mode is enabled, use at your own risk - - Validation - ✓ Checking devfile compatibility [195728ns] - ✓ Creating a devfile component from registry: DefaultDevfileRegistry [170275ns] - ✓ Validating devfile component [281940ns] - - Please use odo push command to create the component with source deployed ----- - -. Create a URL in order to access the deployed component: -+ -[source,sh] ----- - $ odo url create --port 8080 - ✓ URL java-spring-boot-8080 created for component: java-spring-boot with exposed port: 59382 - - To apply the URL configuration changes, please use odo push ----- -+ -In order to access the docker application, exposed ports are required and automatically generated by odo. - -. Deploy the Spring Boot® devfile component to Docker: -+ -[source,sh] ----- - $ odo push - - Validation - ✓ Validating the devfile [52685ns] - - Creating Docker resources for component java-spring-boot - ✓ Pulling image maysunfaisal/springbootbuild [879ms] - ✓ Starting container for maysunfaisal/springbootbuild [397ms] - ✓ Pulling image maysunfaisal/springbootruntime [1s] - ✓ URL 127.0.0.1:59382 created - ✓ Starting container for maysunfaisal/springbootruntime [380ms] - - Syncing to component java-spring-boot - ✓ Checking files for pushing [2ms] - ✓ Syncing files to the component [231ms] - - Executing devfile commands for component java-spring-boot - ✓ Executing devbuild command "/artifacts/bin/build-container-full.sh" [1m] - ✓ Executing devrun command "/artifacts/bin/start-server.sh" [1s] - - Pushing devfile component java-spring-boot - ✓ Changes successfully pushed to component ----- -+ -When odo deploys a devfile component, it pulls the images for each `dockercontainer` in `devfile.yaml` and deploys them. -+ -Each docker container that is deployed is labeled with the name of the odo component. -+ -Docker volumes are created for the project source, and any other volumes defined in the devfile and mounted to the necessary containers. +You can now continue developing your application. Just run `odo push` and refresh your browser to view the latest changes. -. View your deployed application using the generated URL: -+ -[source,sh] ----- - $ curl http://127.0.0.1:59382 ----- +You can also run `odo watch` to watch changes in the source code. Just refreshing the browser will render the source code changes. -. To delete your deployed application: -+ -[source,sh] ----- - $ odo delete - ? Are you sure you want to delete the devfile component: java-spring-boot? Yes - ✓ Deleting devfile component java-spring-boot [139ms] - ✓ Successfully deleted component ----- +Run `odo delete` to delete the application from cluster. From 0d080d0930ca4e322c94c509081a066738bb094e Mon Sep 17 00:00:00 2001 From: Aditi Sharma Date: Thu, 9 Jul 2020 20:05:28 +0530 Subject: [PATCH 7/8] Update deploying-a-devfile-using-odo.adoc Added description for ingress. --- docs/public/deploying-a-devfile-using-odo.adoc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/public/deploying-a-devfile-using-odo.adoc b/docs/public/deploying-a-devfile-using-odo.adoc index d97647a6857..b6c5681e568 100644 --- a/docs/public/deploying-a-devfile-using-odo.adoc +++ b/docs/public/deploying-a-devfile-using-odo.adoc @@ -59,7 +59,10 @@ An example deployment scenario: * Enable experimental mode for odo. This can be done by: `odo preference set experimental true` -* Before proceeding, you must know your ingress domain name to specify host for url. +* Before proceeding, you must know your ingress domain name or ingress ip to specify `--host` for `odo url create`. ++ +Ingress ip is usually the external ip of ingress controller service, for minikube or crc clusters running in a virtual machine you can get it by +`minikube ip` or `crc ip`. Checkout this https://kubernetes.io/docs/concepts/services-networking/ingress/[document] to know more about ingress. == Listing all available devfile components From fc2ee750cf9f1c2c459a8dcc061d8fe8f90b9bb9 Mon Sep 17 00:00:00 2001 From: Aditi Sharma Date: Thu, 16 Jul 2020 17:33:54 +0530 Subject: [PATCH 8/8] Update deploying-a-devfile-using-odo.adoc Address review commens --- .../public/deploying-a-devfile-using-odo.adoc | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/public/deploying-a-devfile-using-odo.adoc b/docs/public/deploying-a-devfile-using-odo.adoc index b6c5681e568..992075817eb 100644 --- a/docs/public/deploying-a-devfile-using-odo.adoc +++ b/docs/public/deploying-a-devfile-using-odo.adoc @@ -36,7 +36,7 @@ An example deployment scenario: * Enable experimental mode for odo. This can be done by: `odo preference set experimental true` -* Creating a project to keep your source code, tests, and libraries organized in a separate single unit. +* Create a project to keep your source code, tests, and libraries organized in a separate single unit. . Log in to an OpenShift cluster: + @@ -59,9 +59,9 @@ An example deployment scenario: * Enable experimental mode for odo. This can be done by: `odo preference set experimental true` -* Before proceeding, you must know your ingress domain name or ingress ip to specify `--host` for `odo url create`. +* Before proceeding, you must know your ingress domain name or ingress IP to specify `--host` for `odo url create`. + -Ingress ip is usually the external ip of ingress controller service, for minikube or crc clusters running in a virtual machine you can get it by +Ingress IP is usually the external IP of ingress controller service, for Minikube or CRC clusters running in a virtual machine you can get it by `minikube ip` or `crc ip`. Checkout this https://kubernetes.io/docs/concepts/services-networking/ingress/[document] to know more about ingress. @@ -140,7 +140,7 @@ Alternatively, you can pass in `--starter` to `odo create` to have odo download README.md devfile.yaml pom.xml src ---- -. Create an URL in order to access the deployed component: +. Create a URL in order to access the deployed component: + [source,sh] ---- @@ -150,7 +150,7 @@ Alternatively, you can pass in `--starter` to `odo create` to have odo download To apply the URL configuration changes, please use odo push ---- + -NOTE: If deploying on kubernetes, you need to pass ingress domain name via `--host` flag. +NOTE: If deploying on Kubernetes, you need to pass ingress domain name via `--host` flag. . Push the component to the cluster: + @@ -247,7 +247,7 @@ In this example we will be deploying an https://github.com/odo-devfiles/nodejs-e Please use odo push command to create the component with source deployed ---- -. Create an URL in order to access the deployed component: +. Create a URL in order to access the deployed component: + [source,sh] ---- @@ -257,7 +257,7 @@ In this example we will be deploying an https://github.com/odo-devfiles/nodejs-e To apply the URL configuration changes, please use odo push ---- + -NOTE: If deploying on kubernetes, you need to pass ingress domain name via `--host` flag. +NOTE: If deploying on Kubernetes, you need to pass ingress domain name via `--host` flag. . Push the component to the cluster: + @@ -313,7 +313,7 @@ NOTE: If deploying on kubernetes, you need to pass ingress domain name via `--ho ✓ Successfully deleted component ---- -== Deploying a Quarkus Application on OpenShift / Kubernetes cluster +== Deploying a Quarkus Application to an OpenShift / Kubernetes cluster In this example we will be deploying a https://github.com/odo-devfiles/quarkus-ex[Quarkus component] that uses GraalVM and JDK1.8+. @@ -324,7 +324,7 @@ In this example we will be deploying a https://github.com/odo-devfiles/quarkus-e $ git clone https://github.com/odo-devfiles/quarkus-ex && cd quarkus-ex ---- -. Create a Quarkus odo component +. Create a Quarkus odo component + [source,sh] ---- @@ -339,7 +339,7 @@ In this example we will be deploying a https://github.com/odo-devfiles/quarkus-e Please use odo push command to create the component with source deployed ---- -. Create an URL in order to access the deployed component: +. Create a URL in order to access the deployed component: + [source,sh] ---- @@ -349,7 +349,7 @@ In this example we will be deploying a https://github.com/odo-devfiles/quarkus-e To apply the URL configuration changes, please use odo push ---- + -NOTE: If deploying on kubernetes, you need to pass ingress domain name via `--host` flag. +NOTE: If deploying on Kubernetes, you need to pass ingress domain name via `--host` flag. . Push the component to the cluster: +