Pages

Friday, November 23, 2018

OpenShift Installation - Oc Cluster Up

The main feature of minishift is that it provides through the virtual machine. In order to start the openShift cluster inside that virtual machine, minishift delegates the control to command “oc cluster up” . The Oc program is a command line client for OpenShift. Using this command line utility we can run our own cluster without using a Virtual machine. We have to do things manually for this type of installation. 

1. Install Docker ( run the commands one by one as root user ) 
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo 
sudo yum install docker-ce 
service docker restart 

2. Once the docker service is up and running, Configure the Docker daemon with an insecure registry parameter of 172.30.0.0/16 
 
edit the /etc/docker/daemon.json file and add the following: 
  "insecure-registries": [ 
    "172.30.0.0/16" 
  ] 
}
 If the above file is not present, create one 

3. Restart the docker service using “service docker restart” 

4. Download the oc command line tool program from hereI have choosen to download 3.9 version client. 

5. Run the download command as 

6. extract the package using “tar xvf openshift*” 

7. From inside the extracted folder run, oc cluster up --public-hostname=172.16.202.96 --routing-suffix=testing.xip. The public hostname is you system or VM public IP address or ip address that can be accessible from localhost machine 

[root@testing-machine ~]# oc cluster up --public-hostname=172.16.202.96 --routing-suffix=testing.xip.io 
Using nsenter mounter for OpenShift volumes 
Using public hostname IP 172.16.202.96 as the host IP 
Using 172.16.202.96 as the server IP 
Starting OpenShift using openshift/origin:v3.9.0 ... 
OpenShift server started. 

The server is accessible via web console at: 
           https://172.16.202.96:8443 

You are logged in as: 
User: developer 
Password:  

To login as administrator: 
    oc login -u system:admin 

The Installation and Configuration will take some time to complete. Once we receive the above output we can check for the console using the “https://172.16.202.96:8443 
 

Check the Oc version using the command line, 
[root@testing-machine ~]# oc version 
oc v3.9.0+191fece 
kubernetes v1.9.1+a0ce1bc657 
features: Basic-Auth GSSAPI Kerberos SPNEGO 
openshift v3.9.0+71543b2-33 
kubernetes v1.9.1+a0ce1bc657 
 
The Oc cluster up command is used for local development and testing, not for production. By default when the cluster is up and down, the changes that are done in between are not persistent. In order to save our work so that the changes are persistent with multiple cluster up and down we have to pass additional command line arguments as,  

[root@testing-machine ~]# oc cluster up --public-hostname=172.16.202.96 --routing-suffix=testing.xip.io --use-existing-config --host-config-dir $HOME/.oc-cluster-up/config --host-data-dir $HOME/.oc-cluster-up/data 
Using nsenter mounter for OpenShift volumes 
Using public hostname IP 172.16.202.96 as the host IP 
Using 172.16.202.96 as the server IP 
Starting OpenShift using openshift/origin:v3.9.0 ... 
OpenShift server started. 

The server is accessible via web console at: 

You are logged in as: 
User: developer 
Password:  
 To login as administrator: 
oc login -u system:admin

More to Come, Happy Learning

No comments :

Post a Comment