SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
FRONT MATTER:
NEXT LEVEL FRONT END
DEPLOYMENTS ON OPENSHIFT
Red Hat MSA Day, Atlanta
Lance Ball
Principal Software Engineer
January 17, 2019
INSERT DESIGNATOR, IF NEEDED
Did You Know?
2
Number one deployment runtime
on OpenShift Online is Node.js
● But they’re not all actually
Node.js applications
● Many deployments are
Single Page Applications
● How are these applications
being deployed?
● What tools can I use in my
workflow?
INSERT DESIGNATOR, IF NEEDED
A Quick Poll
3
● Do you deploy apps on
OpenShift today?
● Do you write Node apps?
● Do you write Single Page
Applications?
● Anyone here “full stack”?
● What about DevOps?
Let’s Build a Web App!
INSERT DESIGNATOR, IF NEEDED
Create a React App
$ npx create-react-app mywebapp
$ cd mywebapp
# Edit package.json and add PORT=8080 to start script
$ npm start
# Edit App.js and watch it reload
5
INSERT DESIGNATOR, IF NEEDED6
OK - Let’s Deploy It!
INSERT DESIGNATOR, IF NEEDED7
But How?
OpenShift templates maybe...
INSERT DESIGNATOR, IF NEEDED
Two Thorns and a Rose
8
OpenShift builds pull from Git repo
Not ideal for iterative development
Must maintain compiled artifacts in Git repo
The “build” for a web server image expects static content
Served by a real HTTP server
We can use Apache or Nginx and don’t depend on a React Node.js server
nodeshift
INSERT DESIGNATOR, IF NEEDED
So, what’s nodeshift?
10
An npm module for deploying Node apps on OpenShift
Creates, builds, routes and deploys your app in one command
Great for local development environments
Deploys directly from the file system
Layered application images via s2i
Overlays application on a base image, creating a new application image
INSERT DESIGNATOR, IF NEEDED11
A brief aside… s2i
INSERT DESIGNATOR, IF NEEDED
One Line Deployment
npx nodeshift --strictSSL=false
--dockerImage=nodeshift/centos7-s2i-web-app --imageTag=10.x
--expose --deploy.env NPM_RUN=”npm start”
12
Synchronizing Development Changes
in Real Time
INSERT DESIGNATOR, IF NEEDED
Be Sure to Run Development Server
npx nodeshift --strictSSL=false
--dockerImage=nodeshift/centos7-s2i-web-app --imageTag=10.x
--expose --deploy.env NPM_RUN=”npm start”
14
INSERT DESIGNATOR, IF NEEDED
Synchronize Changes in Development
oc rsync --no-perms=true --watch src/ <POD_NAME>:src/
15
INSERT DESIGNATOR, IF NEEDED
Two Roses and a Thorn
16
Single command deployment
Easy to integrate into a development workflow
Deploys from the local file system
No need to push small changes in development to GitHub
Serves content using the React server
Not designed for production use
Production Deployments
INSERT DESIGNATOR, IF NEEDED
Chained Builds
18
Two builds can be chained
together: one that produces the
compiled artifact, and a second
build that places that artifact in a
separate image that runs the
artifact.
INSERT DESIGNATOR, IF NEEDED19
Application Templates
INSERT DESIGNATOR, IF NEEDED
Application BuildConfig
- apiVersion: v1
kind: BuildConfig
metadata:
name: mywebapp-build
spec:
output:
to:
kind: ImageStreamTag
name: mywebapp-image:latest
source:
git:
uri: ${SOURCE_REPOSITORY_URL}
ref: ${SOURCE_REPOSITORY_REF}
contextDir: ${SOURCE_REPOSITORY_DIR}
type: Git
20
INSERT DESIGNATOR, IF NEEDED
Application BuildConfig
- apiVersion: v1
kind: BuildConfig
metadata:
name: mywebapp-build
spec:
output:
to:
kind: ImageStreamTag
name: mywebapp-image:latest
source:
git:
uri: ${SOURCE_REPOSITORY_URL}
ref: ${SOURCE_REPOSITORY_REF}
contextDir: ${SOURCE_REPOSITORY_DIR}
type: Git
21
INSERT DESIGNATOR, IF NEEDED
Application BuildConfig
- apiVersion: v1
kind: BuildConfig
metadata:
name: mywebapp-build
spec:
output:
to:
kind: ImageStreamTag
name: mywebapp-image:latest
source:
git:
uri: ${SOURCE_REPOSITORY_URL}
ref: ${SOURCE_REPOSITORY_REF}
contextDir: ${SOURCE_REPOSITORY_DIR}
type: Git
22
INSERT DESIGNATOR, IF NEEDED
Application BuildConfig (cont)
strategy:
sourceStrategy:
env:
- name: OUTPUT_DIR
value: ${OUTPUT_DIR}
from:
kind: DockerImage
name: nodeshift/centos7-s2i-web-app:10.x
incremental: true
type: Source
triggers:
- github:
secret: ${GITHUB_WEBHOOK_SECRET}
type: GitHub
23
INSERT DESIGNATOR, IF NEEDED
Application BuildConfig (cont)
strategy:
sourceStrategy:
env:
- name: OUTPUT_DIR
value: ${OUTPUT_DIR}
from:
kind: DockerImage
name: nodeshift/centos7-s2i-web-app:10.x
incremental: true
type: Source
triggers:
- github:
secret: ${GITHUB_WEBHOOK_SECRET}
type: GitHub
24
INSERT DESIGNATOR, IF NEEDED
Application Runtime BuildConfig
- apiVersion: v1
kind: BuildConfig
metadata:
name: mywebapp-runtime-build
spec:
output:
to:
kind: ImageStreamTag
name: mywebapp-runtime:latest
source:
type: Image
images:
- from:
kind: ImageStreamTag
name: mywebapp-image:latest
paths:
- destinationDir: .
sourcePath: /opt/app-root/output/.
25
INSERT DESIGNATOR, IF NEEDED
Application Runtime BuildConfig
- apiVersion: v1
kind: BuildConfig
metadata:
name: mywebapp-runtime-build
spec:
output:
to:
kind: ImageStreamTag
name: mywebapp-runtime:latest
source:
type: Image
images:
- from:
kind: ImageStreamTag
name: mywebapp-image:latest
paths:
- destinationDir: .
sourcePath: /opt/app-root/output/.
26
INSERT DESIGNATOR, IF NEEDED
Application Runtime BuildConfig
- apiVersion: v1
kind: BuildConfig
metadata:
name: mywebapp-runtime-build
spec:
output:
to:
kind: ImageStreamTag
name: mywebapp-runtime:latest
source:
type: Image
images:
- from:
kind: ImageStreamTag
name: mywebapp-image:latest
paths:
- destinationDir: .
sourcePath: /opt/app-root/output/.
27
INSERT DESIGNATOR, IF NEEDED
Application Runtime BuildConfig (cont)
strategy:
sourceStrategy:
from:
kind: ImageStreamTag
name: nginx:latest
incremental: true
type: Source
triggers:
- type: ConfigChange
- type: ImageChange
imageChange:
from:
kind: ImageStreamTag
name: mywebapp-image:latest
28
INSERT DESIGNATOR, IF NEEDED
Application Runtime BuildConfig (cont)
strategy:
sourceStrategy:
from:
kind: ImageStreamTag
name: nginx:latest
incremental: true
type: Source
triggers:
- type: ConfigChange
- type: ImageChange
imageChange:
from:
kind: ImageStreamTag
name: mywebapp-image:latest
29
INSERT DESIGNATOR, IF NEEDED
Three Roses!
30
Single command deployment in development
Easy to integrate into a development workflow
Development deploys from the local file system
No need to push small changes in development to GitHub
Served by a real HTTP server in production
We can use Apache or Nginx and don’t depend on a React Node.js server
https://openshift.com
https://launch.openshift.io
https://github.com/nodeshift/nodeshift
https://github.com/nodeshift/centos7-s2i-web-app
THANK YOU
plus.google.com/+RedHat
linkedin.com/company/red-hat
youtube.com/user/RedHatVideos
facebook.com/redhatinc
twitter.com/RedHat

