All odo commands require a context to indicate the project and "application" in use. When a component is created in a project’s source code directory, this context information is stored in a directory named .odo
.
Most commands, other than for creating a component, require this context information. If the command is run from within a project that has the .odo
directory, odo will automatically read the context information from it.
If a command is run outside of an odo project, the context can be specified in one of two ways:
-
Using the
--context
flag to indicate the project directory containing an.odo
directory. -
Explicitly specifying the OpenShift project and odo application with the
--project
and--app
flags respectively.
odo project create name
-
create a new project
odo project list
-
list all projects in the cluster
odo project get
-
display the currently active project
odo project set name
-
make the specified project active
odo app list
-
list all applications in the current project
odo catalog list components
-
list available component backends
odo catalog search component string
-
list all components whose name contains the text in string
odo catalog list services
-
list available deployable services
odo catalog search service string
-
list all services whose name contains the text in string
odo catalog describe service name
-
display details about the given service
odo create
-
start the interactive component creation
odo create component
-
creates a new component of the given type, using the current directory for its source code
odo create component name
-
same as above, using the specified name as the name of the component in odo
The following flags may be specified when creating a component.
|
explicitly sets an app name that the component will belong to; defaults to |
|
configure the component to run the given binary |
|
sets the given environment variables on the component’s pod |
|
sets additional exposed ports |
odo delete
-
deletes the component indicated by the current context
odo delete name
-
deletes a specific component from the current context by name
odo delete --all
-
same as above, prompting the user to delete the local
.odo
directory as well odo list
-
when run in a project directory, list all components in that project’s application
odo list --all-apps
-
display components across all apps in the current project
odo push
-
push local project files into the cluster and (re)start the component’s pod
odo push --config
-
pushes changes made to the odo configuration of the component without pushing the latest source code (see Configuration below)
odo log
-
display the log messages for the component in the current context
odo log -f
-
tails the component’s logging messages
odo config view
-
show the configuration of the component in the current context, including general metadata (such as type and project), environment variables, and resource limitations
odo config set parameter value
-
sets the value of the given parameter, such as "Type" or "CPU"; using
odo config set -h
displays the possible parameters that can be set odo config unset parameter
-
removes the explicit value for the given parameter, leaving odo to use the default
odo config set --env ENV1=value1
-
sets an environment variable that will be exposed to the component when it is run; multiple values can be set through multiple uses of the
--env
flag odo config unset --env ENV1
-
removes the specified environment variable from the component
odo url create
-
creates a URL for the component in the current context
odo url create name
-
creates a URL, using the specified name to refer to it through odo
odo url create --port port
-
creates a URL for the specified port; this argument is required if the component type exposes more than one port
odo url list
-
show all URLs for the component in the current context
odo url delete name
-
delete the URL with the specified name
odo service create
-
start the interactive service creation
odo service create service
-
creates a new service of the given type using its default configuration values
odo service create service name
-
same as above, using the specified name as the name of the service in odo
odo service delete name
-
delete the specified service; include
-f
to skip the confirmation prompt
odo link component-name
-
link the specified component to the one in the current context; environment variables from the specified component will be made available in the current context component
odo link service-name
-
same as above; linking a service functions in the same way as linking a component
odo link name --port port
-
indiciates which port on the given component/service to link to; this is required if the component/service exposes multiple ports
odo unlink name
-
unlinks the specified component/service from the component in the current context