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.14. odo CLI reference
2.14.1. Basic odo CLI commands 复制链接链接已复制到粘贴板!
2.14.1.1. app 复制链接链接已复制到粘贴板!
Perform application operations related to your OpenShift Container Platform project.
Example using app
2.14.1.2. catalog 复制链接链接已复制到粘贴板!
Perform catalog-related operations.
Example using catalog
2.14.1.3. component 复制链接链接已复制到粘贴板!
Manage components of an application.
Example using component
Create a new component Create a local configuration and create all objects on the cluster
# Create a new component
odo component create
# Create a local configuration and create all objects on the cluster
odo component create --now
2.14.1.4. config 复制链接链接已复制到粘贴板!
Modify odo
specific settings within the config
file.
Example using config
Application | Application is the name of application the component needs to be part of |
CPU | The minimum and maximum CPU a component can consume |
Ignore | Consider the .odoignore file for push and watch |
Application | The name of application that the component needs to be part of |
CPU | The minimum and maximum CPU a component can consume |
Ignore |
Whether to consider the |
MaxCPU | The maximum CPU a component can consume |
MaxMemory | The maximum memory a component can consume |
Memory | The minimum and maximum memory a component can consume |
MinCPU | The minimum CPU a component can consume |
MinMemory | The minimum memory a component is provided |
Name | The name of the component |
Ports | Ports to be opened in the component |
Project | The name of the project that the component is part of |
Ref | Git ref to use for creating component from git source |
SourceLocation | The path indicates the location of binary file or git source |
SourceType | Type of component source - git/binary/local |
Storage | Storage of the component |
Type | The type of component |
Url | The URL to access the component |
2.14.1.5. create 复制链接链接已复制到粘贴板!
Create a configuration describing a component to be deployed on OpenShift Container Platform. If a component name is not provided, it is autogenerated.
By default, builder images are used from the current namespace. To explicitly supply a namespace, use: odo create namespace/name:version
. If a version is not specified, the version defaults to latest
.
Use odo catalog list
to see a full list of component types that can be deployed.
Example using create
2.14.1.6. debug 复制链接链接已复制到粘贴板!
Debug a component.
Example using debug
2.14.1.7. delete 复制链接链接已复制到粘贴板!
Delete an existing component.
Example using delete
Delete component named 'frontend'.
# Delete component named 'frontend'.
odo delete frontend
odo delete frontend --all-apps
2.14.1.8. describe 复制链接链接已复制到粘贴板!
Describe the given component.
Example using describe
Describe nodejs component
# Describe nodejs component
odo describe nodejs
2.14.1.9. link 复制链接链接已复制到粘贴板!
Link a component to a service or component.
Example using link
Link adds the appropriate secret to the environment of the source component. The source component can then consume the entries of the secret as environment variables. If the source component is not provided, the current active component is assumed.
2.14.1.10. list 复制链接链接已复制到粘贴板!
List all the components in the current application and the states of the components.
The states of the components
- Pushed
- A component is pushed to the cluster.
- Not Pushed
- A component is not pushed to the cluster.
- Unknown
-
odo
is disconnected from the cluster.
Example using list
List all components in the application
# List all components in the application
odo list
# List all the components in a given path
odo list --path <path_to_your_component>
2.14.1.11. log 复制链接链接已复制到粘贴板!
Retrieve the log for the given component.
Example using log
Get the logs for the nodejs component
# Get the logs for the nodejs component
odo log nodejs
2.14.1.12. login 复制链接链接已复制到粘贴板!
Log in to the cluster.
Example using login
2.14.1.13. logout 复制链接链接已复制到粘贴板!
Log out of the current OpenShift Container Platform session.
Example using logout
Log out
# Log out
odo logout
2.14.1.14. preference 复制链接链接已复制到粘贴板!
Modify odo
specific configuration settings within the global preference file.
Example using preference
By default, the path to the global preference file is ~/.odo/preferece.yaml
and it is stored in the environment variable GLOBALODOCONFIG
. You can set up a custom path by setting the value of the environment variable to a new preference path, for example GLOBALODOCONFIG="new_path/preference.yaml"
NamePrefix | The default prefix is the current directory name. Use this value to set a default name prefix. |
Timeout | The timeout (in seconds) for OpenShift Container Platform server connection checks. |
UpdateNotification | Controls whether an update notification is shown. |
2.14.1.15. project 复制链接链接已复制到粘贴板!
Perform project operations.
Example using project
2.14.1.16. push 复制链接链接已复制到粘贴板!
Push source code to a component.
Example using push
2.14.1.17. registry 复制链接链接已复制到粘贴板!
Create and modify custom registries.
Example using registry
2.14.1.18. service 复制链接链接已复制到粘贴板!
Perform service catalog operations.
Example using service
2.14.1.19. storage 复制链接链接已复制到粘贴板!
Perform storage operations.
Example using storage
2.14.1.20. unlink 复制链接链接已复制到粘贴板!
Unlink component or a service.
For this command to be successful, the service or component must have been linked prior to the invocation using odo link
.
Example using unlink
2.14.1.21. update 复制链接链接已复制到粘贴板!
Update the source code path of a component
Example using update
2.14.1.22. url 复制链接链接已复制到粘贴板!
Expose a component to the outside world.
Example using url
The URLs that are generated using this command can be used to access the deployed components from outside the cluster.
2.14.1.23. utils 复制链接链接已复制到粘贴板!
Utilities for terminal commands and modifying odo configurations.
Example using utils
Bash terminal PS1 support
# Bash terminal PS1 support
source <(odo utils terminal bash)
# Zsh terminal PS1 support
source <(odo utils terminal zsh)
2.14.1.24. version 复制链接链接已复制到粘贴板!
Print the client version information.
Example using version
Print the client version of odo
# Print the client version of odo
odo version
2.14.1.25. watch 复制链接链接已复制到粘贴板!
odo starts watching for changes and updates the component upon a change automatically.
Example using watch
Watch for changes in directory for current component
# Watch for changes in directory for current component
odo watch
# Watch for changes in directory for component called frontend
odo watch frontend