Understanding odo

Red Hat OpenShift Developer CLI (odo) is a tool for creating applications on OKD and Kubernetes. With odo, you can develop, test, debug, and deploy microservices-based applications on a Kubernetes cluster without having a deep understanding of the platform.

odo follows a create and push workflow. As a user, when you create, the information (or manifest) is stored in a configuration file. When you push, the corresponding resources are created on the Kubernetes cluster. All of this configuration is stored in the Kubernetes API for seamless accessibility and functionality.

odo uses service and link commands to link components and services together. odo achieves this by creating and deploying services based on Kubernetes Operators in the cluster. Services can be created using any of the Operators available on the Operator Hub. After linking a service, odo injects the service configuration into the component. Your application can then use this configuration to communicate with the Operator-backed service.

odo key features

odo is designed to be a developer-friendly interface to Kubernetes, with the ability to:

  • Quickly deploy applications on a Kubernetes cluster by creating a new manifest or using an existing one

  • Use commands to easily create and update the manifest, without the need to understand and maintain Kubernetes configuration files

  • Provide secure access to applications running on a Kubernetes cluster

  • Add and remove additional storage for applications on a Kubernetes cluster

  • Create Operator-backed services and link your application to them

  • Create a link between multiple microservices that are deployed as odo components

  • Remotely debug applications you deployed using odo in your IDE

  • Easily test applications deployed on Kubernetes using odo

odo core concepts

odo abstracts Kubernetes concepts into terminology that is familiar to developers:

Application

A typical application, developed with a cloud-native approach, that is used to perform a particular task.

Examples of applications include online video streaming, online shopping, and hotel reservation systems.

Component

A set of Kubernetes resources that can run and be deployed separately. A cloud-native application is a collection of small, independent, loosely coupled components.

Examples of components include an API back-end, a web interface, and a payment back-end.

Project

A single unit containing your source code, tests, and libraries.

Context

A directory that contains the source code, tests, libraries, and odo config files for a single component.

URL

A mechanism to expose a component for access from outside the cluster.

Storage

Persistent storage in the cluster. It persists the data across restarts and component rebuilds.

Service

An external application that provides additional functionality to a component.

Examples of services include PostgreSQL, MySQL, Redis, and RabbitMQ.

In odo, services are provisioned from the OpenShift Service Catalog and must be enabled within your cluster.

devfile

An open standard for defining containerized development environments that enables developer tools to simplify and accelerate workflows. For more information, see the documentation at https://devfile.io.

You can connect to publicly available devfile registries, or you can install a Secure Registry.

Listing components in odo

odo uses the portable devfile format to describe components and their related URLs, storage, and services. odo can connect to various devfile registries to download devfiles for different languages and frameworks. See the documentation for the odo registry command for more information on how to manage the registries used by odo to retrieve devfile information.

You can list all the devfiles available of the different registries with the odo catalog list components command.

Procedure

  1. Log in to the cluster with odo:

    1. $ odo login -u developer -p developer
  2. List the available odo components:

    1. $ odo catalog list components

    Example output

    1. Odo Devfile Components:
    2. NAME DESCRIPTION REGISTRY
    3. dotnet50 Stack with .NET 5.0 DefaultDevfileRegistry
    4. dotnet60 Stack with .NET 6.0 DefaultDevfileRegistry
    5. dotnetcore31 Stack with .NET Core 3.1 DefaultDevfileRegistry
    6. go Stack with the latest Go version DefaultDevfileRegistry
    7. java-maven Upstream Maven and OpenJDK 11 DefaultDevfileRegistry
    8. java-openliberty Java application Maven-built stack using the Open Liberty ru... DefaultDevfileRegistry
    9. java-openliberty-gradle Java application Gradle-built stack using the Open Liberty r... DefaultDevfileRegistry
    10. java-quarkus Quarkus with Java DefaultDevfileRegistry
    11. java-springboot Spring Boot® using Java DefaultDevfileRegistry
    12. java-vertx Upstream Vert.x using Java DefaultDevfileRegistry
    13. java-websphereliberty Java application Maven-built stack using the WebSphere Liber... DefaultDevfileRegistry
    14. java-websphereliberty-gradle Java application Gradle-built stack using the WebSphere Libe... DefaultDevfileRegistry
    15. java-wildfly Upstream WildFly DefaultDevfileRegistry
    16. java-wildfly-bootable-jar Java stack with WildFly in bootable Jar mode, OpenJDK 11 and... DefaultDevfileRegistry
    17. nodejs Stack with Node.js 14 DefaultDevfileRegistry
    18. nodejs-angular Stack with Angular 12 DefaultDevfileRegistry
    19. nodejs-nextjs Stack with Next.js 11 DefaultDevfileRegistry
    20. nodejs-nuxtjs Stack with Nuxt.js 2 DefaultDevfileRegistry
    21. nodejs-react Stack with React 17 DefaultDevfileRegistry
    22. nodejs-svelte Stack with Svelte 3 DefaultDevfileRegistry
    23. nodejs-vue Stack with Vue 3 DefaultDevfileRegistry
    24. php-laravel Stack with Laravel 8 DefaultDevfileRegistry
    25. python Python Stack with Python 3.7 DefaultDevfileRegistry
    26. python-django Python3.7 with Django DefaultDevfileRegistry

Telemetry in odo

odo collects information about how it is being used, including metrics on the operating system, RAM, CPU, number of cores, odo version, errors, success/failures, and how long odo commands take to complete.

You can modify your telemetry consent by using the odo preference command:

  • odo preference set ConsentTelemetry true consents to telemetry.

  • odo preference unset ConsentTelemetry disables telemetry.

  • odo preference view shows the current preferences.