SlideShare a Scribd company logo
1 of 19
Download to read offline
CONFIDENTIAL Designator
1
CI/CDwithOCP/OKD
Cloud Native CI/CD
with OpenShift
Build CI/CD workflows with OpenShift
Container Platform
Dmitry Kartsev
Senior OpenShift consultant (AppDev/DevOps)
dkartsev@redhat.com
https://github.com/dimss
CONFIDENTIAL Designator
The Journey
CONFIDENTIAL Designator
3
The Presale
CONFIDENTIAL Designator
4
The Postsale
CONFIDENTIAL Designator
5
The Jenkins
CONFIDENTIAL Designator
6
With great power comes
great responsibility
Peter Parker, aka Spiderman
CONFIDENTIAL Designator
Technology
CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE
8
DevOps tooling in OpenShift
ImageStream
BuildConfig
DeploymentConfig
CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE
9
ImageStream
An ImageStream and its associated tags
provide an abstraction for referencing
container images from within OpenShift
Container Platform
An ImageStreamTag is a named pointer to
an image in an imagestream. An image
stream tag is similar to a container image
tag.
An ImageStream trigger causes a specific
action when an ImagesStreamTag changes.
For example, trigger Deployments or
Builds on new image import
Source:
https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#timeouts
https://docs.openshift.com/container-platform/4.2/openshift_images/image-streams-manage.html#managing-image-streams
CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE
10
BuildConfig types
Docker build
Source-to-Image (S2I) build
Custom build
Pipeline build
Source:
https://docs.openshift.com/container-platform/4.2/builds/understanding-image-builds.html
CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE
11
BuildConfig - Docker build
Source:
https://docs.openshift.com/container-platform/4.2/builds/understanding-image-builds.html#builds-strategy-docker-build_understanding-image-builds
The Docker build strategy invokes the
docker build command, and it expects a
repository with a Dockerfile and all
required artifacts in it to produce a
runnable image.
CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE
12
BuildConfig - S2I build
Source:
https://docs.openshift.com/container-platform/4.2/builds/understanding-image-builds.html#build-strategy-s2i_understanding-image-builds
Source-to-Image (S2I) is a tool for building
reproducible, Docker-formatted container images. It
produces ready-to-run images by injecting application
source into a container image and assembling a new
image.
#!/bin/bash
# S2I Assemble script
ls -all /tmp/src/
cd /tmp/src/
tar zxvf node_modules.tar.gz
npm install -g serve
npm run-script build
#!/bin/bash
# S2I Run script
cp -R /tmp/src/build /tmp/build
cd /tmp/build && sed -i "s~__API_URL__~${API_URL}~g" index.html && serve -l 3000 -s
CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE
13
BuildConfig - Custom build
Source:
https://docs.openshift.com/container-platform/4.2/builds/understanding-image-builds.html#build-strategy-custom-build_understanding-image-builds
The Custom build strategy allows developers to define
a specific builder image responsible for the entire
build process. Using your own builder image allows
you to customize your build process.
#!/bin/bash
echo "---> Starting custom build . . ."
SRC_DIR=$(pwd)/src
OCP_DIR=${SRC_DIR}/ocp
# Clone the source code
git clone ${SOURCE_URI} ${SRC_DIR}
cd ${OCP_DIR}
# Start build
oc start-build -F ${BUILD_CONFIG_NAME} -n ${PROJECT}
….
CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE
14
BuildConfig - Pipeline build
Source:
https://docs.openshift.com/container-platform/4.2/builds/understanding-image-builds.html#builds-strategy-pipeline-build_understanding-image-builds
The Pipeline build strategy allows developers to define a
Jenkins pipeline for execution by the Jenkins pipeline
plugin. The build can be started, monitored, and managed
by OpenShift in the same way as any other build type.
// Jenkinsfile
pipeline {
agent {
node {
label 'maven'
}
}
stages {
stage("Run unit tests") {
steps {
script {
openshift.withCluster() {
openshift.withProject() {
echo "Hello from ${openshift.cluster()}'s default project: ${openshift.project()}"
}
}
}
}
}
...
CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE
15
BuildConfig - Triggers
Source:
https://docs.openshift.com/container-platform/4.2/builds/triggering-builds-build-hooks.html#builds-configuration-change-triggers_triggering-builds-build-hooks
When defining a BuildConfig, you can define triggers to
control the circumstances in which the BuildConfig
should be run. The following build triggers are available:
Webhook, Image change or Configuration change
CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE
16
DeploymentConfig
Source:
https://docs.openshift.com/container-platform/4.2/applications/deployments/what-deployments-are.html#deployments-and-deploymentconfigs_what-deployments-are
Building on ReplicationControllers, OpenShift Container Platform adds expanded
support for the software development and deployment lifecycle with the concept
of DeploymentConfigs. In the simplest case, a DeploymentConfig creates a new
ReplicationController and lets it start up Pods.
However, OpenShift Container Platform deployments from DeploymentConfigs
also provide the ability to transition from an existing deployment of an image to a
new one and also define hooks to be run before or after creating the
ReplicationController.
CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE
17
Summary
Source:
https://docs.openshift.com/container-platform/4.2/applications/deployments/what-deployments-are.html#deployments-and-deploymentconfigs_what-deployments-are
CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE
18
CONFIDENTIAL Designator
linkedin.com/company/red-hat
youtube.com/user/RedHatVideos
facebook.com/redhatinc
twitter.com/RedHat
Red Hat is the world’s leading provider of enterprise
open source software solutions. Award-winning
support, training, and consulting services make
Red Hat a trusted adviser to the Fortune 500.
Thank you
19

More Related Content

What's hot

Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Annie Huang
 
Eclipse Che: The Next-Gen Eclipse IDE - Bordeaux jug 2016
Eclipse Che: The Next-Gen Eclipse IDE - Bordeaux jug 2016Eclipse Che: The Next-Gen Eclipse IDE - Bordeaux jug 2016
Eclipse Che: The Next-Gen Eclipse IDE - Bordeaux jug 2016Florent BENOIT
 
Extending Eclipse Che to build custom Cloud IDEs
Extending Eclipse Che to build custom Cloud IDEsExtending Eclipse Che to build custom Cloud IDEs
Extending Eclipse Che to build custom Cloud IDEsFlorent BENOIT
 
Continuous Delivery - FIT VUT
Continuous Delivery - FIT VUTContinuous Delivery - FIT VUT
Continuous Delivery - FIT VUTJuraj Michálek
 
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDEAn Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDEKubeAcademy
 
CDK 2.0: Docker, Kubernetes, And OSE On Your Desk (Langdon White)
CDK 2.0: Docker, Kubernetes, And OSE On Your Desk (Langdon White)CDK 2.0: Docker, Kubernetes, And OSE On Your Desk (Langdon White)
CDK 2.0: Docker, Kubernetes, And OSE On Your Desk (Langdon White)Red Hat Developers
 
Red Hat OpenShift App Dev meetup - Operator SDK
Red Hat OpenShift App Dev meetup - Operator SDK Red Hat OpenShift App Dev meetup - Operator SDK
Red Hat OpenShift App Dev meetup - Operator SDK Dmitry Kartsev
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'acorehard_by
 
Front matter: Next Level Front End Deployments on OpenShift
Front matter: Next Level Front End Deployments on OpenShiftFront matter: Next Level Front End Deployments on OpenShift
Front matter: Next Level Front End Deployments on OpenShiftLance Ball
 
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...Puppet
 
Continuous Deployment with Kubernetes, Docker and GitLab CI
Continuous Deployment with Kubernetes, Docker and GitLab CIContinuous Deployment with Kubernetes, Docker and GitLab CI
Continuous Deployment with Kubernetes, Docker and GitLab CIalexanderkiel
 
Gitlab - Creating C++ applications with Gitlab CI
Gitlab - Creating C++ applications with Gitlab CIGitlab - Creating C++ applications with Gitlab CI
Gitlab - Creating C++ applications with Gitlab CIUilian Ries
 
Gorush: A push notification server written in Go
Gorush: A push notification server written in GoGorush: A push notification server written in Go
Gorush: A push notification server written in GoBo-Yi Wu
 
Reproducible development to live applications with Red Hat CDK and Red Hat Op...
Reproducible development to live applications with Red Hat CDK and Red Hat Op...Reproducible development to live applications with Red Hat CDK and Red Hat Op...
Reproducible development to live applications with Red Hat CDK and Red Hat Op...Lalatendu Mohanty
 
Getting started with the NDK
Getting started with the NDKGetting started with the NDK
Getting started with the NDKKirill Kounik
 
Eclipse Che and Artik IDE
Eclipse Che and Artik IDEEclipse Che and Artik IDE
Eclipse Che and Artik IDEFlorent BENOIT
 
Eclipse Che : ParisJUG
Eclipse Che : ParisJUGEclipse Che : ParisJUG
Eclipse Che : ParisJUGFlorent BENOIT
 
GDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWSGDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWSLadislav Prskavec
 

What's hot (20)

Docker
DockerDocker
Docker
 
Workshop - Golang language
Workshop - Golang languageWorkshop - Golang language
Workshop - Golang language
 
Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD
 
Eclipse Che: The Next-Gen Eclipse IDE - Bordeaux jug 2016
Eclipse Che: The Next-Gen Eclipse IDE - Bordeaux jug 2016Eclipse Che: The Next-Gen Eclipse IDE - Bordeaux jug 2016
Eclipse Che: The Next-Gen Eclipse IDE - Bordeaux jug 2016
 
Extending Eclipse Che to build custom Cloud IDEs
Extending Eclipse Che to build custom Cloud IDEsExtending Eclipse Che to build custom Cloud IDEs
Extending Eclipse Che to build custom Cloud IDEs
 
Continuous Delivery - FIT VUT
Continuous Delivery - FIT VUTContinuous Delivery - FIT VUT
Continuous Delivery - FIT VUT
 
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDEAn Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
An Introduction to Eclipse Che - Next-Gen Eclipse Java IDE
 
CDK 2.0: Docker, Kubernetes, And OSE On Your Desk (Langdon White)
CDK 2.0: Docker, Kubernetes, And OSE On Your Desk (Langdon White)CDK 2.0: Docker, Kubernetes, And OSE On Your Desk (Langdon White)
CDK 2.0: Docker, Kubernetes, And OSE On Your Desk (Langdon White)
 
Red Hat OpenShift App Dev meetup - Operator SDK
Red Hat OpenShift App Dev meetup - Operator SDK Red Hat OpenShift App Dev meetup - Operator SDK
Red Hat OpenShift App Dev meetup - Operator SDK
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
Front matter: Next Level Front End Deployments on OpenShift
Front matter: Next Level Front End Deployments on OpenShiftFront matter: Next Level Front End Deployments on OpenShift
Front matter: Next Level Front End Deployments on OpenShift
 
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
 
Continuous Deployment with Kubernetes, Docker and GitLab CI
Continuous Deployment with Kubernetes, Docker and GitLab CIContinuous Deployment with Kubernetes, Docker and GitLab CI
Continuous Deployment with Kubernetes, Docker and GitLab CI
 
Gitlab - Creating C++ applications with Gitlab CI
Gitlab - Creating C++ applications with Gitlab CIGitlab - Creating C++ applications with Gitlab CI
Gitlab - Creating C++ applications with Gitlab CI
 
Gorush: A push notification server written in Go
Gorush: A push notification server written in GoGorush: A push notification server written in Go
Gorush: A push notification server written in Go
 
Reproducible development to live applications with Red Hat CDK and Red Hat Op...
Reproducible development to live applications with Red Hat CDK and Red Hat Op...Reproducible development to live applications with Red Hat CDK and Red Hat Op...
Reproducible development to live applications with Red Hat CDK and Red Hat Op...
 
Getting started with the NDK
Getting started with the NDKGetting started with the NDK
Getting started with the NDK
 
Eclipse Che and Artik IDE
Eclipse Che and Artik IDEEclipse Che and Artik IDE
Eclipse Che and Artik IDE
 
Eclipse Che : ParisJUG
Eclipse Che : ParisJUGEclipse Che : ParisJUG
Eclipse Che : ParisJUG
 
GDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWSGDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWS
 

Similar to CI/CD with OCP

20170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 201720170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 2017Takayoshi Tanaka
 
Production sec ops with kubernetes in docker
Production sec ops with kubernetes in dockerProduction sec ops with kubernetes in docker
Production sec ops with kubernetes in dockerDocker, Inc.
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안양재동 코드랩
 
Serverless Container with Source2Image
Serverless Container with Source2ImageServerless Container with Source2Image
Serverless Container with Source2ImageQAware GmbH
 
Serverless containers … with source-to-image
Serverless containers  … with source-to-imageServerless containers  … with source-to-image
Serverless containers … with source-to-imageJosef Adersberger
 
Red Hat and kubernetes: awesome stuff coming your way
Red Hat and kubernetes:  awesome stuff coming your wayRed Hat and kubernetes:  awesome stuff coming your way
Red Hat and kubernetes: awesome stuff coming your wayJohannes Brännström
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandTroublemaker Khunpech
 
OPENSHIFT CONTAINER PLATFORM CI/CD Build & Deploy
OPENSHIFT CONTAINER PLATFORM CI/CD Build & DeployOPENSHIFT CONTAINER PLATFORM CI/CD Build & Deploy
OPENSHIFT CONTAINER PLATFORM CI/CD Build & DeployNatale Vinto
 
Developing and deploying applications with Spring Boot and Docker (@oakjug)
Developing and deploying applications with Spring Boot and Docker (@oakjug)Developing and deploying applications with Spring Boot and Docker (@oakjug)
Developing and deploying applications with Spring Boot and Docker (@oakjug)Chris Richardson
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDocker, Inc.
 
A local private PaaS in minutes with the Red Hat CDK
A local private PaaS in minutes with the Red Hat CDKA local private PaaS in minutes with the Red Hat CDK
A local private PaaS in minutes with the Red Hat CDKEric D. Schabell
 
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...Docker, Inc.
 
Docker - Der Wal in der Kiste
Docker - Der Wal in der KisteDocker - Der Wal in der Kiste
Docker - Der Wal in der KisteUlrich Krause
 
Microservices DevOps on Google Cloud Platform
Microservices DevOps on Google Cloud PlatformMicroservices DevOps on Google Cloud Platform
Microservices DevOps on Google Cloud PlatformSunnyvale
 
SwissJUG_Bringing the cloud back down to earth.pptx
SwissJUG_Bringing the cloud back down to earth.pptxSwissJUG_Bringing the cloud back down to earth.pptx
SwissJUG_Bringing the cloud back down to earth.pptxGrace Jansen
 
Pipeline: Continuous Delivery as Code in Jenkins 2.0
Pipeline: Continuous Delivery as Code in Jenkins 2.0Pipeline: Continuous Delivery as Code in Jenkins 2.0
Pipeline: Continuous Delivery as Code in Jenkins 2.0Jules Pierre-Louis
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins UsersJules Pierre-Louis
 
PittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earth
PittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earthPittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earth
PittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earthGrace Jansen
 
Designing Your Best Architectural Diagrams
Designing Your Best Architectural DiagramsDesigning Your Best Architectural Diagrams
Designing Your Best Architectural DiagramsEric D. Schabell
 
Docker, a new LINUX container technology based light weight virtualization
Docker, a new LINUX container technology based light weight virtualizationDocker, a new LINUX container technology based light weight virtualization
Docker, a new LINUX container technology based light weight virtualizationSuresh Balla
 

Similar to CI/CD with OCP (20)

20170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 201720170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 2017
 
Production sec ops with kubernetes in docker
Production sec ops with kubernetes in dockerProduction sec ops with kubernetes in docker
Production sec ops with kubernetes in docker
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안
 
Serverless Container with Source2Image
Serverless Container with Source2ImageServerless Container with Source2Image
Serverless Container with Source2Image
 
Serverless containers … with source-to-image
Serverless containers  … with source-to-imageServerless containers  … with source-to-image
Serverless containers … with source-to-image
 
Red Hat and kubernetes: awesome stuff coming your way
Red Hat and kubernetes:  awesome stuff coming your wayRed Hat and kubernetes:  awesome stuff coming your way
Red Hat and kubernetes: awesome stuff coming your way
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
 
OPENSHIFT CONTAINER PLATFORM CI/CD Build & Deploy
OPENSHIFT CONTAINER PLATFORM CI/CD Build & DeployOPENSHIFT CONTAINER PLATFORM CI/CD Build & Deploy
OPENSHIFT CONTAINER PLATFORM CI/CD Build & Deploy
 
Developing and deploying applications with Spring Boot and Docker (@oakjug)
Developing and deploying applications with Spring Boot and Docker (@oakjug)Developing and deploying applications with Spring Boot and Docker (@oakjug)
Developing and deploying applications with Spring Boot and Docker (@oakjug)
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 
A local private PaaS in minutes with the Red Hat CDK
A local private PaaS in minutes with the Red Hat CDKA local private PaaS in minutes with the Red Hat CDK
A local private PaaS in minutes with the Red Hat CDK
 
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
 
Docker - Der Wal in der Kiste
Docker - Der Wal in der KisteDocker - Der Wal in der Kiste
Docker - Der Wal in der Kiste
 
Microservices DevOps on Google Cloud Platform
Microservices DevOps on Google Cloud PlatformMicroservices DevOps on Google Cloud Platform
Microservices DevOps on Google Cloud Platform
 
SwissJUG_Bringing the cloud back down to earth.pptx
SwissJUG_Bringing the cloud back down to earth.pptxSwissJUG_Bringing the cloud back down to earth.pptx
SwissJUG_Bringing the cloud back down to earth.pptx
 
Pipeline: Continuous Delivery as Code in Jenkins 2.0
Pipeline: Continuous Delivery as Code in Jenkins 2.0Pipeline: Continuous Delivery as Code in Jenkins 2.0
Pipeline: Continuous Delivery as Code in Jenkins 2.0
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
PittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earth
PittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earthPittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earth
PittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earth
 
Designing Your Best Architectural Diagrams
Designing Your Best Architectural DiagramsDesigning Your Best Architectural Diagrams
Designing Your Best Architectural Diagrams
 
Docker, a new LINUX container technology based light weight virtualization
Docker, a new LINUX container technology based light weight virtualizationDocker, a new LINUX container technology based light weight virtualization
Docker, a new LINUX container technology based light weight virtualization
 

Recently uploaded

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

CI/CD with OCP

  • 1. CONFIDENTIAL Designator 1 CI/CDwithOCP/OKD Cloud Native CI/CD with OpenShift Build CI/CD workflows with OpenShift Container Platform Dmitry Kartsev Senior OpenShift consultant (AppDev/DevOps) dkartsev@redhat.com https://github.com/dimss
  • 6. CONFIDENTIAL Designator 6 With great power comes great responsibility Peter Parker, aka Spiderman
  • 8. CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE 8 DevOps tooling in OpenShift ImageStream BuildConfig DeploymentConfig
  • 9. CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE 9 ImageStream An ImageStream and its associated tags provide an abstraction for referencing container images from within OpenShift Container Platform An ImageStreamTag is a named pointer to an image in an imagestream. An image stream tag is similar to a container image tag. An ImageStream trigger causes a specific action when an ImagesStreamTag changes. For example, trigger Deployments or Builds on new image import Source: https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#timeouts https://docs.openshift.com/container-platform/4.2/openshift_images/image-streams-manage.html#managing-image-streams
  • 10. CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE 10 BuildConfig types Docker build Source-to-Image (S2I) build Custom build Pipeline build Source: https://docs.openshift.com/container-platform/4.2/builds/understanding-image-builds.html
  • 11. CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE 11 BuildConfig - Docker build Source: https://docs.openshift.com/container-platform/4.2/builds/understanding-image-builds.html#builds-strategy-docker-build_understanding-image-builds The Docker build strategy invokes the docker build command, and it expects a repository with a Dockerfile and all required artifacts in it to produce a runnable image.
  • 12. CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE 12 BuildConfig - S2I build Source: https://docs.openshift.com/container-platform/4.2/builds/understanding-image-builds.html#build-strategy-s2i_understanding-image-builds Source-to-Image (S2I) is a tool for building reproducible, Docker-formatted container images. It produces ready-to-run images by injecting application source into a container image and assembling a new image. #!/bin/bash # S2I Assemble script ls -all /tmp/src/ cd /tmp/src/ tar zxvf node_modules.tar.gz npm install -g serve npm run-script build #!/bin/bash # S2I Run script cp -R /tmp/src/build /tmp/build cd /tmp/build && sed -i "s~__API_URL__~${API_URL}~g" index.html && serve -l 3000 -s
  • 13. CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE 13 BuildConfig - Custom build Source: https://docs.openshift.com/container-platform/4.2/builds/understanding-image-builds.html#build-strategy-custom-build_understanding-image-builds The Custom build strategy allows developers to define a specific builder image responsible for the entire build process. Using your own builder image allows you to customize your build process. #!/bin/bash echo "---> Starting custom build . . ." SRC_DIR=$(pwd)/src OCP_DIR=${SRC_DIR}/ocp # Clone the source code git clone ${SOURCE_URI} ${SRC_DIR} cd ${OCP_DIR} # Start build oc start-build -F ${BUILD_CONFIG_NAME} -n ${PROJECT} ….
  • 14. CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE 14 BuildConfig - Pipeline build Source: https://docs.openshift.com/container-platform/4.2/builds/understanding-image-builds.html#builds-strategy-pipeline-build_understanding-image-builds The Pipeline build strategy allows developers to define a Jenkins pipeline for execution by the Jenkins pipeline plugin. The build can be started, monitored, and managed by OpenShift in the same way as any other build type. // Jenkinsfile pipeline { agent { node { label 'maven' } } stages { stage("Run unit tests") { steps { script { openshift.withCluster() { openshift.withProject() { echo "Hello from ${openshift.cluster()}'s default project: ${openshift.project()}" } } } } } ...
  • 15. CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE 15 BuildConfig - Triggers Source: https://docs.openshift.com/container-platform/4.2/builds/triggering-builds-build-hooks.html#builds-configuration-change-triggers_triggering-builds-build-hooks When defining a BuildConfig, you can define triggers to control the circumstances in which the BuildConfig should be run. The following build triggers are available: Webhook, Image change or Configuration change
  • 16. CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE 16 DeploymentConfig Source: https://docs.openshift.com/container-platform/4.2/applications/deployments/what-deployments-are.html#deployments-and-deploymentconfigs_what-deployments-are Building on ReplicationControllers, OpenShift Container Platform adds expanded support for the software development and deployment lifecycle with the concept of DeploymentConfigs. In the simplest case, a DeploymentConfig creates a new ReplicationController and lets it start up Pods. However, OpenShift Container Platform deployments from DeploymentConfigs also provide the ability to transition from an existing deployment of an image to a new one and also define hooks to be run before or after creating the ReplicationController.
  • 17. CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE 17 Summary Source: https://docs.openshift.com/container-platform/4.2/applications/deployments/what-deployments-are.html#deployments-and-deploymentconfigs_what-deployments-are
  • 18. CONFIDENTIAL INTERNAL USE2019 RED HAT TECH EXCHANGE 18
  • 19. CONFIDENTIAL Designator linkedin.com/company/red-hat youtube.com/user/RedHatVideos facebook.com/redhatinc twitter.com/RedHat Red Hat is the world’s leading provider of enterprise open source software solutions. Award-winning support, training, and consulting services make Red Hat a trusted adviser to the Fortune 500. Thank you 19