KEMBAR78
Automate App Container Delivery with CI/CD and DevOps | PDF
Daniel Oh
Specialist Solution Architect, AppDev
Agile & DevOps CoP Manager
@danieloh30
Automate Application Container
Delivery with CI/CD and DevOps
How do you to build and Deploy
your App Containers?
BUILD AND DEPLOY CONTAINER IMAGES
DEPLOY YOUR
SOURCE CODE
DEPLOY YOUR
APP BINARY
DEPLOY YOUR
CONTAINER IMAGE
DEPLOY YOUR
SOURCE CODE
Developers write code using
existing development tools
such as Maven, NPM, Bower,
PIP, Dockerfile and Git and
then access the OpenShift
Web, CLI or IDE to create an
app from the code
DEPLOY SOURCE CODE WITH
SOURCE-TO-IMAGE (S2I)
codeGit
Repository
CODE
DEV
S2I combines source code
with a builder image
(language and application
runtimes) and stores the
resulting application image
in the image registry
DEPLOY SOURCE CODE WITH
SOURCE-TO-IMAGE (S2I)
codeGit
Repository
Source-to-Image
(S2I)
Container
Image
Image
Registry
BUILD
DEV
OpenShift automates the
deployment of application
containers across multiple
hosts via the Kubernetes.
Users can trigger
deployments, rollback,
configure A/B or other
custom deployments
DEPLOY SOURCE CODE WITH
SOURCE-TO-IMAGE (S2I)
codeGit
Repository
Source-to-Image
(S2I)
deploy
Container
Image
Image
Registry
OPSDEV
DEPLOY
Application
Container
DEPLOY YOUR
APP BINARY
Developers use the existing
build process and tools (e.g.
Maven, Gradle, Jenkins, Nexus)
to build the app binaries (e.g.
JAR, WAR, EAR) and use
OpenShift CLI to create an app
from the app binaries
DEPLOY APP BINARY WITH
SOURCE-TO-IMAGE (S2I)
Application
Binary
(e.g. WAR)
DEV
BUILD APP
build
Existing Build
Process
...
DEPLOY APP BINARY WITH
SOURCE-TO-IMAGE (S2I)
Application
Binary
(e.g. WAR)
Source-to-Image
(S2I)
Container
Image
Image
Registry
DEV
build
Existing Build
Process
BUILD IMAGE
S2I combines app binaries
(e.g. JAR, WAR, EAR) with a
builder image (language
and application runtimes)
and stores the resulting
application image in the
image registry
DEPLOY APP BINARY WITH
SOURCE-TO-IMAGE (S2I)
Application
Binary
(e.g. WAR)
Source-to-Image
(S2I)
deploy
Container
Image
Image
Registry
OPSDEV
build
Existing Build
Process
DEPLOY
Application
Container
OpenShift automates the
deployment of application
containers across multiple
hosts via the Kubernetes.
Users can trigger
deployments, rollback,
configure A/B or other
custom deployments
DEPLOY YOUR
DOCKER IMAGE
App images are built using the
existing docker image build
process. OpenShift automates
the deployment of app
containers across multiple hosts
via the Kubernetes. Users can
trigger deployments, rollback,
configure A/B, etc
DEPLOY
DEPLOY DOCKER IMAGE
build
Application
Container
deploy
Application
Image
Image
Registry
OPSDEV
BUILD
Existing Image
Build Process
CONTINUOUS INTEGRATION (CI)
CONTINUOUS DELIVERY (CD)
What is CI/CD
● Continuous Integration is the practice of constantly merging development work with a main line of code (e.g. master
branch) so that changes can be tested and make sure they work with all other changes.
● Continuous Delivery is the natural extension of Continuous Integration, an approach in which teams ensure that every
change to the system is releasable, and release any version with the push of a button.
● Continuous Deployment is the most advanced evolution of continuous delivery and advocates automatic release of
every change into production without human intervention after it has been successfully tested and verified in the process.
Unit Test Platform Test Deliver to Staging
Application
Acceptance tests
Deploy to
Production
Post deploy tests
Auto Auto Auto AutoManual
Unit Test Platform Test Deliver to Staging
Application
Acceptance tests
Deploy to
Production
Post deploy tests
Auto Auto Auto AutoAuto
Continuous Delivery
Continuous Deployment
CI/CD WITH BUILD AND DEPLOYMENTS
BUILDS
● Webhook triggers: build the app image whenever the code changes
● Image trigger: build the app image whenever the base language or app runtime changes
● Build hooks: test the app image before pushing it to an image registry
DEPLOYMENTS
● Deployment triggers: redeploy app containers whenever the image changes in the
OpenShift integrated image registry or upstream registries
CONTINUOUS DELIVERY WITH CONTAINERS
source
repository
CI/CD
engine
dev container
physical
virtual
private cloud
public cloud
OPENSHIFT LOVES CI/CD
JENKINS-AS-A SERVICE
ON OPENSHIFT
HYBRID JENKINS INFRA
WITH OPENSHIFT
EXISTING CI/CD
DEPLOY TO OPENSHIFT
JENKINS-AS-A-SERVICE ON OPENSHIFT
● Certified Jenkins images with pre-configured plugins
○ Provided out-of-the-box
○ Follows Jenkins 1.x and 2.x LTS versions
● Jenkins S2I Builder for customizing the image
○ Install Plugins
○ Configure Jenkins
○ Configure Build Jobs
● OpenShift plugins to integrate authentication with
OpenShift and also CI/CD pipelines
● Dynamically deploys Jenkins slave containers
Plugins
Jobs
Configuration
Jenkins
(S2I)
Custom
Jenkins
Image
Jenkins
Image
● Scale existing Jenkins infrastructure by dynamically provisioning Jenkins slaves on OpenShift
● Use Kubernetes plug-in on existing Jenkin servers
HYBRID JENKINS INFRA WITH OPENSHIFT
OPENSHIFT
APP APPrun job
JENKINS
SLAVE
Run Job
JENKINS
SLAVE
Run Job
build
JENKINS
MASTER
deploy
● Existing CI/CD infrastructure outside OpenShift performs operations against OpenShift
○ OpenShift Pipeline Jenkins Plugin for Jenkins
○ OpenShift CLI for integrating other CI Engines with OpenShift
● Without disrupting existing processes, can be combined with previous alternative
EXISTING CI/CD DEPLOY TO OPENSHIFT
OPENSHIFT
APP
EXISTING
CI/CD INFRA
Jenkins, Bamboo,
TeamCity, etc
APPbuild
deploy
S2I
Buildrun job
OPENSHIFT PIPELINES
● OpenShift Pipelines allow defining a
CI/CD workflow via a Jenkins pipeline
which can be started, monitored, and
managed similar to other builds
● Dynamic provisioning of Jenkins slaves
● Auto-provisioning of Jenkins server
● OpenShift Pipeline strategies
○ Embedded Jenkinsfile
○ Jenkinsfile from a Git repository
apiVersion: v1
kind: BuildConfig
metadata:
name: app-pipeline
spec:
strategy:
type: JenkinsPipeline
jenkinsPipelineStrategy:
jenkinsfile: |-
node('maven') {
stage('build app') {
git url: 'https://git/app.git'
sh "mvn package"
}
stage('build image') {
sh "oc start-build app --from-file=target/app.jar
}
stage('deploy') {
openshiftDeploy deploymentConfig: 'app'
}
}
Provision a
Jenkins slave for
running Maven
OpenShift
Pipelines in
Web Console
APPLICATION
IMAGE
CONTINUOUS DELIVERY PIPELINE
DEV TEAM GIT SERVER
ARTIFACT
REPOSITORY
JENKINS
IMAGE BUILD
● S2I build from source code
● S2I build from app binary
● Existing docker container image
build process
CONTINUOUS DELIVERY PIPELINE
INTEGRATED
IMAGE
REGISTRY
OPENSHIFT
CLUSTER
DEVELOPER GIT SERVER ARTIFACT REPOSITORY
OPENSHIFT
CI/CD PIPELINE
(JENKINS)
IMAGE BUILD
& DEPLOY
INTEGRATED
IMAGE
REGISTRY
OPENSHIFT
CLUSTER
NON-PROD PRODDEV
INTEGRATED
IMAGE
REGISTRY
OPENSHIFT
CLUSTER
CONTINUOUS DELIVERY PIPELINE
DEVELOPER GIT SERVER ARTIFACT REPOSITORY
OPENSHIFT
CI/CD PIPELINE
(JENKINS)
IMAGE BUILD
& DEPLOY
INTEGRATED
IMAGE
REGISTRY
OPENSHIFT
CLUSTER
PROMOTE
TO TEST
NON-PROD PRODDEV TEST
INTEGRATED
IMAGE
REGISTRY
OPENSHIFT
CLUSTER
CONTINUOUS DELIVERY PIPELINE
DEVELOPER GIT SERVER ARTIFACT REPOSITORY
OPENSHIFT
CI/CD PIPELINE
(JENKINS)
IMAGE BUILD
& DEPLOY
INTEGRATED
IMAGE
REGISTRY
OPENSHIFT
CLUSTER
PROMOTE
TO TEST
PROMOTE
TO UAT
NON-PROD PRODDEV TEST UAT
ServiceNow
JIRA Service Desk
Zendeks
BMC Remedy
INTEGRATED
IMAGE
REGISTRY
OPENSHIFT
CLUSTER
CONTINUOUS DELIVERY PIPELINE
DEVELOPER GIT SERVER ARTIFACT REPOSITORY
OPENSHIFT
CI/CD PIPELINE
(JENKINS)
IMAGE BUILD
& DEPLOY
INTEGRATED
IMAGE
REGISTRY
OPENSHIFT
CLUSTER
GO
LIVE?
PROMOTE
TO TEST
PROMOTE
TO UAT
RELEASE MANAGER
NON-PROD PROD
☒
☑
DEV TEST UAT
INTEGRATED
IMAGE
REGISTRY
OPENSHIFT
CLUSTER
CONTINUOUS DELIVERY PIPELINE
DEVELOPER GIT SERVER ARTIFACT REPOSITORY
OPENSHIFT
CI/CD PIPELINE
(JENKINS)
IMAGE BUILD
& DEPLOY
INTEGRATED
IMAGE
REGISTRY
OPENSHIFT
CLUSTER
GO
LIVE?
PROMOTE
TO TEST
PROMOTE
TO UAT
PROMOTE
TO PROD
RELEASE MANAGER
NON-PROD PRODDEV TEST UAT
☒
☑
Daniel Oh
Specialist Solution Architect, AppDev
Agile & DevOps CoP Manager
@danieloh30
THANK YOU