Weitere ähnliche Inhalte

Was ist angesagt?

Docker dev, test & production (afas)
Docker  dev, test & production (afas)Docker  dev, test & production (afas)
Docker dev, test & production (afas)Wouter Lagerweij
 
Drone 1.0 Feature
Drone 1.0 FeatureDrone 1.0 Feature
Drone 1.0 FeatureBo-Yi Wu
 
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
Eclipse Buildship DemoCamp Hamburg (June 2015)  with additional screenshotsEclipse Buildship DemoCamp Hamburg (June 2015)  with additional screenshots
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshotssimonscholz
 
Qtws19 how-to-build-qml-app-for-webos
Qtws19 how-to-build-qml-app-for-webosQtws19 how-to-build-qml-app-for-webos
Qtws19 how-to-build-qml-app-for-weboswebOSEvangelist
 
OWASP Juice Shop 5.x and beyond
OWASP Juice Shop 5.x and beyondOWASP Juice Shop 5.x and beyond
OWASP Juice Shop 5.x and beyondBjörn Kimminich
 
Owasp Juice Shop: Achieving sustainability for open source projects
Owasp Juice Shop: Achieving sustainability for open source projectsOwasp Juice Shop: Achieving sustainability for open source projects
Owasp Juice Shop: Achieving sustainability for open source projectsBjörn Kimminich
 
