This installation can be use at on-premise or behind firewall or virtual box or on other virtualization. This installation will take just a few minutes and can be use for learning OpenShift Container Platform (OCP).
VNC is optional for if using virtual box, vmware workstation or other virtualization on your workstation.
Prerequisite
- Ubuntu 18.04 OS up & running without firewall enable
- Tiger VNC server install and configure
- Docker CE latest version install
Setup TigerVNC
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-18-04
Install Docker
https://docs.docker.com/v17.09/engine/installation/linux/docker-ce/ubuntu/#prerequisites
Download OpenShift Origin package
Un-tar the package
tar -zvxf openshift-origin-client-tools-v3.11.0–0cbc58b-linux-64bit.tar.gz
Copy ‘oc’ command to ‘/usr/local/bin/’ directory on the system
cd openshift-origin-client-tools-v3.11.0–0cbc58b-linux-64bit
cp oc /usr/local/bin/
Verify ‘oc’ version
oc version
Verify ‘oc’ version Output
root@ubuntu:~/# oc version
oc v3.11.0+0cbc58b
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO
Add Insecure registry to docker daemon and restart docker service
This step is necessary — OpenShift caches images locally for image re-use purposes.
sudo su -
cat << EOF > /etc/docker/daemon.json
{
“insecure-registries” : [ “172.30.0.0/16” ]
}
EOF
Restart docker service
service docker restart (or) systemctl stop docker ; systemctl start docker
Start OpenShift Cluster
oc cluster up
Start OpenShift Cluster Output
root@ubuntu:~# oc cluster up
Getting a Docker client …
Checking if image openshift/origin-control-plane:v3.11 is available …
Pulling image openshift/origin-control-plane:v3.11
E0826 12:37:19.838555 18499 helper.go:179] Reading docker config from /root/.docker/config.json failed: open /root/.docker/config.json: no such file or directory, will attempt to pull image docker.io/openshift/origin-control-plane:v3.11 anonymously
Pulled 1/5 layers, 25% complete
Pulled 2/5 layers, 74% complete
Pulled 3/5 layers, 96% complete
Pulled 4/5 layers, 100% complete
Pulled 5/5 layers, 100% complete
Extracting
Image pull complete
Pulling image openshift/origin-cli:v3.11
E0826 12:37:37.043453 18499 helper.go:179] Reading docker config from /root/.docker/config.json failed: open /root/.docker/config.json: no such file or directory, will attempt to pull image docker.io/openshift/origin-cli:v3.11 anonymously
Image pull complete
Pulling image openshift/origin-node:v3.11
E0826 12:37:37.770134 18499 helper.go:179] Reading docker config from /root/.docker/config.json failed: open /root/.docker/config.json: no such file or directory, will attempt to pull image docker.io/openshift/origin-node:v3.11 anonymously
Pulled 5/6 layers, 97% complete
Pulled 6/6 layers, 100% complete
Extracting
Image pull complete
Creating shared mount directory on the remote host …
Determining server IP …
Checking if OpenShift is already running …
The server is accessible via web console at:
You are logged in as:
User: developer
Password: <any value>
To login as administrator:
oc login -u system:admin
Access Console & CLI
Login to VNC and access url https://127.0.0.1:8443 on browser
Login as Administrator
root@ubuntu:~# oc login -u system:admin
Logged into “https://127.0.0.1:8443" as “system:admin” using existing credentials.
You have access to the following projects and can switch between them with ‘oc project <projectname>’:
default
kube-public
kube-system
* myproject
openshift
openshift-infra
openshift-node
openshift-web-console
Using project “myproject”.
root@ubuntu:~# oc whoami
system:admin
root@ubuntu:~#
Login as Developer or other (Copy login command from GUI interface)
example: oc login https://127.0.0.1:8443 — token=ldCThg2V2EDcDTfrpIRGoDsC2Wrl3zoglXhREGWmG-o
*A token is a form of a password. Do not share your API token.
You have one project on this server: “myproject”
Using project “myproject”.
root@ubuntu:~# oc whoami
developer
root@ubuntu:~#
Browse test application
Deployment application route will use nip.io internal DNS
example on
Browser: app-name.127.0.0.1.nip.io
CLI: curl http://developer-apache-myproject.127.0.0.1.nip.io/
<!doctype html>
<html lang=”en”>
<head>
<meta charset=”utf-8">
<meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1">
<title>Welcome to OpenShift</title>
<style>
/*!
* Bootstrap v3.0.0
*
* Copyright 2013 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
.logo {
background-size: cover;: curl app-name.127.0.0.1.nip.io
You will get output like this (if app is deploying right)
<!doctype html>
<html lang=”en”>
<head>
<meta charset=”utf-8">
<meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1">
<title>Welcome to OpenShift</title>
<style>
/*!
* Bootstrap v3.0.0
*
* Copyright 2013 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
.logo {
background-size: cover; — — — — —