Automate App Container Delivery with CI/CD and DevOps

  • 1.
    Daniel Oh Specialist SolutionArchitect, AppDev Agile & DevOps CoP Manager @danieloh30 Automate Application Container Delivery with CI/CD and DevOps
  • 2.
    How do youto build and Deploy your App Containers?
  • 3.
    BUILD AND DEPLOYCONTAINER IMAGES DEPLOY YOUR SOURCE CODE DEPLOY YOUR APP BINARY DEPLOY YOUR CONTAINER IMAGE
  • 4.
  • 5.
    Developers write codeusing existing development tools such as Maven, NPM, Bower, PIP, Dockerfile and Git and then access the OpenShift Web, CLI or IDE to create an app from the code DEPLOY SOURCE CODE WITH SOURCE-TO-IMAGE (S2I) codeGit Repository CODE DEV
  • 6.
    S2I combines sourcecode with a builder image (language and application runtimes) and stores the resulting application image in the image registry DEPLOY SOURCE CODE WITH SOURCE-TO-IMAGE (S2I) codeGit Repository Source-to-Image (S2I) Container Image Image Registry BUILD DEV
  • 7.
    OpenShift automates the deploymentof application containers across multiple hosts via the Kubernetes. Users can trigger deployments, rollback, configure A/B or other custom deployments DEPLOY SOURCE CODE WITH SOURCE-TO-IMAGE (S2I) codeGit Repository Source-to-Image (S2I) deploy Container Image Image Registry OPSDEV DEPLOY Application Container
  • 8.
  • 9.
    Developers use theexisting build process and tools (e.g. Maven, Gradle, Jenkins, Nexus) to build the app binaries (e.g. JAR, WAR, EAR) and use OpenShift CLI to create an app from the app binaries DEPLOY APP BINARY WITH SOURCE-TO-IMAGE (S2I) Application Binary (e.g. WAR) DEV BUILD APP build Existing Build Process ...
  • 10.
    DEPLOY APP BINARYWITH SOURCE-TO-IMAGE (S2I) Application Binary (e.g. WAR) Source-to-Image (S2I) Container Image Image Registry DEV build Existing Build Process BUILD IMAGE S2I combines app binaries (e.g. JAR, WAR, EAR) with a builder image (language and application runtimes) and stores the resulting application image in the image registry
  • 11.
    DEPLOY APP BINARYWITH SOURCE-TO-IMAGE (S2I) Application Binary (e.g. WAR) Source-to-Image (S2I) deploy Container Image Image Registry OPSDEV build Existing Build Process DEPLOY Application Container OpenShift automates the deployment of application containers across multiple hosts via the Kubernetes. Users can trigger deployments, rollback, configure A/B or other custom deployments
  • 12.
  • 13.
    App images arebuilt using the existing docker image build process. OpenShift automates the deployment of app containers across multiple hosts via the Kubernetes. Users can trigger deployments, rollback, configure A/B, etc DEPLOY DEPLOY DOCKER IMAGE build Application Container deploy Application Image Image Registry OPSDEV BUILD Existing Image Build Process
  • 14.
  • 15.
    What is CI/CD ●Continuous Integration is the practice of constantly merging development work with a main line of code (e.g. master branch) so that changes can be tested and make sure they work with all other changes. ● Continuous Delivery is the natural extension of Continuous Integration, an approach in which teams ensure that every change to the system is releasable, and release any version with the push of a button. ● Continuous Deployment is the most advanced evolution of continuous delivery and advocates automatic release of every change into production without human intervention after it has been successfully tested and verified in the process. Unit Test Platform Test Deliver to Staging Application Acceptance tests Deploy to Production Post deploy tests Auto Auto Auto AutoManual Unit Test Platform Test Deliver to Staging Application Acceptance tests Deploy to Production Post deploy tests Auto Auto Auto AutoAuto Continuous Delivery Continuous Deployment
  • 16.
    CI/CD WITH BUILDAND DEPLOYMENTS BUILDS ● Webhook triggers: build the app image whenever the code changes ● Image trigger: build the app image whenever the base language or app runtime changes ● Build hooks: test the app image before pushing it to an image registry DEPLOYMENTS ● Deployment triggers: redeploy app containers whenever the image changes in the OpenShift integrated image registry or upstream registries
  • 17.
    CONTINUOUS DELIVERY WITHCONTAINERS source repository CI/CD engine dev container physical virtual private cloud public cloud
  • 18.
    OPENSHIFT LOVES CI/CD JENKINS-AS-ASERVICE ON OPENSHIFT HYBRID JENKINS INFRA WITH OPENSHIFT EXISTING CI/CD DEPLOY TO OPENSHIFT
  • 19.
    JENKINS-AS-A-SERVICE ON OPENSHIFT ●Certified Jenkins images with pre-configured plugins ○ Provided out-of-the-box ○ Follows Jenkins 1.x and 2.x LTS versions ● Jenkins S2I Builder for customizing the image ○ Install Plugins ○ Configure Jenkins ○ Configure Build Jobs ● OpenShift plugins to integrate authentication with OpenShift and also CI/CD pipelines ● Dynamically deploys Jenkins slave containers Plugins Jobs Configuration Jenkins (S2I) Custom Jenkins Image Jenkins Image
  • 20.
    ● Scale existingJenkins infrastructure by dynamically provisioning Jenkins slaves on OpenShift ● Use Kubernetes plug-in on existing Jenkin servers HYBRID JENKINS INFRA WITH OPENSHIFT OPENSHIFT APP APPrun job JENKINS SLAVE Run Job JENKINS SLAVE Run Job build JENKINS MASTER deploy
  • 21.
    ● Existing CI/CDinfrastructure outside OpenShift performs operations against OpenShift ○ OpenShift Pipeline Jenkins Plugin for Jenkins ○ OpenShift CLI for integrating other CI Engines with OpenShift ● Without disrupting existing processes, can be combined with previous alternative EXISTING CI/CD DEPLOY TO OPENSHIFT OPENSHIFT APP EXISTING CI/CD INFRA Jenkins, Bamboo, TeamCity, etc APPbuild deploy S2I Buildrun job
  • 22.
    OPENSHIFT PIPELINES ● OpenShiftPipelines allow defining a CI/CD workflow via a Jenkins pipeline which can be started, monitored, and managed similar to other builds ● Dynamic provisioning of Jenkins slaves ● Auto-provisioning of Jenkins server ● OpenShift Pipeline strategies ○ Embedded Jenkinsfile ○ Jenkinsfile from a Git repository apiVersion: v1 kind: BuildConfig metadata: name: app-pipeline spec: strategy: type: JenkinsPipeline jenkinsPipelineStrategy: jenkinsfile: |- node('maven') { stage('build app') { git url: 'https://git/app.git' sh "mvn package" } stage('build image') { sh "oc start-build app --from-file=target/app.jar } stage('deploy') { openshiftDeploy deploymentConfig: 'app' } } Provision a Jenkins slave for running Maven
  • 23.
  • 24.
    APPLICATION IMAGE CONTINUOUS DELIVERY PIPELINE DEVTEAM GIT SERVER ARTIFACT REPOSITORY JENKINS IMAGE BUILD ● S2I build from source code ● S2I build from app binary ● Existing docker container image build process
  • 25.
    CONTINUOUS DELIVERY PIPELINE INTEGRATED IMAGE REGISTRY OPENSHIFT CLUSTER DEVELOPERGIT SERVER ARTIFACT REPOSITORY OPENSHIFT CI/CD PIPELINE (JENKINS) IMAGE BUILD & DEPLOY INTEGRATED IMAGE REGISTRY OPENSHIFT CLUSTER NON-PROD PRODDEV
  • 26.
    INTEGRATED IMAGE REGISTRY OPENSHIFT CLUSTER CONTINUOUS DELIVERY PIPELINE DEVELOPERGIT SERVER ARTIFACT REPOSITORY OPENSHIFT CI/CD PIPELINE (JENKINS) IMAGE BUILD & DEPLOY INTEGRATED IMAGE REGISTRY OPENSHIFT CLUSTER PROMOTE TO TEST NON-PROD PRODDEV TEST
  • 27.
    INTEGRATED IMAGE REGISTRY OPENSHIFT CLUSTER CONTINUOUS DELIVERY PIPELINE DEVELOPERGIT SERVER ARTIFACT REPOSITORY OPENSHIFT CI/CD PIPELINE (JENKINS) IMAGE BUILD & DEPLOY INTEGRATED IMAGE REGISTRY OPENSHIFT CLUSTER PROMOTE TO TEST PROMOTE TO UAT NON-PROD PRODDEV TEST UAT
  • 28.
    ServiceNow JIRA Service Desk Zendeks BMCRemedy INTEGRATED IMAGE REGISTRY OPENSHIFT CLUSTER CONTINUOUS DELIVERY PIPELINE DEVELOPER GIT SERVER ARTIFACT REPOSITORY OPENSHIFT CI/CD PIPELINE (JENKINS) IMAGE BUILD & DEPLOY INTEGRATED IMAGE REGISTRY OPENSHIFT CLUSTER GO LIVE? PROMOTE TO TEST PROMOTE TO UAT RELEASE MANAGER NON-PROD PROD ☒ ☑ DEV TEST UAT
  • 29.
    INTEGRATED IMAGE REGISTRY OPENSHIFT CLUSTER CONTINUOUS DELIVERY PIPELINE DEVELOPERGIT SERVER ARTIFACT REPOSITORY OPENSHIFT CI/CD PIPELINE (JENKINS) IMAGE BUILD & DEPLOY INTEGRATED IMAGE REGISTRY OPENSHIFT CLUSTER GO LIVE? PROMOTE TO TEST PROMOTE TO UAT PROMOTE TO PROD RELEASE MANAGER NON-PROD PRODDEV TEST UAT ☒ ☑
  • 30.
    Daniel Oh Specialist SolutionArchitect, AppDev Agile & DevOps CoP Manager @danieloh30 THANK YOU