GraphQL IN Golang
GraphQL IN GolangGraphQL IN Golang
GraphQL IN GolangBo-Yi Wu
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow soloviniciusban
 
Essential parts to implement own Ozone backend
Essential parts to implement own Ozone backendEssential parts to implement own Ozone backend
Essential parts to implement own Ozone backendIgalia
 
Gopenflow demo v1 (english)
Gopenflow demo v1 (english)Gopenflow demo v1 (english)
Gopenflow demo v1 (english)Hiroaki Kawai
 
Docker introduction in Hardware Company
Docker introduction in Hardware CompanyDocker introduction in Hardware Company
Docker introduction in Hardware CompanyEvan Lin
 
2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkit2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkitCocoaHeads Tricity
 
Eclipse Mars News @JUG HH
Eclipse Mars News @JUG HHEclipse Mars News @JUG HH
Eclipse Mars News @JUG HHsimonscholz
 
Embedding Chromium into AGL demo platform with WAM
Embedding Chromium into AGL demo platform with WAMEmbedding Chromium into AGL demo platform with WAM
Embedding Chromium into AGL demo platform with WAMIgalia
 
Development tools at Base
Development tools at BaseDevelopment tools at Base
Development tools at BaseDominik Kapusta
 
Serverless Preview Environments @ Boston DevOps
Serverless Preview Environments @ Boston DevOpsServerless Preview Environments @ Boston DevOps
Serverless Preview Environments @ Boston DevOpsJoseph Lust
 
Android Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyondAndroid Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyondRamon Ribeiro Rabello
 

Was ist angesagt? (20)

Cocoa pods
Cocoa podsCocoa pods
Cocoa pods
 
Docker dev, test & production (afas)
Docker  dev, test & production (afas)Docker  dev, test & production (afas)
Docker dev, test & production (afas)
 
Drone 1.0 Feature
Drone 1.0 FeatureDrone 1.0 Feature
Drone 1.0 Feature
 
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
Eclipse Buildship DemoCamp Hamburg (June 2015)  with additional screenshotsEclipse Buildship DemoCamp Hamburg (June 2015)  with additional screenshots
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
 
Qtws19 how-to-build-qml-app-for-webos
Qtws19 how-to-build-qml-app-for-webosQtws19 how-to-build-qml-app-for-webos
Qtws19 how-to-build-qml-app-for-webos
 
OWASP Juice Shop 5.x and beyond
OWASP Juice Shop 5.x and beyondOWASP Juice Shop 5.x and beyond
OWASP Juice Shop 5.x and beyond
 
Owasp Juice Shop: Achieving sustainability for open source projects
Owasp Juice Shop: Achieving sustainability for open source projectsOwasp Juice Shop: Achieving sustainability for open source projects
Owasp Juice Shop: Achieving sustainability for open source projects
 
Ci for-android-apps
Ci for-android-appsCi for-android-apps
Ci for-android-apps
 
GraphQL IN Golang
GraphQL IN GolangGraphQL IN Golang
GraphQL IN Golang
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow solo
 
Essential parts to implement own Ozone backend
Essential parts to implement own Ozone backendEssential parts to implement own Ozone backend
Essential parts to implement own Ozone backend
 
Gopenflow demo v1 (english)
Gopenflow demo v1 (english)Gopenflow demo v1 (english)
Gopenflow demo v1 (english)
 
