From 9aa227cec1c6c43221d6d2e0f5ae5a1fbb76bdfb Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Mon, 2 May 2022 16:19:13 +0200 Subject: [PATCH 1/8] Blog post from dev.to/feloy --- docs/website/blog/2022-05-02-odo-v3-alpha1.md | 319 ++++++++++++++++++ 1 file changed, 319 insertions(+) create mode 100644 docs/website/blog/2022-05-02-odo-v3-alpha1.md diff --git a/docs/website/blog/2022-05-02-odo-v3-alpha1.md b/docs/website/blog/2022-05-02-odo-v3-alpha1.md new file mode 100644 index 00000000000..649be4f5314 --- /dev/null +++ b/docs/website/blog/2022-05-02-odo-v3-alpha1.md @@ -0,0 +1,319 @@ +--- +title: odo v3-alpha1 Released +author: Philippe Martin +author_url: https://github.com/feloy +author_image_url: https://github.com/feloy.png +tags: ["release"] +slug: odo-v3-alpha1-release +--- + +`v3-alpha1` of odo has been released! + + + +odo is a tool that aims to simplify the life of developers working on cloud-native applications. + +Thanks to the emergence of the [devfile](https://devfile.io/) open standard, which has been accepted as a CNCF Sandbox project recently (in January 2022), odo v3 is now entirely based on this open standard. + +The goal of the devfile standard is to define the structure of applications and how developers can work on them. + +A single devfile defines the smallest building block of an application, that a developer can build, run, test, debug and deploy. In a cloud-native environment, we generally talk about a micro-service. + +Firstly, the devfile describes the container that is needed to be deployed on a cluster during the development phases, along with the commands to execute on this container to build, run, test and debug the program, assuming the sources have been synchronized into the container. + +Secondly, the devfile provides the instructions to build the container image ready for production, along with the Kubernetes resources to deploy to the cluster. + +## An example of devfile + +To illustrate, here is a simple yet complete devfile, usable for a NodeJS micro-service: + +```yaml +schemaVersion: 2.2.0 +metadata: + description: Stack with NodeJS 12 + displayName: NodeJS Runtime + language: nodejs + name: my-nodejs-app + projectType: nodejs +variables: + CONTAINER_IMAGE: quay.io/phmartin/myimage +components: +- name: runtime + container: + endpoints: + - name: http-3000 + targetPort: 3000 + - name: debug-5858 + targetPort: 5858 + image: registry.access.redhat.com/ubi8/nodejs-14:latest + memoryLimit: 1024Mi + mountSources: true + sourceMapping: /project +- name: outerloop-build + image: + dockerfile: + buildContext: ${PROJECT_ROOT} + rootRequired: false + uri: ./Dockerfile + imageName: "{{CONTAINER_IMAGE}}" +- name: outerloop-deployment + kubernetes: + inlined: | + kind: Deployment + apiVersion: apps/v1 + metadata: + name: my-node + spec: + replicas: 1 + selector: + matchLabels: + app: node-app + template: + metadata: + labels: + app: node-app + spec: + containers: + - name: my-node + image: {{CONTAINER_IMAGE}} + ports: + - name: http + containerPort: 3001 + protocol: TCP + resources: + limits: + memory: "1024Mi" + cpu: "500m" +- name: outerloop-service + kubernetes: + inlined: | + apiVersion: v1 + kind: Service + metadata: + name: svc + spec: + ports: + - name: "3000" + port: 3000 + protocol: TCP + targetPort: 3000 + selector: + app: node-app + type: ClusterIP +commands: +- id: install + exec: + commandLine: npm install + component: runtime + group: + isDefault: true + kind: build + workingDir: /project +- id: run + exec: + commandLine: npm start + component: runtime + group: + isDefault: true + kind: run + workingDir: /project +- id: debug + exec: + commandLine: npm run debug + component: runtime + group: + isDefault: true + kind: debug + workingDir: /project +- id: test + exec: + commandLine: npm test + component: runtime + group: + isDefault: true + kind: test + workingDir: /project +- id: deploy + composite: + commands: + - build-image + - k8s-deployment + - k8s-service + group: + isDefault: true + kind: deploy +- id: build-image + apply: + component: outerloop-build +- id: k8s-deployment + apply: + component: outerloop-deployment +- id: k8s-service + apply: + component: outerloop-service +starterProjects: +- name: nodejs-starter + git: + remotes: + origin: https://github.com/odo-devfiles/nodejs-ex.git +``` + +The `runtime` component defines the container that will be deployed to support the program in development. Specifically, it will use the image `registry.access.redhat.com/ubi8/nodejs-14:latest`, and sources should be placed in the `/project` directory of the container. Two endpoints are also defined, one to access the micro-service, the other to help the debugger attach to the process, during debugging sessions. + +The commands `install`, `run`, `debug` and `test` indicate which commands to execute to respectively build, execute, debug and test the application. For example, the `npm install` command will be executed in the container to build the application, then `npm start` will be executed to start the application. + +To deploy the micro-service, the component `outerloop-build` indicates how to build the production image (by using `./Dockerfile`, and creating an image whose name is defined by the variable `CONTAINER_IMAGE` defined at the beginning of the devfile). then, two other components `outerloop-deployment` and `outerloop-service` define the Kubernetes resources to deploy to the cluster. Note that the first one defines a Deployment that will help deploy a container using the image built with the previous `outerloop-build` component. + +The `starterProjects` section at the end of the devfile indicates a list of starter projects, that can be downloaded to have an example of program deployable with this devfile. + +## Devfile registry + +We can see through the previous example that a devfile is generic enough, with only a few specific values, like the endpoints and the image names. A devfile written for a specific language and framework can be used by most of the programs written using this language and framework, with minimum personalization. + +A devfile registry is available at https://registry.devfile.io, containing devfiles for a large variety of languages and frameworks, and you can deploy your own registry to make accessible your own devfiles. + +## Introducing odo v3 + +You can find the instructions to install odo v3-alpha1 from [this release page](https://github.com/redhat-developer/odo/releases/tag/v3.0.0-alpha1). The binaries are accessible [here](https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/odo/v3.0.0~alpha1/). + +### Initializing a project + +The `odo init` command is the first command to use, before to start using `odo` with your project. The goal of this first step is to get a suitable devfile for your project. + +`odo init` will search for devfiles into devfile registries. By default, `odo` is configured to access only one devfile registry (the one specified above), and you can modify the devfile registries `odo` is accessing using the command `odo preference registry`. + +This `odo init` command offers two modes, either interactive, or manual. The interactive mode will help you discover the appropriate devfile. To use the interactive mode, you just need to enter `odo init` in your command line. + +If you execute this command from a directory containing sources, `odo` will try to recognize the language and framework you are using, will search into the devfile registries you have configured the most appropriate devfile, and give you the choice to use this one, or to search for another one. + +``` +$ odo init + __ + / \__ Initializing new component + \__/ \ Files: Source code detected, a Devfile will be determined based upon source code autodetection + / \__/ odo version: v3.0.0-alpha1 + \__/ + +Interactive mode enabled, please answer the following questions: +Based on the files in the current directory odo detected +Language: javascript +Project type: nodejs +The devfile "nodejs" from the registry "DefaultDevfileRegistry" will be downloaded. +? Is this correct? (Y/n) +``` + +If you answer `No` here, or if you run the `odo init` command from an empty directory, `odo init` will help you choose the appropriate devfile. The command will also help you make some personalization on the devfile, by personalizing the endpoints and the environment variables for the container that will be deployed during the development phase. + +``` +? Select language: javascript +? Select project type: Node.js Runtime + ✓ Downloading devfile "nodejs" from registry "DefaultDevfileRegistry" [961ms] +Current component configuration: +Container "runtime": + Opened ports: + - 3000 + Environment variables: +? Select container for which you want to change configuration? NONE - configuration is correct +? Enter component name: my-nodejs-app + +Your new component 'my-nodejs-app' is ready in the current directory. +To start editing your component, use 'odo dev' and open this folder in your favorite IDE. +Changes will be directly reflected on the cluster. +``` + +Finally, if you start the `odo init` command from an empty directory, it will give you the choice to download one of the starter projects listed in the devfile. + +## The development phase + +Now that a devfile is present in the current directory, you can run your application in development mode, using the `odo dev` command. This command will create a `Deployment` in the cluster that will help start a container as defined in the devfile. Then, the sources present in the current directory will be synchronized into the container, and the commands to build and run the application will be exectued from inside the container. + +At the same time, a port-forwarding will be done for each endpoint defined in the devfile, so you can access the container ports through local ports in your development machine. + +Finally, `odo` will watch for changes in the current directory. When files are modified, added or deleted, `odo` will synchronize the changes to the container, and will restart the build and run commands from inside the container. + +``` +$ odo dev + __ + / \__ Developing using the my-nodejs-app Devfile + \__/ \ Namespace: prj2 + / \__/ odo version: v3.0.0-alpha1 + \__/ + +↪ Deploying to the cluster in developer mode + ✓ Waiting for Kubernetes resources [6s] + ✓ Syncing files into the container [439ms] + ✓ Building your application in container on cluster [3s] + ✓ Executing the application [1s] + +Your application is now running on the cluster + - Forwarding from 127.0.0.1:40001 -> 3000 + - Forwarding from 127.0.0.1:40002 -> 5858 + +Watching for changes in the current directory /home/phmartin/Documents/tests/devto-deploy +Press Ctrl+c to exit `odo dev` and delete resources from the cluster +``` + +To be able to debug the application, you will need to run the `odo dev --debug` command instead. + +When you have finished the development session, you just need to hit Ctrl-c to stop the `odo dev` command. The command won't terminate immediately, as it will delete the resources it has deployed on the cluster before to exit. + +## The deployment phase + +When you are satisfied with your program, you may want to deploy it by building the container image using a `Dockerfile`, instead of using a generic image as during the development phase, and by deploying into the cluster personalized resources, instead of the Deployment used during the development phase. + +At the time of writing, no devfile of the default devfile registry contains instructions for the deployment phase. By using the devfile provided as example above, the command `odo deploy` will deploy a personalized Deployment and a Service into the cluster, after building the container image using the `Dockerfile` present in the directory. + +``` +$ odo deploy + __ + / \__ Deploying the application using my-nodejs-app Devfile + \__/ \ Namespace: prj2 + / \__/ odo version: v3.0.0-alpha1 + \__/ + +↪ Building & Pushing Container: quay.io/phmartin/myimage + • Building image locally ... +STEP 1/7: FROM docker.io/library/node:17 +STEP 2/7: WORKDIR /usr/src/app +[...] +STEP 7/7: CMD [ "node", "server.js" ] +COMMIT quay.io/phmartin/myimage + ✓ Building image locally [6s] + • Pushing image to container registry ... +[...] +Writing manifest to image destination +Storing signatures + ✓ Pushing image to container registry [8s] + +↪ Deploying Kubernetes Component: my-node + ✓ Searching resource in cluster + ✓ Creating kind Deployment [50ms] + +↪ Deploying Kubernetes Component: svc + ✓ Searching resource in cluster + ✓ Creating kind Service [57ms] + +Your Devfile has been successfully deployed +``` + +At any moment, you can check if a component has been deployed, using the `odo list` command. + +``` +$ odo list + ✓ Listing components from namespace 'prj2' [61ms] + NAME PROJECT TYPE RUNNING IN MANAGED + * my-nodejs-app nodejs Deploy odo +``` + +When you are done with this application, or if you want to undeploy it to work on development mode again, you can use the `odo delete component` to undeploy the component from the cluster. + +``` +$ odo delete component +Searching resources to delete, please wait... +This will delete "my-nodejs-app" from the namespace "prj2". + • The component contains the following resources that will get deleted: + - Deployment: my-node + - Service: svc +? Are you sure you want to delete "my-nodejs-app" and all its resources? Yes +The component "my-nodejs-app" is successfully deleted from namespace "prj2" +``` From f5dc3c64ad82a6522ef85add322b919b93b6c897 Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Tue, 3 May 2022 07:52:02 +0200 Subject: [PATCH 2/8] Apply suggestions from code review Review Co-authored-by: Charlie Drage --- docs/website/blog/2022-05-02-odo-v3-alpha1.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/website/blog/2022-05-02-odo-v3-alpha1.md b/docs/website/blog/2022-05-02-odo-v3-alpha1.md index 649be4f5314..63bad49ef8b 100644 --- a/docs/website/blog/2022-05-02-odo-v3-alpha1.md +++ b/docs/website/blog/2022-05-02-odo-v3-alpha1.md @@ -11,21 +11,21 @@ slug: odo-v3-alpha1-release -odo is a tool that aims to simplify the life of developers working on cloud-native applications. +`odo` is a tool that aims to simplify the life of developers working on cloud-native applications. -Thanks to the emergence of the [devfile](https://devfile.io/) open standard, which has been accepted as a CNCF Sandbox project recently (in January 2022), odo v3 is now entirely based on this open standard. +Thanks to the emergence of the [Devfile](https://devfile.io/) open standard, which has been accepted as a CNCF Sandbox project (January 2022), odo v3 is now entirely based on this open standard. -The goal of the devfile standard is to define the structure of applications and how developers can work on them. +The goal of the Devfile standard is to define the structure of applications and how developers can work on them. -A single devfile defines the smallest building block of an application, that a developer can build, run, test, debug and deploy. In a cloud-native environment, we generally talk about a micro-service. +A single Devfile defines the smallest building block of an application, that a developer can: build, run, test, debug and deploy. In a cloud-native environment, we generally talk about a micro-service. -Firstly, the devfile describes the container that is needed to be deployed on a cluster during the development phases, along with the commands to execute on this container to build, run, test and debug the program, assuming the sources have been synchronized into the container. +Firstly, the Devfile describes the container that is needed to be deployed on a cluster during the development phases, along with the commands to execute on this container to build, run, test and debug the program, assuming the sources have been synchronized into the container. -Secondly, the devfile provides the instructions to build the container image ready for production, along with the Kubernetes resources to deploy to the cluster. +Secondly, the Devfile provides the instructions to build the container image ready for production, along with the Kubernetes resources to deploy to the cluster. -## An example of devfile +## An example of a Devfile -To illustrate, here is a simple yet complete devfile, usable for a NodeJS micro-service: +To illustrate, here is a simple yet complete Devfile, usable for a Node.js micro-service: ```yaml schemaVersion: 2.2.0 @@ -164,27 +164,27 @@ The commands `install`, `run`, `debug` and `test` indicate which commands to exe To deploy the micro-service, the component `outerloop-build` indicates how to build the production image (by using `./Dockerfile`, and creating an image whose name is defined by the variable `CONTAINER_IMAGE` defined at the beginning of the devfile). then, two other components `outerloop-deployment` and `outerloop-service` define the Kubernetes resources to deploy to the cluster. Note that the first one defines a Deployment that will help deploy a container using the image built with the previous `outerloop-build` component. -The `starterProjects` section at the end of the devfile indicates a list of starter projects, that can be downloaded to have an example of program deployable with this devfile. +The `starterProjects` section at the end of the Devfile indicates a list of starter projects, that can be downloaded to have an example of program deployable with this Devfile. ## Devfile registry -We can see through the previous example that a devfile is generic enough, with only a few specific values, like the endpoints and the image names. A devfile written for a specific language and framework can be used by most of the programs written using this language and framework, with minimum personalization. +We can see through the previous example that a Devfile is generic enough, with only a few specific values, like the endpoints and the image names. A Devfile written for a specific language and framework can be used by most of the programs written using this language and framework, with minimum personalization. -A devfile registry is available at https://registry.devfile.io, containing devfiles for a large variety of languages and frameworks, and you can deploy your own registry to make accessible your own devfiles. +A Devfile registry is available at https://registry.devfile.io, containing Devfile's for a large variety of languages and frameworks, and you can deploy your own registry to make accessible your own Devfile's. -## Introducing odo v3 +## Introducing `odo` v3 -You can find the instructions to install odo v3-alpha1 from [this release page](https://github.com/redhat-developer/odo/releases/tag/v3.0.0-alpha1). The binaries are accessible [here](https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/odo/v3.0.0~alpha1/). +You can find the instructions to install `odo` v3-alpha1 from [this release page](https://github.com/redhat-developer/odo/releases/tag/v3.0.0-alpha1). The binaries are accessible [here](https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/odo/v3.0.0~alpha1/). ### Initializing a project -The `odo init` command is the first command to use, before to start using `odo` with your project. The goal of this first step is to get a suitable devfile for your project. +The `odo init` command is the first command to use, before to start using `odo` with your project. The goal of this first step is to get a suitable Devfile for your project. -`odo init` will search for devfiles into devfile registries. By default, `odo` is configured to access only one devfile registry (the one specified above), and you can modify the devfile registries `odo` is accessing using the command `odo preference registry`. +`odo init` will search for Devfile's in the Devfile registries. By default, `odo` is configured to access only one Devfile registry (the one specified above), and you can modify the Devfile registries `odo` is accessing using the command `odo preference registry`. -This `odo init` command offers two modes, either interactive, or manual. The interactive mode will help you discover the appropriate devfile. To use the interactive mode, you just need to enter `odo init` in your command line. +This `odo init` command offers two modes, either interactive, or manual. The interactive mode will help you discover the appropriate Devfile. To use the interactive mode, you just need to enter `odo init` in your command line. -If you execute this command from a directory containing sources, `odo` will try to recognize the language and framework you are using, will search into the devfile registries you have configured the most appropriate devfile, and give you the choice to use this one, or to search for another one. +If you execute this command from a directory containing sources, `odo` will try to recognize the language and framework you are using, will search into the Devfile registries you have configured the most appropriate Devfile, and give you the choice to use this one, or to search for another one. ``` $ odo init @@ -202,7 +202,7 @@ The devfile "nodejs" from the registry "DefaultDevfileRegistry" will be download ? Is this correct? (Y/n) ``` -If you answer `No` here, or if you run the `odo init` command from an empty directory, `odo init` will help you choose the appropriate devfile. The command will also help you make some personalization on the devfile, by personalizing the endpoints and the environment variables for the container that will be deployed during the development phase. +If you answer `No` here, or if you run the `odo init` command from an empty directory, `odo init` will help you choose the appropriate Devfile. The command will also help you make some personalization on the Devfile, by personalizing the endpoints and the environment variables for the container that will be deployed during the development phase. ``` ? Select language: javascript @@ -221,13 +221,13 @@ To start editing your component, use 'odo dev' and open this folder in your favo Changes will be directly reflected on the cluster. ``` -Finally, if you start the `odo init` command from an empty directory, it will give you the choice to download one of the starter projects listed in the devfile. +Finally, if you start the `odo init` command from an empty directory, it will give you the choice to download one of the starter projects listed in the Devfile. ## The development phase -Now that a devfile is present in the current directory, you can run your application in development mode, using the `odo dev` command. This command will create a `Deployment` in the cluster that will help start a container as defined in the devfile. Then, the sources present in the current directory will be synchronized into the container, and the commands to build and run the application will be exectued from inside the container. +Now that a Devfile is present in the current directory, you can run your application in development mode, using the `odo dev` command. This command will create a `Deployment` in the cluster that will help start a container as defined in the Devfile. Then, the sources present in the current directory will be synchronized into the container, and the commands to build and run the application will be executed from inside the container. -At the same time, a port-forwarding will be done for each endpoint defined in the devfile, so you can access the container ports through local ports in your development machine. +At the same time, a port-forwarding will be done for each endpoint defined in the Devfile, so you can access the container ports through local ports in your development machine. Finally, `odo` will watch for changes in the current directory. When files are modified, added or deleted, `odo` will synchronize the changes to the container, and will restart the build and run commands from inside the container. @@ -261,7 +261,7 @@ When you have finished the development session, you just need to hit Ctrl-c to s When you are satisfied with your program, you may want to deploy it by building the container image using a `Dockerfile`, instead of using a generic image as during the development phase, and by deploying into the cluster personalized resources, instead of the Deployment used during the development phase. -At the time of writing, no devfile of the default devfile registry contains instructions for the deployment phase. By using the devfile provided as example above, the command `odo deploy` will deploy a personalized Deployment and a Service into the cluster, after building the container image using the `Dockerfile` present in the directory. +At the time of this blog post, no Devfile within the default Devfile registry contains instructions for the deployment phase. By using the Devfile provided as example above, the command `odo deploy` will deploy a personalized Deployment and a Service into the cluster, after building the container image using the `Dockerfile` present in the directory. ``` $ odo deploy @@ -296,7 +296,7 @@ Storing signatures Your Devfile has been successfully deployed ``` -At any moment, you can check if a component has been deployed, using the `odo list` command. +At any moment, you can check if a component has been deployed by using the `odo list` command. ``` $ odo list @@ -305,7 +305,7 @@ $ odo list * my-nodejs-app nodejs Deploy odo ``` -When you are done with this application, or if you want to undeploy it to work on development mode again, you can use the `odo delete component` to undeploy the component from the cluster. +When you are done with this application or if you want to undeploy it to work on development mode again, you can use the `odo delete component` to undeploy the component from the cluster. ``` $ odo delete component From 29ee3602e07bd428d4df273fe6a2904a28b09068 Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Tue, 3 May 2022 07:55:19 +0200 Subject: [PATCH 3/8] Review --- docs/website/blog/2022-05-02-odo-v3-alpha1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/website/blog/2022-05-02-odo-v3-alpha1.md b/docs/website/blog/2022-05-02-odo-v3-alpha1.md index 63bad49ef8b..1f63611750a 100644 --- a/docs/website/blog/2022-05-02-odo-v3-alpha1.md +++ b/docs/website/blog/2022-05-02-odo-v3-alpha1.md @@ -259,7 +259,7 @@ When you have finished the development session, you just need to hit Ctrl-c to s ## The deployment phase -When you are satisfied with your program, you may want to deploy it by building the container image using a `Dockerfile`, instead of using a generic image as during the development phase, and by deploying into the cluster personalized resources, instead of the Deployment used during the development phase. +When you are satisfied with your program, you may want to deploy it. The first step would be to build the container image using a `Dockerfile`, instead of using a generic image as during the development phase. The second step would be to deploy personalized resources, instead of the Deployment used during the development phase. At the time of this blog post, no Devfile within the default Devfile registry contains instructions for the deployment phase. By using the Devfile provided as example above, the command `odo deploy` will deploy a personalized Deployment and a Service into the cluster, after building the container image using the `Dockerfile` present in the directory. From 32166b1ab518411ac2afbf29f57cbbe9d971fb9a Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Wed, 4 May 2022 08:19:02 +0200 Subject: [PATCH 4/8] Update docs/website/blog/2022-05-02-odo-v3-alpha1.md Co-authored-by: Parthvi Vala --- docs/website/blog/2022-05-02-odo-v3-alpha1.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/website/blog/2022-05-02-odo-v3-alpha1.md b/docs/website/blog/2022-05-02-odo-v3-alpha1.md index 1f63611750a..72e91165726 100644 --- a/docs/website/blog/2022-05-02-odo-v3-alpha1.md +++ b/docs/website/blog/2022-05-02-odo-v3-alpha1.md @@ -316,4 +316,6 @@ This will delete "my-nodejs-app" from the namespace "prj2". - Service: svc ? Are you sure you want to delete "my-nodejs-app" and all its resources? Yes The component "my-nodejs-app" is successfully deleted from namespace "prj2" -``` + +## End-to-end use case + From 96ca5ae1dd82fdc2e8174ce1b3d33a6e08a9312f Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Wed, 4 May 2022 08:59:14 +0200 Subject: [PATCH 5/8] Rename demo section --- docs/website/blog/2022-05-02-odo-v3-alpha1.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/website/blog/2022-05-02-odo-v3-alpha1.md b/docs/website/blog/2022-05-02-odo-v3-alpha1.md index 72e91165726..7151b395017 100644 --- a/docs/website/blog/2022-05-02-odo-v3-alpha1.md +++ b/docs/website/blog/2022-05-02-odo-v3-alpha1.md @@ -316,6 +316,8 @@ This will delete "my-nodejs-app" from the namespace "prj2". - Service: svc ? Are you sure you want to delete "my-nodejs-app" and all its resources? Yes The component "my-nodejs-app" is successfully deleted from namespace "prj2" +``` + +## Demo -## End-to-end use case From a64f46e69f89c62a1e33dc3ba69e48cb33fa2407 Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Wed, 4 May 2022 09:53:08 +0200 Subject: [PATCH 6/8] Add Parthvi as author --- docs/website/blog/2022-05-02-odo-v3-alpha1.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/website/blog/2022-05-02-odo-v3-alpha1.md b/docs/website/blog/2022-05-02-odo-v3-alpha1.md index 7151b395017..3fa23031b0b 100644 --- a/docs/website/blog/2022-05-02-odo-v3-alpha1.md +++ b/docs/website/blog/2022-05-02-odo-v3-alpha1.md @@ -1,8 +1,12 @@ --- title: odo v3-alpha1 Released -author: Philippe Martin -author_url: https://github.com/feloy -author_image_url: https://github.com/feloy.png +authors: +- name: Parthvi Vala + url: https://github.com/valaparthvi + image_url: https://github.com/valaparthvi.png +- name: Philippe Martin + url: https://github.com/feloy + image_url: https://github.com/feloy.png tags: ["release"] slug: odo-v3-alpha1-release --- @@ -77,7 +81,7 @@ components: - name: my-node image: {{CONTAINER_IMAGE}} ports: - - name: http + - name: httphttps://docusaurus.io/tests/blog/2021/08/23/multiple-authors containerPort: 3001 protocol: TCP resources: From 45ad3595e81e0c4d980545bebe30670d5b59e10f Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Wed, 4 May 2022 14:18:27 +0200 Subject: [PATCH 7/8] Apply suggestions from code review Co-authored-by: Parthvi Vala --- docs/website/blog/2022-05-02-odo-v3-alpha1.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/website/blog/2022-05-02-odo-v3-alpha1.md b/docs/website/blog/2022-05-02-odo-v3-alpha1.md index 3fa23031b0b..384f6bf88c4 100644 --- a/docs/website/blog/2022-05-02-odo-v3-alpha1.md +++ b/docs/website/blog/2022-05-02-odo-v3-alpha1.md @@ -166,7 +166,7 @@ The `runtime` component defines the container that will be deployed to support t The commands `install`, `run`, `debug` and `test` indicate which commands to execute to respectively build, execute, debug and test the application. For example, the `npm install` command will be executed in the container to build the application, then `npm start` will be executed to start the application. -To deploy the micro-service, the component `outerloop-build` indicates how to build the production image (by using `./Dockerfile`, and creating an image whose name is defined by the variable `CONTAINER_IMAGE` defined at the beginning of the devfile). then, two other components `outerloop-deployment` and `outerloop-service` define the Kubernetes resources to deploy to the cluster. Note that the first one defines a Deployment that will help deploy a container using the image built with the previous `outerloop-build` component. +To deploy the micro-service, the component `outerloop-build` indicates how to build the production image (by using `./Dockerfile`, and creating an image whose name is defined by the variable `CONTAINER_IMAGE` defined at the beginning of the devfile). Then, two other components `outerloop-deployment` and `outerloop-service` define the Kubernetes resources to deploy to the cluster. Note that the first one defines a Deployment that will help deploy a container using the image built with the previous `outerloop-build` component. And, the second `outerloop-service` component will help expose the deployment created by `outerloop-deployment` component. The `starterProjects` section at the end of the Devfile indicates a list of starter projects, that can be downloaded to have an example of program deployable with this Devfile. @@ -182,13 +182,13 @@ You can find the instructions to install `odo` v3-alpha1 from [this release page ### Initializing a project -The `odo init` command is the first command to use, before to start using `odo` with your project. The goal of this first step is to get a suitable Devfile for your project. +The `odo init` command is the first command to use, before starting to use `odo` with your project. The goal of this first step is to get a suitable Devfile for your project. `odo init` will search for Devfile's in the Devfile registries. By default, `odo` is configured to access only one Devfile registry (the one specified above), and you can modify the Devfile registries `odo` is accessing using the command `odo preference registry`. This `odo init` command offers two modes, either interactive, or manual. The interactive mode will help you discover the appropriate Devfile. To use the interactive mode, you just need to enter `odo init` in your command line. -If you execute this command from a directory containing sources, `odo` will try to recognize the language and framework you are using, will search into the Devfile registries you have configured the most appropriate Devfile, and give you the choice to use this one, or to search for another one. +If you execute this command from a directory containing sources, `odo` will try to recognize the language and framework you are using, will search into the Devfile registries that you have configured for the most appropriate Devfile, and give you the choice to use it, or to search for another one. ``` $ odo init @@ -229,7 +229,7 @@ Finally, if you start the `odo init` command from an empty directory, it will gi ## The development phase -Now that a Devfile is present in the current directory, you can run your application in development mode, using the `odo dev` command. This command will create a `Deployment` in the cluster that will help start a container as defined in the Devfile. Then, the sources present in the current directory will be synchronized into the container, and the commands to build and run the application will be executed from inside the container. +Now that a Devfile is present in the current directory, you can run your application in the development mode, using the `odo dev` command. This command will create a `Deployment` in the cluster that will help start a container as defined in the Devfile. Then, the sources present in the current directory will be synchronized into the container, and the commands to build and run the application will be executed from inside the container. At the same time, a port-forwarding will be done for each endpoint defined in the Devfile, so you can access the container ports through local ports in your development machine. @@ -259,13 +259,13 @@ Press Ctrl+c to exit `odo dev` and delete resources from the cluster To be able to debug the application, you will need to run the `odo dev --debug` command instead. -When you have finished the development session, you just need to hit Ctrl-c to stop the `odo dev` command. The command won't terminate immediately, as it will delete the resources it has deployed on the cluster before to exit. +When you have finished the development session, you just need to hit Ctrl-c to stop the `odo dev` command. The command won't terminate immediately, as it will delete the resources it has deployed on the cluster before exiting. ## The deployment phase When you are satisfied with your program, you may want to deploy it. The first step would be to build the container image using a `Dockerfile`, instead of using a generic image as during the development phase. The second step would be to deploy personalized resources, instead of the Deployment used during the development phase. -At the time of this blog post, no Devfile within the default Devfile registry contains instructions for the deployment phase. By using the Devfile provided as example above, the command `odo deploy` will deploy a personalized Deployment and a Service into the cluster, after building the container image using the `Dockerfile` present in the directory. +At the time of this blog post, no Devfile within the default Devfile registry contains instructions for the deployment phase. By using the Devfile provided as an example above, the command `odo deploy` will build the container image using the `Dockerfile` present in the directory, and then deploy a personalized Deployment using the container image and a Service into the cluster. ``` $ odo deploy From 0a074e1a2433b6515a9d1c854c8409b39acc6f19 Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Wed, 4 May 2022 18:47:41 +0200 Subject: [PATCH 8/8] Replaces Devfile's with Devfiles --- docs/website/blog/2022-05-02-odo-v3-alpha1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/website/blog/2022-05-02-odo-v3-alpha1.md b/docs/website/blog/2022-05-02-odo-v3-alpha1.md index 384f6bf88c4..f84301c5928 100644 --- a/docs/website/blog/2022-05-02-odo-v3-alpha1.md +++ b/docs/website/blog/2022-05-02-odo-v3-alpha1.md @@ -174,7 +174,7 @@ The `starterProjects` section at the end of the Devfile indicates a list of star We can see through the previous example that a Devfile is generic enough, with only a few specific values, like the endpoints and the image names. A Devfile written for a specific language and framework can be used by most of the programs written using this language and framework, with minimum personalization. -A Devfile registry is available at https://registry.devfile.io, containing Devfile's for a large variety of languages and frameworks, and you can deploy your own registry to make accessible your own Devfile's. +A Devfile registry is available at https://registry.devfile.io, containing Devfiles for a large variety of languages and frameworks, and you can deploy your own registry to make accessible your own Devfiles. ## Introducing `odo` v3 @@ -184,7 +184,7 @@ You can find the instructions to install `odo` v3-alpha1 from [this release page The `odo init` command is the first command to use, before starting to use `odo` with your project. The goal of this first step is to get a suitable Devfile for your project. -`odo init` will search for Devfile's in the Devfile registries. By default, `odo` is configured to access only one Devfile registry (the one specified above), and you can modify the Devfile registries `odo` is accessing using the command `odo preference registry`. +`odo init` will search for Devfiles in the Devfile registries. By default, `odo` is configured to access only one Devfile registry (the one specified above), and you can modify the Devfile registries `odo` is accessing using the command `odo preference registry`. This `odo init` command offers two modes, either interactive, or manual. The interactive mode will help you discover the appropriate Devfile. To use the interactive mode, you just need to enter `odo init` in your command line.