Download the PPT and code from github as below

Slides:



Advertisements
Similar presentations
Installing and Setting up mongoDB replica set PREPARED BY SUDHEER KONDLA SOLUTIONS ARCHITECT.
Advertisements

Red Hat Installation. Installing Red Hat Linux is the process of copying operating system files from a CD, DVD, or USB flash drive to hard disk(s) on.
Monitoring Scale-Out with the MySQL Enterprise Monitor Andy Bang Lead Software Engineer MySQL-Sun, Enterprise Tools Team Wednesday, April 16, :15.
Cloud Computing for the Enterprise November 18th, This work is licensed under a Creative Commons.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
INTERNET APPLICATION DEVELOPMENT For More visit:
Projects. High Performance Computing Projects Design and implement an HPC cluster with one master node and two compute nodes. (Hint: use Rocks HPC Cluster.
Review Security Hardening IPTables SELinux. Today Installations and updates – Rpm command and packages Apache “Issue Ownership”
Vagrant workflow Jul. 15, 2014.
ODP V2 Data Provider package overview Sergey Sukhonosov National Oceanographic Data Centre, Russia Training course on establishment of the ODP regional.
General rules 1. Rule: 2. Rule: 3. Rule: 10. Rule: Ask questions ……………………. 11. Rule: I do not know your skill. If I tell you things you know, please stop.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
Virtualization Technology and Microsoft Virtual PC 2007 YOU ARE WELCOME By : Osama Tamimi.
Introduction to MySQL  Working with MySQL and MySQL Workbench.
Alfresco deployment with Docker Andrea Agili Software Engineer – Dr Wolf srl Tommaso Visconti DevOps – Dr Wolf srl.
APACHE INSTALL Linux: CentOS 6.5 WHAT IS APACHE Apache is an open source application which is governed by the GNU licensing for use and alteration of.
High Availability Clusters in Linux Sulamita Garcia EDS Unix Specialist
Introduction to tds_fdw
Operating System Kernel Compilation
bitcurator-access-webtools Quick Start Guide
Getting & Running EdgeX Docker Containers
Building ARM IaaS Application Environment
Containers as a Service with Docker to Extend an Open Platform
Abstract After a SIG has been approved, one of the next steps is to get products out to users. During this talk, Niels will explain how the Storage SIG.
Fundamentals Sunny Sharma Microsoft
Agenda Hardware Virtualization Concepts
Open OnDemand: Open Source General Purpose HPC Portal
Installation of MySQL Objectives Contents Practical Summary
Efficient development and deployment of Hydra projects using Vagrant
Lab 05 Firewalls.
WEB APPLICATION TESTING
Getting started with CentOS Linux
Programming Assignment
Docker and Azure Container Service
Data Server S/W Upgrade Samsung Electronics Co., Ltd.
In-Depth Introduction to Docker
Docker – kontejnerizacija na serveru Vedran Vučetić, SPAN
DCR ARB Presentation Team 5: Tour Conductor.
Machine Learning Workshop
Containers and Virtualisation
Andrew Pruski SQL Server & Containers
Drupal VM and Docker4Drupal For Drupal Development Platform
Oracle Solaris Zones Study Purpose Only
More Scripting & Chapter 11
Module 3 Building a web app.
Windows Server & Hyper-V Containers Vaggelis Kappas
Drupal VM and Docker4Drupal as Consistent Drupal Development Platform
OPNFV Arno Installation & Validation Walk-Through
QuickBooks is a high-tech accounting software that is trusted by millions of small and mid-sized business owners across the world. However, despite being.
Introduction to Docker
Microservices in Dyalog APL Morten Kromberg – 11th January 2018
Operating System Kernel Compilation
Oracle DB and Docker Get Your Dockerized Oracle Sandbox Running in the Cloud or On- Premises Martin Knazovicky Dbvisit Software.
OS Virtualization.
Intro to Docker Containers and Orchestration in the Cloud
Title: Tech Training Certificate: Ace of Initiative Program
OPS235: Week 1 Installing Linux ( Lab1: Investigations 1-4)
How To Install CentOS 6.5 & Virtual Box
Dovetail & CVP Tutorial/Demo
Introduction to azure CLI 2.0
Getting started with CentOS Linux
Module P3 Practical: Building a webapp in nodejs and
How To Install CentOS 6.5 & Virtual Box
bitcurator-access-webtools Quick Start Guide
Introduction to Docker
Testing inside of Kubernetes and Openshift
OpenShift as a cloud for Data Science
Architecture Agnostic Docker Build Systems
OpenStack Summit Berlin – November 14, 2018
Azure Container Service
Presentation transcript:

Openshift for Beginners: Demo on building and deploying application from scratch with in Openshift

Download the PPT and code from github as below # git clone https://github.com/kiranpampana/kiran-app.git Our application is a telephone directory which displays username/country and phone number . Application has 2 parts 1) Web app built using Python and Flask framework 2)MYSQL database holds user data that is being used by web app MYSQL DATABASE WEBAPP

Pages displayed by the app First page is a Welcome page with information Second page is displaying details accessed from a mysql database

We need to know about containers/pods. But why ? Pods are the basic building blocks of Openshift. Pod is a group of one or more containers. What are containers ? Lets find out why we need containers and understand them by comparing with Virtual machines , as VM’s are well understood

HARDWARE (CPU/RAM/DISK) TRADITIONAL PHYSICAL MACHINE HARDWARE (CPU/RAM/DISK) OPERATING SYSTEM USER SPACE DB1 APP1 APP2 APP3 KERNEL SPACE

What are the problems with traditional system ?

HARDWARE (CPU/RAM/DISK) Security, as files of one app can be viewed by another app owner Resource exploitation by any app If an app needs reboot , it impacts other apps as well ………………. ……….. ... PHYSICAL MACHINE HARDWARE (CPU/RAM/DISK) OPERATING SYSTEM USER SPACE APP1 APP2 APP3 KERNEL SPACE

In-order to address problems with traditional system we need Physical or Logical separation between applications

Virtualization and containerization provide logical separation for Applications

HARDWARE (CPU/RAM/DISK) HARDWARE (CPU/RAM/DISK) HYPERVISOR KERNEL VIRTUALIZATION CONTAINERIZATION PHYSICAL MACHINE PHYSICAL MACHINE HARDWARE (CPU/RAM/DISK) HARDWARE (CPU/RAM/DISK) HYPERVISOR KERNEL OPERATING SYSTEM VIRTUAL HW1 VIRTUAL HW2 VM1 OS VM2 OS CONTAINER 1 CONTAINER 2 USER SPACE2 USER SPACE1 APP1 APP2 USER SPACE1 USER SPACE2 APP1 APP2 VM1 KERNEL VM2 KERNEL KERNEL

Containerization Virtualization Are about virtualizing the operating system subsystems(Network,Filesystems,Process…) Based on emulating Hardware or are about virtualizing hardware Single kernel Multiple kernels Initially embraced by service providers Initially embraced by enterprises Under resource crunch containers are stable then VMs as only one kernel tries to solve problem Under resource crunch VM's running on hypervisors are unstable as one+ kernels start to solve the same problem Lightness makes them far more dense and elastic Less elasticity and density

We need to know about docker. But why We need to know about docker . But why ? Docker is a tool for managing containers .Rkt is similar tool like docker . Openshift uses docker

HARDWARE (CPU/RAM/DISK) PHYSICAL MACHINE HARDWARE (CPU/RAM/DISK) OPERATING SYSTEM CONTAINER 1 CONTAINER 2 USER SPACE 2 USER SPACE 1 DOCKER APP2 APP1 KERNEL

Demo is consisting of 3 parts Part 1: Deploy application on a Machine Part 2 :Deploy application with in Containers Part 3: Deploy application with in Openshift

Part 1: Deploy application on a Machine Application can be depicted as below CENTOS 7 VM/ IP_ADDR = 192.168.121.9 WEB-APP MYSQL DB

Centos 7 VM ,running on Oracle virtualbox Setup Details Centos 7 VM ,running on Oracle virtualbox Software’s to be installed are python,flask, flask_mysqldb,mysql,mysql- server,git Installation commands for reference (should have internet access) : yum install -y epel-release python python-devel mysql-devel redhat-rpm-config gcc git wget wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm rpm -ivh mysql57-community-release-el7-9.noarch.rpm yum install -y mysql-server python-pip pip install flask pip install flask_mysqldb systemctl start mysqld systemctl disable firewalld systemctl stop firewalld cat /var/log/mysqld.log |grep "temporary password" |awk '{print $11}' > /var/tmp/mysql-passwd mysql -u root -p`cat /var/tmp/mysql-passwd` ALTER USER 'root'@'localhost' IDENTIFIED BY 'HardPassword*1'; uninstall plugin validate_password; ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; exit;

Upload data to the database : Mysql server should already be running , connect to the mysql as below , then create database/table and upload data mysql -u root –p CREATE DATABASE tel_dir; use tel_dir; CREATE TABLE details( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(100) NOT NULL, country VARCHAR(40) NOT NULL, phone INT NOT NULL, PRIMARY KEY(id)); INSERT INTO details (id,name,country,phone) VALUES (1,"kiran","india",12345); (name,country,phone) ("bart","belgium",34567);

Download application code from github as below git clone https://github.com/kiranpampana/kiran-app.git Running above would download code to directory kiran-app, go to directory kiran- app/app and check the code in app.py cd kiran-app/app cat app.py Now run the application as below python app.py localhost Connect to web browser and check both the links below, ensure no firewalls are blocking (ip address of my centos7 vm is 192.168.121.9 , you have to use the ip of your VM) http://192.168.121.9:5000 http://192.168.121.9:5000/tel_dir

Part 2 :Deploy application with in Containers Application can be depicted as below CENTOS 7 VM /(IP_ADDR = 192.168.121.9) APP CONTAINER DOCKER DB CONTAINER

Centos 7 VM ,running on Oracle virtualbox (same as the earlier one) Setup Details Centos 7 VM ,running on Oracle virtualbox (same as the earlier one) Install docker and start it yum install –y docker systemctl enable docker systemctl start docker

Create and Start database container as below docker run -itd --name db -e MYSQL_ROOT_PASSWORD=password mysql Connect to container docker exec –it db bash

connect to the mysql as below , then create database/table and upload data mysql -u root –p CREATE DATABASE tel_dir; use tel_dir; CREATE TABLE details( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(100) NOT NULL, country VARCHAR(40) NOT NULL, phone INT NOT NULL, PRIMARY KEY(id)); INSERT INTO details (id,name,country,phone) VALUES (1,"kiran","india",12345); (name,country,phone) ("bart","belgium",34567);

Go to directory having earlier downloaded kiran-app git repository ,it should have Dockerfile ,verify that file # cd ~/kiran-app # cat Dockerfile Build the docker image as below using Dockerfile # docker build -t kiranpampana/kiran-app . Upload the docker image having the app to the dockerhub for later use # docker login # docker push kiranpampana/kiran-app Start the app container using IP of db container as below #docker inspect db |grep "IPAddress" "SecondaryIPAddresses": null, "IPAddress": "172.17.0.2", # docker run -itd -p 63317:5000 --name app -e MYSQL_HOST=172.17.0.2 kiranpampana/kiran-app Connect to web browser and check both the links below, ensure no firewalls are blocking (ip address of my centos7 vm is 192.168.121.9 , you have to use the ip of your VM) http://192.168.121.9:63317 http://192.168.121.9:63317/tel_dir

Part 3 : Deploy application in openshift Setup Details Openshift Origin 1.5.1 installed on centos 7 machines (google cloud) Openshift cluster has 1 master and 2 minion nodes. Openshift cluster o-master o-node1 o-node2

Application in openshift can be depicted as below Pod  Pod is a group of ONE or more containers Internet route (HA PROXY/LOAD BALANCER) service (Internal proxy/load balancer) Pod1 Pod2

Login into o-master and download git as below git clone https://github.com/kiranpampana/kiran-app.git Running above would download code to directory kiran-app, go to directory kiran-app/ and check , you should various yaml files We shall deploy the app now Check kiran-app.yaml file and try to understand its contents Lets deploy application as below oc create -f kiran-app.yaml Check using below commands, pod with kiran-app should have been created oc get pods We shall create the service now for the app Check kiran-svc.yaml file and try to understand its contents Let create the services as below oc create -f kiran-svc.yaml Check using below commands , new service with name kiran-app should have been created oc get svc

We shall create a route for the kiran-app service as below oc expose svc kiran-app Check the new route created as below oc get route Use the route obtained above to access the app , for my case its http://kiran-app-my-test.apps.kiran-pampana.tk Try to access http://kiran-app-my-test.apps.kiran-pampana.tk/tel_dir ,it should through error because db is not yet created

Route kiran-app-my-test.apps.kiran-pampana.tk (oc expose svc kiran-app) Service kiran-app (oc create –f kiran-svc.yaml) Mysql db Pod kiran-app**** (oc create –f kiran-app.yaml)

We shall deploy the db now Check mysql-db We shall deploy the db now Check mysql-db.yaml file and try to understand its contents Lets deploy application as below oc create -f mysql-db.yaml Check using below commands, pod with mysql-** should have been created oc get pods We shall create the service now for the app Check mysql-svc.yaml file and try to understand its contents Let create the services as below oc create -f mysql-svc.yaml Check using below commands , new service with name mysql should have been created oc get svc

Connect to the mysql pod as below after by identifying it oc get pods oc rsh mysql-*** Connect to database and upload data as below mysql -u root –p CREATE DATABASE tel_dir; use tel_dir; CREATE TABLE details( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(100) NOT NULL, country VARCHAR(40) NOT NULL, phone INT NOT NULL, PRIMARY KEY(id)); INSERT INTO details (id,name,country,phone) VALUES (1,"kiran","india",12345); (name,country,phone) ("bart","belgium",34567);

Route kiran-app-my-test.apps.kiran-pampana.tk Try to access http://kiran-app-my-test.apps.kiran-pampana.tk/tel_dir ,it should work Route kiran-app-my-test.apps.kiran-pampana.tk (oc expose svc kiran-app) Pod mysql-**** (oc create –f mysql-db.yaml) Service kiran-app (oc create –f kiran-svc.yaml) Pod kiran-app**** (oc create –f kiran-app.yaml) Service mysql (oc create –f mysql-svc.yaml)

Thank you