SlideShare a Scribd company logo
1 of 49
OpenShift Enables Both Dev and Ops
Architecture
10,000ft View
OpenShift runs on your choice of infrastructure
Nodes are instances of RHEL where apps will run
App services run in docker containers on each node
Masters leverage kubernetes to orchestrate nodes / apps
Master provides authenticated API for users & clients
Master uses etcd key-value data store for persistence
Master provides scheduler for pod placement on nodes
Pod placement is determined based on defined policy
Services allow related pods to connect to each other
Management/Replication controller manages the pod lifecycle
What if a pod goes down?
OpenShift automatically recovers and deploys a new Pod
Pods can attach to shared storage for stateful services
Routing layer routes external app requests to pods
Developers access openShift via web, CLI or IDE
Installation and first contact
First contact with OpenShift 3
CREATE A NEW USER
[root@os3 ~]# htpasswd -c /etc/origin/users.htpasswd georges
LOGIN AS A USER
[root@os3 ~]# oc login
Authentication required for https://os3.mlc.dom:8443 (openshift)
Username: georges
Password:
Login successful.
You don't have any projects. You can try to create a new project, by running
$ oc new-project <projectname>
LOGIN AS AN ADMIN
[root@os3 ~]# oc login -u system:admin -n default
You have access to the following projects and can switch between them with 'oc project <projectname>':
* default (current)
* openshift
* openshift-infra
* template2
Using project "default".
First contact with Openshift 3
LOGIN AS A USER AND CREATE A NEW PROJECT
[root@os3 ~]# oc new-project georges
Now using project "georges" on server "https://os3.mlc.dom:8443".
CREATE AN APPLICATION (using a container from Docker Hub)
[root@os3 ~]# oc new-app kubernetes/guestbook
--> Found Docker image a49fe18 (15 months old) from Docker Hub for "kubernetes/guestbook"
* An image stream will be created as "guestbook:latest" that will track this image
* This image will be deployed in deployment config "guestbook"
* Port 3000/tcp will be load balanced by service "guestbook"
--> Creating resources with label app=guestbook ...
ImageStream "guestbook" created
DeploymentConfig "guestbook" created
Service "guestbook" created
--> Success
Run 'oc status' to view your app.
[root@os3 ~]# oc get pods
NAME READY STATUS RESTARTS AGE
guestbook-1-deploy 1/1 Running 0 4s
guestbook-1-t2xos 1/1 Running 0 2s
[root@os3 ~]# oc get service
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
guestbook 172.30.166.174 <none> 3000/TCP app=guestbook,deploymentconfig=guestbook 22m
First contact with Openshift 3
EXPOSE A SERVICE
[root@os3 ~]# oc expose service guestbook
route "guestbook" exposed
[root@os3 ~]# oc get route
NAME HOST/PORT PATH SERVICE LABELS INSECURE POLICY TLS TERMINATION
guestbook guestbook-georges.app.os3.mlc.dom guestbook app=guestbook
Replication Controllers (RC)
Used to specify and then ensure the desired number of Pods (replicas) are in existence
DeploymentConfiguration(DC)
Defines how something in Openshift should be deployed
[root@os3] # oc get rc
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS AGE
guestbook-1 guestbook kubernetes/guestbook@sha256:a49fe18bb57c8eee16e2002987e041f5ae9b5b70ae7b3d49eb60e5c26b9c6bd0 app=guestbook,deployment=guest
[root@os3 key]# oc get dc
NAME TRIGGERS LATEST
guestbook ConfigChange, ImageChange 1
SCALING UP
[root@os3]# oc scale --replicas=3 rc guestbook-1
replicationcontroller "guestbook-1" scaled
Source to image
SOURCE TO IMAGE EXAMPLE
[root@os3 ~]# oc new-project mlbparks
SOURCE TO IMAGE
[root@os3 ~]# oc new-app registry.access.redhat.com/jboss-eap-6/eap-openshift~https://github.com/michaellessard/openshift3mlbparks.git
[root@os3 ~]# oc get builds
NAME TYPE FROM STATUS STARTED DURATION
openshift3mlbparks-1 Source Git Running 12 seconds ago 12s
# oc build-logs openshft3mlbparks-1
…....
Downloading: https://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.5/commons-compress-1.5.jar
Downloaded: https://repo1.maven.org/maven2/org/codehaus/plexus/plexus-archiver/2.4.1/plexus-archiver-2.4.1.jar (161 KB at 1417.2 KB/sec)
Downloading: https://repo1.maven.org/maven2/org/tukaani/xz/1.2/xz-1.2.jar
Downloaded: https://repo1.maven.org/maven2/org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.jar (22 KB at 150.0 KB/sec)
…..
[root@os3 ~]# oc get pods
NAME READY STATUS RESTARTS AGE
openshift3mlbparks-1-build 0/1 Completed 0 2m
openshift3mlbparks-1-ntig9 1/1 Running 0 27s
[root@os3 ~]# oc expose service openshift3mlbparks
ENVIRONMENT VARIABLES + DC
[root@os3 ~]# oc new-app mongodb -e MONGODB_USER=mlbparks -e MONGODB_PASSWORD=mlbparks -e MONGODB_DATABASE=
[root@os3 ~]# oc get dc
NAME TRIGGERS LATEST
mongodb ConfigChange, ImageChange 1
Openshift3mlbparks ConfigChange, ImageChange 1
# oc env dc openshift3mlbparks -e MONGODB_USER=mlbparks -e MONGODB_PASSWORD=mlbparks -e MONGODB_DATABASE=mlbp
deploymentconfig "openshift3mlbparks" updated
[root@os3 ~]# oc get dc
NAME TRIGGERS LATEST
mongodb ConfigChange, ImageChange 1
openshift3mlbparks ConfigChange, ImageChange 2
DOCKER IMAGES IS NOW AVAILABLE
[root@os3 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
172.30.177.161:5000/mlbparks/openshift3mlbparks latest 80e9485fd5bb 30 minutes ago 958.9 MB
172.30.177.161:5000/mlbparks/openshift3mlbparks <none> 80e9485fd5bb 30 minutes ago 958.9 MB
Openshift31-tech.ppt
Openshift31-tech.ppt
Openshift31-tech.ppt

More Related Content

Similar to Openshift31-tech.ppt

Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Microsoft
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windowsDocker, Inc.
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developerPaul Czarkowski
 
Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2Binary Studio
 
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
2016 - Easing Your Way Into Docker: Lessons From a Journey to Productiondevopsdaysaustin
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsBen Hall
 
An intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECSAn intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECSYevgeniy Brikman
 
Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Heng-Yi Wu
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Developmentmsyukor
 
Docker in Action
Docker in ActionDocker in Action
Docker in ActionAlper Kanat
 
Openshift meetup Paris - 21/03/2018
Openshift meetup Paris - 21/03/2018Openshift meetup Paris - 21/03/2018
Openshift meetup Paris - 21/03/2018kanedafromparis
 
Build containerized application using Docker and Azure.pdf
Build containerized application using Docker and Azure.pdfBuild containerized application using Docker and Azure.pdf
Build containerized application using Docker and Azure.pdfHamida Rebai Trabelsi
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...Docker, Inc.
 
Kubernetes for Java developers
Kubernetes for Java developersKubernetes for Java developers
Kubernetes for Java developersRobert Barr
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3kognate
 
Dockercon EU 2014
Dockercon EU 2014Dockercon EU 2014
Dockercon EU 2014Rafe Colton
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby DevelopersAptible
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Ben Hall
 
Spring Into Kubernetes DFW
Spring Into Kubernetes DFWSpring Into Kubernetes DFW
Spring Into Kubernetes DFWVMware Tanzu
 
Dev with Docker WCPHX 2019
Dev with Docker WCPHX 2019Dev with Docker WCPHX 2019
Dev with Docker WCPHX 2019Maura Teal
 

Similar to Openshift31-tech.ppt (20)

Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developer
 
Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2
 
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
 
An intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECSAn intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECS
 
Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Development
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
 
Openshift meetup Paris - 21/03/2018
Openshift meetup Paris - 21/03/2018Openshift meetup Paris - 21/03/2018
Openshift meetup Paris - 21/03/2018
 
Build containerized application using Docker and Azure.pdf
Build containerized application using Docker and Azure.pdfBuild containerized application using Docker and Azure.pdf
Build containerized application using Docker and Azure.pdf
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
 
Kubernetes for Java developers
Kubernetes for Java developersKubernetes for Java developers
Kubernetes for Java developers
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3
 
Dockercon EU 2014
Dockercon EU 2014Dockercon EU 2014
Dockercon EU 2014
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby Developers
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
 
Spring Into Kubernetes DFW
Spring Into Kubernetes DFWSpring Into Kubernetes DFW
Spring Into Kubernetes DFW
 
Dev with Docker WCPHX 2019
Dev with Docker WCPHX 2019Dev with Docker WCPHX 2019
Dev with Docker WCPHX 2019
 

Recently uploaded

Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 

Recently uploaded (20)

Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 

Openshift31-tech.ppt

  • 1.
  • 3.
  • 4.
  • 7. OpenShift runs on your choice of infrastructure
  • 8. Nodes are instances of RHEL where apps will run
  • 9. App services run in docker containers on each node
  • 10.
  • 11. Masters leverage kubernetes to orchestrate nodes / apps
  • 12. Master provides authenticated API for users & clients
  • 13. Master uses etcd key-value data store for persistence
  • 14. Master provides scheduler for pod placement on nodes
  • 15. Pod placement is determined based on defined policy
  • 16. Services allow related pods to connect to each other
  • 18. What if a pod goes down?
  • 19. OpenShift automatically recovers and deploys a new Pod
  • 20. Pods can attach to shared storage for stateful services
  • 21. Routing layer routes external app requests to pods
  • 22. Developers access openShift via web, CLI or IDE
  • 23.
  • 25.
  • 26. First contact with OpenShift 3 CREATE A NEW USER [root@os3 ~]# htpasswd -c /etc/origin/users.htpasswd georges LOGIN AS A USER [root@os3 ~]# oc login Authentication required for https://os3.mlc.dom:8443 (openshift) Username: georges Password: Login successful. You don't have any projects. You can try to create a new project, by running $ oc new-project <projectname> LOGIN AS AN ADMIN [root@os3 ~]# oc login -u system:admin -n default You have access to the following projects and can switch between them with 'oc project <projectname>': * default (current) * openshift * openshift-infra * template2 Using project "default".
  • 27.
  • 28.
  • 29. First contact with Openshift 3 LOGIN AS A USER AND CREATE A NEW PROJECT [root@os3 ~]# oc new-project georges Now using project "georges" on server "https://os3.mlc.dom:8443". CREATE AN APPLICATION (using a container from Docker Hub) [root@os3 ~]# oc new-app kubernetes/guestbook --> Found Docker image a49fe18 (15 months old) from Docker Hub for "kubernetes/guestbook" * An image stream will be created as "guestbook:latest" that will track this image * This image will be deployed in deployment config "guestbook" * Port 3000/tcp will be load balanced by service "guestbook" --> Creating resources with label app=guestbook ... ImageStream "guestbook" created DeploymentConfig "guestbook" created Service "guestbook" created --> Success Run 'oc status' to view your app. [root@os3 ~]# oc get pods NAME READY STATUS RESTARTS AGE guestbook-1-deploy 1/1 Running 0 4s guestbook-1-t2xos 1/1 Running 0 2s [root@os3 ~]# oc get service NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE guestbook 172.30.166.174 <none> 3000/TCP app=guestbook,deploymentconfig=guestbook 22m
  • 30.
  • 31.
  • 32. First contact with Openshift 3 EXPOSE A SERVICE [root@os3 ~]# oc expose service guestbook route "guestbook" exposed [root@os3 ~]# oc get route NAME HOST/PORT PATH SERVICE LABELS INSECURE POLICY TLS TERMINATION guestbook guestbook-georges.app.os3.mlc.dom guestbook app=guestbook
  • 33.
  • 34.
  • 35. Replication Controllers (RC) Used to specify and then ensure the desired number of Pods (replicas) are in existence DeploymentConfiguration(DC) Defines how something in Openshift should be deployed [root@os3] # oc get rc CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS AGE guestbook-1 guestbook kubernetes/guestbook@sha256:a49fe18bb57c8eee16e2002987e041f5ae9b5b70ae7b3d49eb60e5c26b9c6bd0 app=guestbook,deployment=guest [root@os3 key]# oc get dc NAME TRIGGERS LATEST guestbook ConfigChange, ImageChange 1
  • 36. SCALING UP [root@os3]# oc scale --replicas=3 rc guestbook-1 replicationcontroller "guestbook-1" scaled
  • 37.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43. SOURCE TO IMAGE EXAMPLE [root@os3 ~]# oc new-project mlbparks SOURCE TO IMAGE [root@os3 ~]# oc new-app registry.access.redhat.com/jboss-eap-6/eap-openshift~https://github.com/michaellessard/openshift3mlbparks.git [root@os3 ~]# oc get builds NAME TYPE FROM STATUS STARTED DURATION openshift3mlbparks-1 Source Git Running 12 seconds ago 12s # oc build-logs openshft3mlbparks-1 ….... Downloading: https://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.5/commons-compress-1.5.jar Downloaded: https://repo1.maven.org/maven2/org/codehaus/plexus/plexus-archiver/2.4.1/plexus-archiver-2.4.1.jar (161 KB at 1417.2 KB/sec) Downloading: https://repo1.maven.org/maven2/org/tukaani/xz/1.2/xz-1.2.jar Downloaded: https://repo1.maven.org/maven2/org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.jar (22 KB at 150.0 KB/sec) ….. [root@os3 ~]# oc get pods NAME READY STATUS RESTARTS AGE openshift3mlbparks-1-build 0/1 Completed 0 2m openshift3mlbparks-1-ntig9 1/1 Running 0 27s [root@os3 ~]# oc expose service openshift3mlbparks
  • 44.
  • 45.
  • 46. ENVIRONMENT VARIABLES + DC [root@os3 ~]# oc new-app mongodb -e MONGODB_USER=mlbparks -e MONGODB_PASSWORD=mlbparks -e MONGODB_DATABASE= [root@os3 ~]# oc get dc NAME TRIGGERS LATEST mongodb ConfigChange, ImageChange 1 Openshift3mlbparks ConfigChange, ImageChange 1 # oc env dc openshift3mlbparks -e MONGODB_USER=mlbparks -e MONGODB_PASSWORD=mlbparks -e MONGODB_DATABASE=mlbp deploymentconfig "openshift3mlbparks" updated [root@os3 ~]# oc get dc NAME TRIGGERS LATEST mongodb ConfigChange, ImageChange 1 openshift3mlbparks ConfigChange, ImageChange 2 DOCKER IMAGES IS NOW AVAILABLE [root@os3 ~]# docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE 172.30.177.161:5000/mlbparks/openshift3mlbparks latest 80e9485fd5bb 30 minutes ago 958.9 MB 172.30.177.161:5000/mlbparks/openshift3mlbparks <none> 80e9485fd5bb 30 minutes ago 958.9 MB