Docker introduction in Hardware Company
Docker introduction in Hardware CompanyDocker introduction in Hardware Company
Docker introduction in Hardware Company
 
2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkit2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkit
 
Tips & Tricks for Maven Tycho
Tips & Tricks for Maven TychoTips & Tricks for Maven Tycho
Tips & Tricks for Maven Tycho
 
Eclipse Mars News @JUG HH
Eclipse Mars News @JUG HHEclipse Mars News @JUG HH
Eclipse Mars News @JUG HH
 
Embedding Chromium into AGL demo platform with WAM
Embedding Chromium into AGL demo platform with WAMEmbedding Chromium into AGL demo platform with WAM
Embedding Chromium into AGL demo platform with WAM
 
Development tools at Base
Development tools at BaseDevelopment tools at Base
Development tools at Base
 
Serverless Preview Environments @ Boston DevOps
Serverless Preview Environments @ Boston DevOpsServerless Preview Environments @ Boston DevOps
Serverless Preview Environments @ Boston DevOps
 
Android Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyondAndroid Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyond
 

Ähnlich wie Front matter: Next Level Front End Deployments on OpenShift

Fastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS AppsFastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS AppsSarath C
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)Eric D. Schabell
 
How create react app help in creating a new react applications
How create react app help in creating a new react applications How create react app help in creating a new react applications
How create react app help in creating a new react applications Concetto Labs
 
Tech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp BerlinTech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp BerlinLeanIX GmbH
 
20170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 201720170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 2017Takayoshi Tanaka
 
Cross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual StudioCross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual Studiobryan costanich
 
Introduction to node.js By Ahmed Assaf
Introduction to node.js  By Ahmed AssafIntroduction to node.js  By Ahmed Assaf
Introduction to node.js By Ahmed AssafAhmed Assaf
 
Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Microsoft
 
Analyzing Twitter with Node-RED
Analyzing Twitter with Node-RED Analyzing Twitter with Node-RED
Analyzing Twitter with Node-RED Pooja Mistry
 
Mobile development in 2020
Mobile development in 2020 Mobile development in 2020
Mobile development in 2020 Bogusz Jelinski
 
N api - node interactive 2017
N api - node interactive 2017N api - node interactive 2017
N api - node interactive 2017Michael Dawson
 
NLUUG Spring 2012 - OpenShift Primer
NLUUG Spring 2012 - OpenShift PrimerNLUUG Spring 2012 - OpenShift Primer
NLUUG Spring 2012 - OpenShift PrimerEric D. Schabell
 
Node Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.jsNode Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.jsChris Bailey
 
Haibu: dev deployment is fast and easy again
Haibu: dev deployment is fast and easy againHaibu: dev deployment is fast and easy again
Haibu: dev deployment is fast and easy againFrank Rousseau
 
Matteo Manchi - React Native for multi-platform mobile applications - Codemot...
Matteo Manchi - React Native for multi-platform mobile applications - Codemot...Matteo Manchi - React Native for multi-platform mobile applications - Codemot...
Matteo Manchi - React Native for multi-platform mobile applications - Codemot...Codemotion
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopleffen
 

Ähnlich wie Front matter: Next Level Front End Deployments on OpenShift (20)

Fastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS AppsFastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS Apps
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
 
React Native
React NativeReact Native
React Native
 
How create react app help in creating a new react applications
How create react app help in creating a new react applications How create react app help in creating a new react applications
How create react app help in creating a new react applications
 
Nativescript with angular 2
Nativescript with angular 2Nativescript with angular 2
Nativescript with angular 2
 
Tech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp BerlinTech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp Berlin
 
20170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 201720170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 2017
 
Cross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual StudioCross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual Studio
 
Introduction to node.js By Ahmed Assaf
Introduction to node.js  By Ahmed AssafIntroduction to node.js  By Ahmed Assaf
Introduction to node.js By Ahmed Assaf
 
Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015
 
Analyzing Twitter with Node-RED
Analyzing Twitter with Node-RED Analyzing Twitter with Node-RED
Analyzing Twitter with Node-RED
 
Mobile development in 2020
Mobile development in 2020 Mobile development in 2020
Mobile development in 2020
 
N api - node interactive 2017
N api - node interactive 2017N api - node interactive 2017
N api - node interactive 2017
 
