Monday, 11 June 2018

Overview of OpenShift

Overview of Openshift


Openshift is a cloud platform as a service hosted by Redhat, similar to Heroku. However, Heroku is a public and commercial cloud, but Openshift is an open source, allowing to build of a private cloud.

Openshift has Kubernetes inside, automating orchestration, scaling, and application management.
Openshift has dockers inside, offering virtual containers.

Openshift may help developers and operators to build, test, deploy and run applications in a containerized cloud environment.

Openshift offers access via both web consoles and CLI. You need to install openshift CLI locally before operating openshift locally.

Basic Openshift CLI Commands:

oc command follows a generic format, i.e. oc action object-type object-id-or-name
action: get, describe, new_app; login, project, and status etc
object type: to perform action on a type of object, fx: service (svc).
object-id-or-name: fx: a specific service

oc login: login remote openshift cloud.
oc login -u =   -p = : login with user-name and password
oc logout: logout remote openshift cloud.

oc project: showing which project you are in right now.
oc projects: showing all projects.
oc project : switch to a specific project

oc status: showing status at current project.
oc status -v: in a verbose way.

oc get svc : meaning that, get services. it will show all services offered by this project.
oc describe svc : meaning that, return details of services.
oc describe svc pds-test : meaning that returning a specific service in details.

The following URL describes OpenShift Command in Details


Openshift Terms

It needs to know some basic terms as talking about the Openshift.

Image: Packaged together including Application code, dependencies and any supporting system library, and it is identified by a name that can be local to the current cluster or point to a remote docker registry. 

Pod: a set of containers physically running on the same Node and sharing the same IP. 

Route: A route is an external DNS entry(either a top-level domain or a dynamically allocated name), created to point to a service. So it can be accessed from the external cluster. 

Deployment Configuration[DC]: it defines the template for a pod and manages to deploy new images or configuration changes. 

Build: a build running in a container. it converts source code into an image and pushes it into the docker registry.  Post-build test: it doesn't push the image.  Tag: each image may have tags. 

Secrete: 

Source to Image.

Source-To-Image (S2I) is a toolkit and a workflow for building reproducible docker images from source code.

How to make the source into an image?  simply creating a new application and associating it to the git repository.  Use a command, oc new_app, to create a new application, and link it to a git repository.

$ oc new-app jboss-eap70-openshift~https://github.com/PROJECT.git --name=APPLICATION_NAME

How to link bitbucket with Openshift by SSH key?


In windows OS, using Git-bash or Cygwin may generate private and public pairs (ref. to SSH key generation)




How to specify source code to Jenkins


Some terms you may know 


Can Jackson Deserialize Java Time ZonedDateTime

Yes, but must include JSR310. Thus ZonedDateTime can be deserialized directly from JSON response to POJO field. <dependency> <g...