Getting started with OpenShift

OpenShift

OpenShift is a container application platform. It is a platform design for the development and deployment of containers. The core technology used as the basis of OpenShift includes Docker-based containers and orchestration via the Kubernets system.


Pre-Requisite - Docker and Kubernetes

First of all, why we need Containers?

That's assuming our application needs some services. One service requires one version of dependencies, while the other service requires another. To achieve compatibility, the architecture of our application needs to be changed over time. Every change we will repeat the tedious process to check the compatibility. :) very annoying.

Containers are very similar to a virtual machine, except for they are sharing the same kernel. As shown in the figure below, each Container has their own independent application, libraries and dependencies (For example, in a java project,  .jar files in the build path are the dependencies). Different Containers can have different dependencies so that applications required different dependencies(especially for different version) or libraries can be run on the same machine. However, apps require different os should be deployed in a different machine, while VM can do this. But this cannot be counted as a disadvantage, cuz the main purposes of Docker Containers are containerized application, ship them and run them.

By contrast, virtual machine has its own operation system. As a consequence, VM is heavier which is usually in GB size, Container is more lightweight which only cost MB size. Meanwhile, the start time of VM will be much longer than that of containers, because it needs to start the whole operation system.



Container Orchestration
In real time case, it is very common that the number of user increase and your application need to make corresponding adjustments(scale up). You will need a platform to orchestrate the connectivity between containers and the automatically scale up or down based on the load. This whole process of automatically deploying and managing containers are called Container Orchestration. Kubernetes  is one of the orchestration technologies.


Getting started with Openshift

--quick install with Minishift--
Minishift download: https://www.okd.io/minishift/
--start Minishift--
go to Minishift.exe folder, run this command in console,
minishift.exe start --vm-driver virturalbox
possible problem 1: vm conflict with hyper-V.
To solve the problem, simply unable heper-V. Disable Hyper-V on Windows 10. Go to Control Panel → Programs → Turn Windows features on or off, check Hyper-V option, make sure all components are unselected and click OK. You may reboot your computer once the Hyper-V feature was removed.
possible problem 2: cannot restart Minishift
If u accidentally shutdown Minishift through Virtual Box and try to restart it, it is possible to get some error. In this case, I suggest using config set skip-startup-checks true to skip checking.

After you successfully start Minishift, it will give you an URL to access OpenShift web console. It means all things are already set up, you can start your OpenShift journey.

Login from web console
Simply enter the URL, and any username and password to login.

Login from command line
oc login




Comments

Popular posts from this blog

Git - comflict solving