NLUUG Spring 2012 - OpenShift Primer
NLUUG Spring 2012 - OpenShift PrimerNLUUG Spring 2012 - OpenShift Primer
NLUUG Spring 2012 - OpenShift Primer
 
Node Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.jsNode Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.js
 
Next Generation N-API
Next Generation N-APINext Generation N-API
Next Generation N-API
 
Haibu: dev deployment is fast and easy again
Haibu: dev deployment is fast and easy againHaibu: dev deployment is fast and easy again
Haibu: dev deployment is fast and easy again
 
Dockerizing react app
Dockerizing react appDockerizing react app
Dockerizing react app
 
Matteo Manchi - React Native for multi-platform mobile applications - Codemot...
Matteo Manchi - React Native for multi-platform mobile applications - Codemot...Matteo Manchi - React Native for multi-platform mobile applications - Codemot...
Matteo Manchi - React Native for multi-platform mobile applications - Codemot...
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
 

Kürzlich hochgeladen

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Kürzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Front matter: Next Level Front End Deployments on OpenShift

  • 1. FRONT MATTER: NEXT LEVEL FRONT END DEPLOYMENTS ON OPENSHIFT Red Hat MSA Day, Atlanta Lance Ball Principal Software Engineer January 17, 2019
  • 2. INSERT DESIGNATOR, IF NEEDED Did You Know? 2 Number one deployment runtime on OpenShift Online is Node.js ● But they’re not all actually Node.js applications ● Many deployments are Single Page Applications ● How are these applications being deployed? ● What tools can I use in my workflow?
  • 3. INSERT DESIGNATOR, IF NEEDED A Quick Poll 3 ● Do you deploy apps on OpenShift today? ● Do you write Node apps? ● Do you write Single Page Applications? ● Anyone here “full stack”? ● What about DevOps?
  • 4. Let’s Build a Web App!
  • 5. INSERT DESIGNATOR, IF NEEDED Create a React App $ npx create-react-app mywebapp $ cd mywebapp # Edit package.json and add PORT=8080 to start script $ npm start # Edit App.js and watch it reload 5
  • 6. INSERT DESIGNATOR, IF NEEDED6 OK - Let’s Deploy It!
  • 7. INSERT DESIGNATOR, IF NEEDED7 But How? OpenShift templates maybe...
  • 8. INSERT DESIGNATOR, IF NEEDED Two Thorns and a Rose 8 OpenShift builds pull from Git repo Not ideal for iterative development Must maintain compiled artifacts in Git repo The “build” for a web server image expects static content Served by a real HTTP server We can use Apache or Nginx and don’t depend on a React Node.js server
  • 10. INSERT DESIGNATOR, IF NEEDED So, what’s nodeshift? 10 An npm module for deploying Node apps on OpenShift Creates, builds, routes and deploys your app in one command Great for local development environments Deploys directly from the file system Layered application images via s2i Overlays application on a base image, creating a new application image
  • 11. INSERT DESIGNATOR, IF NEEDED11 A brief aside… s2i
  • 12. INSERT DESIGNATOR, IF NEEDED One Line Deployment npx nodeshift --strictSSL=false --dockerImage=nodeshift/centos7-s2i-web-app --imageTag=10.x --expose --deploy.env NPM_RUN=”npm start” 12
  • 14. INSERT DESIGNATOR, IF NEEDED Be Sure to Run Development Server npx nodeshift --strictSSL=false --dockerImage=nodeshift/centos7-s2i-web-app --imageTag=10.x --expose --deploy.env NPM_RUN=”npm start” 14
  • 15. INSERT DESIGNATOR, IF NEEDED Synchronize Changes in Development oc rsync --no-perms=true --watch src/ <POD_NAME>:src/ 15
  • 16. INSERT DESIGNATOR, IF NEEDED Two Roses and a Thorn 16 Single command deployment Easy to integrate into a development workflow Deploys from the local file system No need to push small changes in development to GitHub Serves content using the React server Not designed for production use
  • 18. INSERT DESIGNATOR, IF NEEDED Chained Builds 18 Two builds can be chained together: one that produces the compiled artifact, and a second build that places that artifact in a separate image that runs the artifact.
  • 19. INSERT DESIGNATOR, IF NEEDED19 Application Templates
  • 20. INSERT DESIGNATOR, IF NEEDED Application BuildConfig - apiVersion: v1 kind: BuildConfig metadata: name: mywebapp-build spec: output: to: kind: ImageStreamTag name: mywebapp-image:latest source: git: uri: ${SOURCE_REPOSITORY_URL} ref: ${SOURCE_REPOSITORY_REF} contextDir: ${SOURCE_REPOSITORY_DIR} type: Git 20
  • 21. INSERT DESIGNATOR, IF NEEDED Application BuildConfig - apiVersion: v1 kind: BuildConfig metadata: name: mywebapp-build spec: output: to: kind: ImageStreamTag name: mywebapp-image:latest source: git: uri: ${SOURCE_REPOSITORY_URL} ref: ${SOURCE_REPOSITORY_REF} contextDir: ${SOURCE_REPOSITORY_DIR} type: Git 21
  • 22. INSERT DESIGNATOR, IF NEEDED Application BuildConfig - apiVersion: v1 kind: BuildConfig metadata: name: mywebapp-build spec: output: to: kind: ImageStreamTag name: mywebapp-image:latest source: git: uri: ${SOURCE_REPOSITORY_URL} ref: ${SOURCE_REPOSITORY_REF} contextDir: ${SOURCE_REPOSITORY_DIR} type: Git 22
  • 23. INSERT DESIGNATOR, IF NEEDED Application BuildConfig (cont) strategy: sourceStrategy: env: - name: OUTPUT_DIR value: ${OUTPUT_DIR} from: kind: DockerImage name: nodeshift/centos7-s2i-web-app:10.x incremental: true type: Source triggers: - github: secret: ${GITHUB_WEBHOOK_SECRET} type: GitHub 23
  • 24. INSERT DESIGNATOR, IF NEEDED Application BuildConfig (cont) strategy: sourceStrategy: env: - name: OUTPUT_DIR value: ${OUTPUT_DIR} from: kind: DockerImage name: nodeshift/centos7-s2i-web-app:10.x incremental: true type: Source triggers: - github: secret: ${GITHUB_WEBHOOK_SECRET} type: GitHub 24
  • 25. INSERT DESIGNATOR, IF NEEDED Application Runtime BuildConfig - apiVersion: v1 kind: BuildConfig metadata: name: mywebapp-runtime-build spec: output: to: kind: ImageStreamTag name: mywebapp-runtime:latest source: type: Image images: - from: kind: ImageStreamTag name: mywebapp-image:latest paths: - destinationDir: . sourcePath: /opt/app-root/output/. 25
  • 26. INSERT DESIGNATOR, IF NEEDED Application Runtime BuildConfig - apiVersion: v1 kind: BuildConfig metadata: name: mywebapp-runtime-build spec: output: to: kind: ImageStreamTag name: mywebapp-runtime:latest source: type: Image images: - from: kind: ImageStreamTag name: mywebapp-image:latest paths: - destinationDir: . sourcePath: /opt/app-root/output/. 26
  • 27. INSERT DESIGNATOR, IF NEEDED Application Runtime BuildConfig - apiVersion: v1 kind: BuildConfig metadata: name: mywebapp-runtime-build spec: output: to: kind: ImageStreamTag name: mywebapp-runtime:latest source: type: Image images: - from: kind: ImageStreamTag name: mywebapp-image:latest paths: - destinationDir: . sourcePath: /opt/app-root/output/. 27
  • 28. INSERT DESIGNATOR, IF NEEDED Application Runtime BuildConfig (cont) strategy: sourceStrategy: from: kind: ImageStreamTag name: nginx:latest incremental: true type: Source triggers: - type: ConfigChange - type: ImageChange imageChange: from: kind: ImageStreamTag name: mywebapp-image:latest 28
  • 29. INSERT DESIGNATOR, IF NEEDED Application Runtime BuildConfig (cont) strategy: sourceStrategy: from: kind: ImageStreamTag name: nginx:latest incremental: true type: Source triggers: - type: ConfigChange - type: ImageChange imageChange: from: kind: ImageStreamTag name: mywebapp-image:latest 29
  • 30. INSERT DESIGNATOR, IF NEEDED Three Roses! 30 Single command deployment in development Easy to integrate into a development workflow Development deploys from the local file system No need to push small changes in development to GitHub Served by a real HTTP server in production We can use Apache or Nginx and don’t depend on a React Node.js server