OC or Openshift CLI: create an app

OpenShift OC Documentation

https://docs.openshift.com/enterprise/3.0/cli_reference/index.html

1- login

2- create a projeCT ( NAME SPACE )

3- create a new-APP

4- expose the service ( public internet )


C:\Users\jkriker\Desktop>oc login https://api.starter-us-west-2.openshift.com
Authentication required for https://api.starter-us-west-2.openshift.com:443 (openshift)
Username: jlk0013
Password:
Login successful.

You don't have any projects. You can try to create a new project, by running

oc new-project <projectname>


C:\Users\jkriker\Desktop>oc new-project jlk-from-oc-cli
Now using project "jlk-from-oc-cli" on server "https://api.starter-us-west-2.openshift.com:443".

You can add applications to this project with the 'new-app' command. For example, try:

oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-ex.git

to build a new example application in Ruby.

C:\Users\jkriker\Desktop>oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-ex.git
--> Found Docker image 83e3e70 (36 hours old) from Docker Hub for "centos/ruby-22-centos7"

Ruby 2.2
--------
Platform for building and running Ruby 2.2 applications

Tags: builder, ruby, ruby22

* An image stream will be created as "ruby-22-centos7:latest" that will track the source image
* A source build using source code from https://github.com/openshift/ruby-ex.git will be created
* The resulting image will be pushed to image stream "ruby-ex:latest"
* Every time "ruby-22-centos7:latest" changes a new build will be triggered
* This image will be deployed in deployment config "ruby-ex"
* Port 8080/tcp will be load balanced by service "ruby-ex"
* Other containers can access this service through the hostname "ruby-ex"

--> Creating resources ...
imagestream "ruby-22-centos7" created
imagestream "ruby-ex" created
buildconfig "ruby-ex" created
deploymentconfig "ruby-ex" created
service "ruby-ex" created
--> Success
Build scheduled, use 'oc logs -f bc/ruby-ex' to track its progress.
Run 'oc status' to view your app.

C:\Users\jkriker\Desktop>oc status
In project jlk-from-oc-cli on server https://api.starter-us-west-2.openshift.com:443

svc/ruby-ex - 172.30.79.255:8080
dc/ruby-ex deploys istag/ruby-ex:latest <-
bc/ruby-ex source builds https://github.com/openshift/ruby-ex.git on istag/ruby-22-centos7:latest
build #1 running for about a minute - 855ab2d: Merge pull request #6 from aj07/typo (Ionut Palade <PI-Victor@users.noreply.github.com>)
deployment #1 waiting on image or update

View details with 'oc describe <resource>/<name>' or list everything with 'oc get all'.




4- expose the service ( public internet )


C:\Users\jkriker\Desktop>oc expose service ruby-ex
route "ruby-ex" exposed




http://ruby-ex-jlk-from-oc-2.7e14.starter-us-west-2.openshiftapps.com/