This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.第 2 章 Developer CLI (odo)
2.1. Understanding odo 复制链接链接已复制到粘贴板!
odo
is a CLI tool for creating applications on OpenShift Container Platform and Kubernetes. With odo
, you can write, build, and debug applications on a cluster without the need to administer the cluster itself. Creating deployment configurations, build configurations, service routes and other OpenShift Container Platform or Kubernetes elements are all automated by odo
.
Existing tools such as oc
are operations-focused and require a deep understanding of Kubernetes and OpenShift Container Platform concepts. odo
abstracts away complex Kubernetes and OpenShift Container Platform concepts allowing developers to focus on what is most important to them: code.
2.1.1. Key features 复制链接链接已复制到粘贴板!
odo
is designed to be simple and concise with the following key features:
- Simple syntax and design centered around concepts familiar to developers, such as projects, applications, and components.
- Completely client based. No additional server other than OpenShift Container Platform is required for deployment.
- Official support for Node.js and Java components.
- Partial compatibility with languages and frameworks such as Ruby, Perl, PHP, and Python.
- Detects changes to local code and deploys it to the cluster automatically, giving instant feedback to validate changes in real time.
- Lists all the available components and services from the cluster.
2.1.2. Core concepts 复制链接链接已复制到粘贴板!
- Project
- A project is your source code, tests, and libraries organized in a separate single unit.
- Application
- An application is a program designed for end users. An application consists of multiple microservices or components that work individually to build the entire application. Examples of applications: a video game, a media player, a web browser.
- Component
- A component is a set of Kubernetes resources which host code or data. Each component can be run and deployed separately. Examples of components: Node.js, Perl, PHP, Python, Ruby.
- Service
-
A service is software that your component links to or depends on. Examples of services: MariaDB, Jenkins, MySQL. In
odo
, services are provisioned from the OpenShift Service Catalog and must be enabled within your cluster.
Language | Container image | Package manager | Platform |
---|---|---|---|
Node.js | NPM | amd64, s390x, ppc64le | |
NPM | amd64, s390x, ppc64le | ||
Java | Maven, Gradle | amd64, s390x, ppc64le | |
Maven, Gradle | amd64, s390x, ppc64le | ||
Maven, Gradle | amd64, s390x, ppc64le |
2.1.2.1.1. Listing available container images 复制链接链接已复制到粘贴板!
The list of available container images is sourced from the cluster’s internal container registry and external registries associated with the cluster.
To list the available components and associated container images for your cluster:
Log in to the cluster with
odo
:odo login -u developer -p developer
$ odo login -u developer -p developer
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the available
odo
supported and unsupported components and corresponding container images:odo catalog list components
$ odo catalog list components
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
TAGS
column represents the available image versions, for example,10
represents therhoar-nodejs/nodejs-10
container image.