2. Please note
IBM’s statements regarding its plans, directions, and intent are subject to change
or withdrawal without notice and at IBM’s sole discretion.
Information regarding potential future products is intended to outline our general
product direction and it should not be relied on in making a purchasing decision.
The information mentioned regarding potential future products is not a commitment, promise,
or legal obligation to deliver any material, code or functionality. Information about potential
future products may not be incorporated into any contract.
The development, release, and timing of any future features or functionality described for our
products remains at our sole discretion.
Performance is based on measurements and projections using standard IBM benchmarks in
a controlled environment. The actual throughput or performance that any user will
experience will vary depending upon many factors, including considerations such as the
amount of multiprogramming in the user’s job stream, the I/O configuration, the storage
configuration, and the workload processed. Therefore, no assurance can be given that an
individual user will achieve results similar to those stated here.
2
5. What is Ready for production application
• Secure
• Installation, authentication and access
• Resilient, Highly Available and scale
• Repeated deployment
• with safe upgrades and configuration changes
• Performance
• Observable
• Upgradeable
• more …..
• And AGILE too
Its not MAGIC
6. 6
What is a
12-factor
app?
https://12factor.net/
• “12-Factor” is a software
methodology for building scalable
microservice applications
• Originally created by Heroku
• Best practices designed to enable
applications to be built with
portability, resilience, and
scalability when deployed to the
web
7. 7
I. Codebase
One codebase tracked in revision control, many deploys
II. Dependencies
Explicitly declare and isolate dependencies
III. Config
Store config in the environment
IV. Backing services
Treat backing services as attached resources
V. Build, release, run
Strictly separate build and run stages
VI. Processes
Execute the app as one or more stateless processes
VII. Port binding
Export services via port binding
VIII. Concurrency
Scale out via the process model
IX. Disposability
Maximize robustness with fast startup and graceful shutdown
X. Dev/prod parity
Keep development, staging, and production as similar as
possible
XI. Logs
Treat logs as event streams
XII. Admin processes
Run admin/management tasks as one-off processes
Why
12 factor
apps?
• Make it easier to run, scale, and
deploy applications
• Keep parity between development
and production
• Provide strict separation between
build, release, and run stages
8. I. Codebase
One codebase tracked in
revision control, many deploys
II. Dependencies
Explicitly declare and isolate
dependencies
III. Config
Store config in the environment
IV. Backing services
Treat backing services as
attached resources
V. Build, release, run
Strictly separate build and run
stages
VI. Processes
Execute the app as one or more
stateless processes
VII. Port binding
Export services via port binding
VIII. Concurrency
Scale out via the process model
IX. Disposability
Maximize robustness with fast
startup and graceful shutdown
X. Parity between dev & prod
Keep development, staging,
and production as similar as
possible
XI. Logs
Treat logs as event streams
XII. Admin processes
Run admin/management tasks
as one-off processes
Code Deploy Operate
9. Developers Dream – code Factors
9
• One codebase for my application
tracked in revision that runs
anywhere: build, ship and run
anywhere
AND
• I can offload deployment, HA,
scaling, upgrade strategy and not
worry about it
Test and
automation
Release AGILE
Design
• Container Images built from
Dockerfiles using trusted small image.
Kubernetes Deployments, etc
managed as YAML (F#I- Codebase)
• Having a strong artifact-driven model
makes it easier to follow a
Continuous Delivery lifecycle (F#V-
Build, release, run)
• Using the same images and YAML
objects make it easier for dev teams
to match what’s running in
production
(F#X- Dev/prod parity)
Develop
10. Pod
(Single IP Address)
Deploy factors
10
• ConfigMaps and Secrets managed in source
repositories or built dynamically via commands
(F#III: Config ). Containers retrieve during runtime
• A collection of Pods can expose or consume
Services via Service port bindings (F#IV : Backing
Services, F#VII: Port binding)
• Container image runs as a container process in a
Pod with other containers (F#VI: Processes )
• Explicitly declare and isolate dependencies(F#II:
Dependencies)
• Running app as a container makes it possible to
capture all logs, metrics, and other management
functions in a consistent way (F#XII: Admin
Process )
Pod
(Single IP Address)
Volume
Volume
container
container
container
Volume
Secret
ConfigMap
Service
Persistent
Volume
11. • Ensure scale for your app
• Replica set ensures specified number of pods are always
running
Service
Replica set
container
Deployment
kind: Deployment
metadata:
name: nginx
spec:
replicas: 2
template:
metadata:
labels:
service: http-server
spec:
containers:
- name: nginx
image: nginx:1.10.2
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
• Is this enough?
Remember load is never constant in the real world
container
Operate factors: Concurrency (F#VIII) & Disposability (F#IX)
12. Operate factors: Concurrency (F#VIII)
Leverage autoscaling to automate computation resources based on load
• Horizontal Pod Scaler (HPA)
• Controls the number of replicas
• Use cpu or memory as a trigger or use
custom metric
• Applicable for stateless app
• Vertical Pod Scaler (HPA)
• Controls the memory and cpu for pod
• Use cpu or memory as a trigger or use
custom metric
• Applicable for statefull apps
Service
Replica set
Pod
Deployment
Pod Pod---
HPA
(policy)
Resource
metric
(usage)
Service
Replica set
Deployment
VPA
(policy)
Resource
metric
(usage)
Pod
Pod
Pod
Pod
13. 13
7
missing
factors
XIII. Observable
Apps should provide visibility about current health and metrics
XIV. Schedulable
Apps should provide guidance on expected resource constraints
XV. Upgradable
Apps must upgrade data formats from prior generations
XVI. Least privileged
Apps should provide guidance on expected resource constraints
XVII. Auditable
Apps should provide appropriate audit logs for compliance needs
XVIII. Access Control (Identity, Network, Scope, Certificates)
Protect app and resources from the world
XIX. Measurable
Apps usage should be measurable for quota or chargebacks
26. Leverage the IBM Cloud Garage
Method to change how you work.
26Think 2018
Provides an in-depth collection of
practices, tutorials, and
architectures to help you on this
journey.
Completely open forum for learning
at your own pace.
We offer hands-on guidance and
services, if needed.
Defined
Practices
Business
Benefits
Technical
Benefits
ibm.com/cloud/garage >
27. 27
Learn
more in
our new
book!
#7678A: Tech Talk:
Deploying Kubernetes in
the Enterprise (with the
authors)
When: Wednesday, 11:30
AM - 12:10 PM
Where: Table Top Tap Room
at the Metreon | Code Cafe
Tech Talks Area
Get a signed copy with all
of the authors at the Code
Café Mezzaine on
Wednesday (7 – 7:30PM)!
ibm.biz/BdYA4i >Now available online compliments of IBM:
Fewer worked on my laptop arguments
Marathon analogy – Keep parity between development and production
12 Factor Apps is focused on making it easier to run, scale and deploy applications
“The twelve-factor app uses strict separation between the build, release, and run stages.
For example, it is impossible to make changes to the code at runtime, since there is no way to propagate those changes back to the build stage.”