Odo - OpenShift/OKD Do
I stumbled upon a new Dev-Tool to write, build and deploy applications on OpenShift.
Installation on MacOS
[xxx@xxx ~]# sudo curl -L https://github.com/redhat-developer/odo/releases/download/v0.0.17/odo-darwin-amd64 -o /usr/local/bin/odo && sudo chmod +x /usr/local/bin/odo
Password:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 607 0 607 0 0 1518 0 --:--:-- --:--:-- --:--:-- 1521
100 45.1M 100 45.1M 0 0 2786k 0 0:00:16 0:00:16 --:--:-- 2832k
Usage
[xxx@xxx ~]# odo
Odo (OpenShift Do) is a CLI tool for running OpenShift applications in a fast and automated matter. Odo reduces the complexity of deployment by adding iterative development without the worry of deploying your source code. Find more information at https://github.com/redhat-developer/odo
Usage:
odo [command]
Examples:
# Creating and deploying a Node.js project
git clone https://github.com/openshift/nodejs-ex && cd nodejs-ex
odo create nodejs
odo push
# Accessing your Node.js component
odo url create
Component Commands:
component Components of application.
create Create a new component
delete Delete an existing component
describe Describe the given component
link Link component to a service or component
list List all components in the current application
log Retrieve the log for the given component.
push Push source code to a component
update Update the source code path of a component
watch Watch for changes, update component on change
Other Commands:
app Perform application operations
catalog Catalog related operations
project Perform project operations
service Perform service catalog operations
storage Perform storage operations
url Expose component to the outside world
Utility Commands:
help Help about any command
login Login to cluster
logout Log out of the current OpenShift session
utils Utilities for terminal commands and modifying Odo configurations
version Print the client version information
Flags:
--alsologtostderr log to standard error as well as files
--complete Install completion for odo command
-h, --help help for odo
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files (default false)
--skip-connection-check Skip cluster check
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
--uncomplete Uninstall completion for odo command
-v, --v Level log level for V logs. Level varies from 0 to 9 (default 0).
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
-y, --y Don't prompt user for typing 'yes' when installing completion
Use "odo [command] --help" for more information about a command.
Getting Started
[xxx@xxx ~]# odo login
Authentication required for https://console.bierochs.org:8443 (openshift)
Username: xxx
Password:
Login successful.
You have access to the following projects and can switch between them with 'odo project <projectname>':
* default
kube-public
kube-service-catalog
kube-system
management-infra
openshift
openshift-console
openshift-infra
openshift-logging
openshift-metrics-server
openshift-monitoring
openshift-node
openshift-sdn
openshift-template-service-broker
openshift-web-console
Using project "default".
[xxx@xxx ~]# odo project create odo-project
OK New project created and now using project : odo-project
[xxx@xxx ~]# odo app create odo-app
Creating application: odo-app in project: odo-project
Switched to application: odo-app in project: odo-project
[xxx@xxx ~]# git clone https://github.com/openshift/nodejs-ex && cd nodejs-ex
Klone nach 'nodejs-ex' ...
remote: Enumerating objects: 631, done.
remote: Total 631 (delta 0), reused 0 (delta 0), pack-reused 631
Empfange Objekte: 100% (631/631), 212.18 KiB | 773.00 KiB/s, Fertig.
Löse Unterschiede auf: 100% (247/247), Fertig.
[xxx@xxx ~]# ll
total 48
-rw-r--r-- 1 michi staff 13K 8 Jan 20:29 README.md
drwxr-xr-x 3 michi staff 96B 8 Jan 20:29 helm
drwxr-xr-x 4 michi staff 128B 8 Jan 20:29 openshift
-rw-r--r-- 1 michi staff 817B 8 Jan 20:29 package.json
-rw-r--r-- 1 michi staff 3,7K 8 Jan 20:29 server.js
drwxr-xr-x 3 michi staff 96B 8 Jan 20:29 tests
drwxr-xr-x 3 michi staff 96B 8 Jan 20:29 views
[xxx@xxx ~]# odo create nodejs
✓ Checking component
✓ Checking component version
✓ Creating component nodejs-ex-nodejs-diqo
OK Component 'nodejs-ex-nodejs-diqo' was created and port 8080/TCP was opened
OK Component 'nodejs-ex-nodejs-diqo' is now set as active component
To push source code to the component run 'odo push'
[xxx@xxx ~]# odo push
Pushing changes to component: nodejs-ex-nodejs-diqo
✓ Waiting for pod to start
✓ Copying files to pod
✓ Building component
OK Changes successfully pushed to component: nodejs-ex-nodejs-diqo
[xxx@xxx ~]# odo url create
Adding URL to component: nodejs-ex-nodejs-diqo
OK URL created for component: nodejs-ex-nodejs-diqo
nodejs-ex-nodejs-diqo - http://nodejs-ex-nodejs-diqo-odo-app-odo-project.apps.bierochs.org
OKD Overview

OKD Monitoring

Running Application on OKD
