SlideShare a Scribd company logo
Continuous Delivery with Containers:
The Good, the Bad, and the Ugly
Daniel Bryant
@danielbryantuk
Containers: Expectations versus reality
13/07/2018 @danielbryantuk
“DevOps”
Setting the scene…
• Continuous delivery is a large topic
• No business focus today (value stream etc)
• PaaS and Serverless are super interesting…
• But I’m assuming you’re all-in on containers
• Focusing today on the process and tooling
• No live coding today
• Mini-book contains more details (thanks nginx!)
13/07/2018 @danielbryantuk
bit.ly/2jWDSF7
TL;DR – Containers and CD
• Container image becomes the build pipeline ‘single binary’
• Adding metadata to containers images is vital, but challenging
• Must validate container constraints on system quality attributes (NFRs)
13/07/2018 @danielbryantuk
@danielbryantuk
• Tech Consultant, Product Architect at Datawire, InfoQ News Manager
• Academic, software developer, DBA, ops, CTO, conference vagabond
• Continuous Delivery (CI/CD) advocate
• Leading change through technology and teams
13/07/2018 @danielbryantuk
Continuous Delivery 101
13/07/2018 @danielbryantuk
Continuous Delivery
• Produce valuable and robust software in short cycles
• Optimising for feedback and learning
• Not (necessarily) Continuous Deployment
13/07/2018 @danielbryantuk
Velocity (with stability) is key to business success
“Continuous delivery is achieved when stability and
speed can satisfy business demand.
Discontinuous delivery occurs when stability and speed
are insufficient.”
- Steve Smith (@SteveSmithCD)
13/07/2018 @danielbryantuk
Creation of a build pipeline is mandatory for continuous delivery
13/07/2018 @danielbryantuk
13/07/2018 @danielbryantuk
Feedback:
- Was our initial
hypothesis proven?
- How can we improve
business, architecture
and ops?
The impact of containers on CD
13/07/2018 @danielbryantuk
Container technology (and CD)
• OS-level virtualisation
• cgroups, namespaces, rootfs
• Package and execute software
• Container image == ‘single binary’
13/07/2018 @danielbryantuk
13/07/2018 @danielbryantuk
13/07/2018 @danielbryantuk
Microservices multiply the challenges
13/07/2018 @danielbryantuk
https://www.youtube.com/watch?v=b9Fu1So0bXA
Creating a pipeline for containers
13/07/2018 @danielbryantuk
13/07/2018 @danielbryantuk
Make your dev environment like production
• Develop locally or copy/code in container
• Must build/test containers locally
• Perform (at least) happy path tests
• Use identical base images from production
• With same configuration
13/07/2018 @danielbryantuk
Working remotely, locally…
13/07/2018 @danielbryantuk
https://opencredo.com/working-locally-with-microservices/
https://www.telepresence.io/
Lesson learned: Dockerfile content is super important
• OS choice
• Configuration
• Build artifacts
• Exposing ports
• Java
• JDK vs JRE and Oracle vs OpenJDK?
• Golang
• Statically compiled binary in scratch?
• Python
• Virtualenv?
13/07/2018 @danielbryantuk
Please talk to the sysadmin people:
Their operational knowledge is invaluable
13/07/2018 @danielbryantuk
Different test and prod containers?
• Create “test” version of container
• Full OS (e.g. Ubuntu)
• Test tools and data
• Easy to see app/configuration drift
• Use test sidecar containers instead
• ONTEST proposal by Alexi Ledenev
13/07/2018 @danielbryantuk
http://blog.terranillius.com/post/docker_testing/
Docker multi-stage builds
13/07/2018 @danielbryantuk
http://blog.alexellis.io/mutli-stage-docker-builds/
https://github.com/moby/moby/pull/31257
https://github.com/moby/moby/pull/32063
13/07/2018 @danielbryantuk
Building images with Jenkins
• My report covers this
• Build as usual…
• Build Docker Image
• Cloudbees Docker Build and Publish Plugin
• Push image to registry
13/07/2018 @danielbryantuk
Lesson learned: Metadata is valuable
• Application metadata
• Version / GIT SHA
• Build metadata
• Build date
• Image name
• Vendor
• Quality metadata
• QA control, signed binaries, ephemeral support
• Security profiles (AppArmor), Security audited etc
13/07/2018 @danielbryantuk
Metadata – Beware of “latest” Docker Tag
• Beware of the ‘latest’ Docker tag
• “Latest” simply means
• the last build/tag that ran without
a specific tag/version specified
• Ignore “latest” tag
• Version your tags, every time
• danielbryantuk/test:2.4.1
13/07/2018 @danielbryantuk
Metadata - Adding Labels at build time
• Docker Labels
• Add key/value data to image
13/07/2018 @danielbryantuk
Metadata - Adding Labels at build time
• Microscaling Systems’ Makefile
• Labelling automated builds on
DockerHub (h/t Ross Fairbanks)
• Create file ‘/hooks/build’
• label-schema.org
• microbadger.com
13/07/2018 @danielbryantuk
Metadata - Adding Labels at runtime
13/07/2018 @danielbryantuk
$ docker run -d --label
uk.co.danielbryant.lbname=frontdoor nginx
• Can ’docker commit’, but creates new image
• Not possible to update running container
• Docker Proposal: Update labels #21721
External registry with metadata support
13/07/2018 @danielbryantuk
Grafeas + Kritis
13/07/2018 @danielbryantuk
13/07/2018 @danielbryantuk
13/07/2018 @danielbryantuk
Running tests with containers
13/07/2018 @danielbryantuk
Testing NFRs in the build pipeline
• Architecture
• Performance and Load testing
• Gatling / jmeter / Flood.io
• Security testing
• Findsecbugs / OWASP Dependency check
• Bdd-security (OWASP ZAP) / Arachni
• Gauntlt / Serverspec
• Docker Bench for Security / CoreOS Clair
13/07/2018 @danielbryantuk
Security Visibility: Basic (Java) Code Scanning
13/07/2018 @danielbryantuk
Dependency Scanning
13/07/2018 @danielbryantuk
www.owasp.org/index.php/OWASP_Dependency_Check
Static Image Scanning
13/07/2018 @danielbryantuk
github.com/arminc/clair-scanner
Delaying NFRs to the ‘Last Responsible Moment’
Newsflash!
Sometimes the
last responsible moment
is up-front
Modern platforms/architectures
don’t necessarily make this easier
13/07/2018 @danielbryantuk
Important things not covered
13/07/2018 @danielbryantuk
Mechanical sympathy: Docker and Java
• Watch for JVM cgroup/taskset awareness (with JDK <= 8)
• getAvailableProcessors() may incorrectly report the number of cpus in Docker (JDK-8140793)
• Runtime.availableProcessors() ignores Linux taskset command (JDK-6515172)
• Default fork/join thread pool sizes (and others) is based from host CPU count
• Set container memory appropriately
• JVM requirements = Heap size (Xmx) + Metaspace + JVM overhead
• Account for native thread requirements e.g. thread stack size (Xss)
• Entropy
• Host entropy can soon be exhausted by crypto operations and /dev/random blocks
• -Djava.security.egd=file:/dev/./urandom (notes on this)
13/07/2018 @danielbryantuk 42
Deployment
13/07/2018 @danielbryantuk
https://blog.hasura.io/draft-vs-gitkube-vs-helm-vs-ksonnet-vs-metaparticle-vs-skaffold-f5aa9561f948
Observability is core to continuous delivery
13/07/2018 @danielbryantuk
www.infoq.com/articles/monitoring-containers-at-scale
Containers are not a silver bullet
13/07/2018 @danielbryantuk
Moving to containers: Going all-in?
13/07/2018 @danielbryantuk
OR
Using containers does not get rid of the need for
good architectural practices
13/07/2018 @danielbryantuk
13/07/2018 @danielbryantuk
https://speakerdeck.com/caseywest/containercon-north-america-cloud-anti-patterns
Summary
13/07/2018 @danielbryantuk
In summary
• Continuous delivery is vitally important with modern architecture/tech
• Container images must be the (single) source of truth within pipeline
• And metadata added as appropriate…
• Mechanical sympathy is important (assert properties in the pipeline)
• Not all developers are operationally aware
• The tooling is now becoming stable/mature
• We need to re-apply existing CD practices with new technologies/tooling
13/07/2018 @danielbryantuk
Thanks for listening…
Twitter: @danielbryantuk
Email: daniel.bryant@tai-dev.co.uk
Writing: https://www.infoq.com/profile/Daniel-Bryant
Talks: https://www.youtube.com/playlist?list=PLoVYf_0qOYNeBmrpjuBOOAqJnQb3QAEtM
13/07/2018 @danielbryantuk
bit.ly/2jWDSF7
Coming soon!
Bedtime reading
13/07/2018 @danielbryantuk
Bonus slides (for extra context)
13/07/2018 @danielbryantuk
Containerise an existing (monolithic) app?
• For
• We know the monolith well
• Allows homogenization of the
pipeline and deployment platform
• Can be a demonstrable win for
tech and the business
• Against
• Can be difficult (100+ line scripts)
• Often not designed for operation
within containers, nor cloud native
• Putting lipstick on a pig?
13/07/2018 @danielbryantuk
Key lessons learned
• Conduct an architectural review
• Architecture for Developers, by Simon Brown
• Architecture Interview, by Susan Fowler
• Look for data ingress/egress
• File system access
• Support resource constraints/transience
• Optimise for quick startup and shutdown
• Evaluate approach to concurrency
• Store configuration (secrets) remotely
13/07/2018 @danielbryantuk
New design patterns
13/07/2018 @danielbryantuk
bit.ly/2efe0TP
Microservices…
Containers and microservices are
complementary
Testing and deployment change
13/07/2018 @danielbryantuk
https://specto.io/blog/recipe-for-designing-building-testing-microservices.html
13/07/2018 @danielbryantuk
13/07/2018 @danielbryantuk
13/07/2018 @danielbryantuk
Quick Aside: Running *entire* system locally
13/07/2018 @danielbryantuk
https://news.ycombinator.com/item?id=13960107
https://opencredo.com/working-locally-with-microservices/
https://www.datawire.io/telepresence/ | https://hoverfly.io/

More Related Content

PPTX
jSpring 2018 "Continuous Delivery Patterns for Modern Architectures and Java"
PDF
CNCF Webinar Series: "Creating an Effective Developer Experience on Kubernetes"
PDF
Velocity NY 2018 "The Cloud Native Developer Workflow"
PDF
CloudNativeLondon 2018: "In Search of the Perfect Cloud Native Developer Expe...
PDF
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
PDF
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...
PDF
Knative makes Developers Incredible on Serverless
PPTX
JAX DevOps 2019: "Creating an Effective Developer Experience for Cloud-native...
jSpring 2018 "Continuous Delivery Patterns for Modern Architectures and Java"
CNCF Webinar Series: "Creating an Effective Developer Experience on Kubernetes"
Velocity NY 2018 "The Cloud Native Developer Workflow"
CloudNativeLondon 2018: "In Search of the Perfect Cloud Native Developer Expe...
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...
Knative makes Developers Incredible on Serverless
JAX DevOps 2019: "Creating an Effective Developer Experience for Cloud-native...

What's hot (20)

PDF
DevXDay KubeCon NA 2021: "From Kubernetes to PaaS to Developer Control Planes"
PPTX
Codemotion Rome 2018 "Continuous Delivery with Containers: The Good, the Bad ...
PDF
Full Steam Ahead, R2DBC!
PDF
vodQA Pune (2019) - Jenkins pipeline As code
PDF
JAX London 2021: Jumpstart Your Cloud Native Development: An Overview of Prac...
PPTX
[Konveyor] roles &amp; processes that make application modernization projects...
PPTX
SnapyX
PPTX
Platform engineering 101
PDF
Crossing the Streams! Rollout Strategies to Keep Your Users Happy!
PPTX
12 factor app
PPTX
CodeOne 2019: "Continuous Delivery with Docker and Java"
PDF
victoriia basarab - special aspects of dev ops platform development
PDF
Chris Homer - Moving the entire stack to k8s within a year – lessons learned
PDF
Secrets of Successful Digital Transformers
PDF
Is Platform Engineering the new Ops?
PDF
Next ’19 的 Istio 場次 重點摘要
PDF
Cloud Ambassador Programs
PDF
The Twelve Factor App
PDF
PDF
給 RD 的 Kubernetes 初體驗 (gcpug 2019-06 version)
DevXDay KubeCon NA 2021: "From Kubernetes to PaaS to Developer Control Planes"
Codemotion Rome 2018 "Continuous Delivery with Containers: The Good, the Bad ...
Full Steam Ahead, R2DBC!
vodQA Pune (2019) - Jenkins pipeline As code
JAX London 2021: Jumpstart Your Cloud Native Development: An Overview of Prac...
[Konveyor] roles &amp; processes that make application modernization projects...
SnapyX
Platform engineering 101
Crossing the Streams! Rollout Strategies to Keep Your Users Happy!
12 factor app
CodeOne 2019: "Continuous Delivery with Docker and Java"
victoriia basarab - special aspects of dev ops platform development
Chris Homer - Moving the entire stack to k8s within a year – lessons learned
Secrets of Successful Digital Transformers
Is Platform Engineering the new Ops?
Next ’19 的 Istio 場次 重點摘要
Cloud Ambassador Programs
The Twelve Factor App
給 RD 的 Kubernetes 初體驗 (gcpug 2019-06 version)
Ad

Similar to Continuous Delivery with Containers: The Good, the Bad, and the Ugly (20)

PPTX
Continuous Delivery with Containers: The Good, the Bad, and the Ugly - Daniel...
PPTX
SATURN 2018 "Continuous Delivery with Containers" Extended 90 version
PPTX
CodeOne SF 2018 "Continuous Delivery with Containers: Lessons Learned"
PDF
DCEU 18: Continuous Delivery with Docker Containers and Java: The Good, the B...
PPTX
DockerCon EU 2018 "Continuous Delivery with Docker and Java"
PPTX
Devoxx 2017 "Continuous Delivery with Containers: The Good, the Bad, and the ...
PPTX
O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...
PPTX
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
PPTX
vJUG 2017 "Continuous Delivery with Java and Docker: The Good, the Bad, and t...
PPTX
ContainerSched 2017 "Continuous Delivery with Containers: The Good, the Bad, ...
PPTX
OReilly SACON 2016 "A Practical Guide for Continuous Delivery with Containers"
PDF
Ambassador Developer Office Hours: Summer of Kubernetes Ship Week 1: Intro to...
PPTX
deliver:Agile 2018 "Continuous Delivery Patterns for Modern Architectures"
PPTX
Jax London 2018: "Testing Microservices from Development to Production"
PDF
JAXDevOps 2017 "The Seven (More) Deadly Sins of Microservices
PDF
JAXLondon 2017 "Continuous Delivery with Containers and Java"
PDF
DevOpsCon 2017 "Continuous Delivery with Containers"
PDF
#AATC2017: "Continuous Delivery with Containers: The Trials and Tribulations"
PPTX
JAX London 2014 "Building Java Applications for the Cloud: The DHARMA princip...
PPTX
O'Reilly SACON NY 2018 "Continuous Delivery Patterns for Contemporary Archite...
Continuous Delivery with Containers: The Good, the Bad, and the Ugly - Daniel...
SATURN 2018 "Continuous Delivery with Containers" Extended 90 version
CodeOne SF 2018 "Continuous Delivery with Containers: Lessons Learned"
DCEU 18: Continuous Delivery with Docker Containers and Java: The Good, the B...
DockerCon EU 2018 "Continuous Delivery with Docker and Java"
Devoxx 2017 "Continuous Delivery with Containers: The Good, the Bad, and the ...
O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
vJUG 2017 "Continuous Delivery with Java and Docker: The Good, the Bad, and t...
ContainerSched 2017 "Continuous Delivery with Containers: The Good, the Bad, ...
OReilly SACON 2016 "A Practical Guide for Continuous Delivery with Containers"
Ambassador Developer Office Hours: Summer of Kubernetes Ship Week 1: Intro to...
deliver:Agile 2018 "Continuous Delivery Patterns for Modern Architectures"
Jax London 2018: "Testing Microservices from Development to Production"
JAXDevOps 2017 "The Seven (More) Deadly Sins of Microservices
JAXLondon 2017 "Continuous Delivery with Containers and Java"
DevOpsCon 2017 "Continuous Delivery with Containers"
#AATC2017: "Continuous Delivery with Containers: The Trials and Tribulations"
JAX London 2014 "Building Java Applications for the Cloud: The DHARMA princip...
O'Reilly SACON NY 2018 "Continuous Delivery Patterns for Contemporary Archite...
Ad

More from Daniel Bryant (20)

PDF
ITKonekt 2023: The Busy Platform Engineers Guide to API Gateways
PDF
CraftConf 2023 "Microservice Testing Techniques: Mocks vs Service Virtualizat...
PDF
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"
PDF
Java Meetup 23: 'Debugging Microservices "Remocally" in Kubernetes with Telep...
PPTX
DevRelCon 2022: "Is Product Led Growth (PLG) the “DevOps” of the DevRel World"
PDF
Fall 22: "From Kubernetes to PaaS to... err, what's next"
PDF
Building Microservice Systems Without Cooking Your Laptop: Going “Remocal” wi...
PDF
KubeCrash 22: Debugging Microservices "Remocally" in Kubernetes with Telepres...
PDF
JAX London 22: Debugging Microservices "Remocally" in Kubernetes with Telepre...
PDF
CloudBuilders 2022: "The Past, Present, and Future of Cloud Native API Gateways"
PDF
KubeCon EU 2022: From Kubernetes to PaaS to Err What's Next
PDF
Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...
PDF
Container Days: Easy Debugging of Microservices Running on Kubernetes with Te...
PDF
Canadian CNCF: "Emissary-ingress 101: An introduction to the CNCF incubation-...
PDF
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
PDF
LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...
PPTX
HashiCorp Webinar: "Getting started with Ambassador and Consul on Kubernetes ...
PDF
Ambassador Fest: "Kubernetes Workflow 101: The Big Picture of Idea to an API ...
PDF
ADDO 2020: "The past, present, and future of cloud native API gateways"
PDF
GOTOpia 2020: "The Past, Present, and Future of Cloud Native API Gateways"
ITKonekt 2023: The Busy Platform Engineers Guide to API Gateways
CraftConf 2023 "Microservice Testing Techniques: Mocks vs Service Virtualizat...
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"
Java Meetup 23: 'Debugging Microservices "Remocally" in Kubernetes with Telep...
DevRelCon 2022: "Is Product Led Growth (PLG) the “DevOps” of the DevRel World"
Fall 22: "From Kubernetes to PaaS to... err, what's next"
Building Microservice Systems Without Cooking Your Laptop: Going “Remocal” wi...
KubeCrash 22: Debugging Microservices "Remocally" in Kubernetes with Telepres...
JAX London 22: Debugging Microservices "Remocally" in Kubernetes with Telepre...
CloudBuilders 2022: "The Past, Present, and Future of Cloud Native API Gateways"
KubeCon EU 2022: From Kubernetes to PaaS to Err What's Next
Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...
Container Days: Easy Debugging of Microservices Running on Kubernetes with Te...
Canadian CNCF: "Emissary-ingress 101: An introduction to the CNCF incubation-...
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...
HashiCorp Webinar: "Getting started with Ambassador and Consul on Kubernetes ...
Ambassador Fest: "Kubernetes Workflow 101: The Big Picture of Idea to an API ...
ADDO 2020: "The past, present, and future of cloud native API gateways"
GOTOpia 2020: "The Past, Present, and Future of Cloud Native API Gateways"

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
KodekX | Application Modernization Development
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Modernizing your data center with Dell and AMD
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Machine learning based COVID-19 study performance prediction
PDF
Encapsulation theory and applications.pdf
PDF
Empathic Computing: Creating Shared Understanding
Spectral efficient network and resource selection model in 5G networks
Advanced methodologies resolving dimensionality complications for autism neur...
KodekX | Application Modernization Development
The Rise and Fall of 3GPP – Time for a Sabbatical?
Understanding_Digital_Forensics_Presentation.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Modernizing your data center with Dell and AMD
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
NewMind AI Weekly Chronicles - August'25 Week I
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Machine learning based COVID-19 study performance prediction
Encapsulation theory and applications.pdf
Empathic Computing: Creating Shared Understanding

Continuous Delivery with Containers: The Good, the Bad, and the Ugly

  • 1. Continuous Delivery with Containers: The Good, the Bad, and the Ugly Daniel Bryant @danielbryantuk
  • 2. Containers: Expectations versus reality 13/07/2018 @danielbryantuk “DevOps”
  • 3. Setting the scene… • Continuous delivery is a large topic • No business focus today (value stream etc) • PaaS and Serverless are super interesting… • But I’m assuming you’re all-in on containers • Focusing today on the process and tooling • No live coding today • Mini-book contains more details (thanks nginx!) 13/07/2018 @danielbryantuk bit.ly/2jWDSF7
  • 4. TL;DR – Containers and CD • Container image becomes the build pipeline ‘single binary’ • Adding metadata to containers images is vital, but challenging • Must validate container constraints on system quality attributes (NFRs) 13/07/2018 @danielbryantuk
  • 5. @danielbryantuk • Tech Consultant, Product Architect at Datawire, InfoQ News Manager • Academic, software developer, DBA, ops, CTO, conference vagabond • Continuous Delivery (CI/CD) advocate • Leading change through technology and teams 13/07/2018 @danielbryantuk
  • 7. Continuous Delivery • Produce valuable and robust software in short cycles • Optimising for feedback and learning • Not (necessarily) Continuous Deployment 13/07/2018 @danielbryantuk
  • 8. Velocity (with stability) is key to business success “Continuous delivery is achieved when stability and speed can satisfy business demand. Discontinuous delivery occurs when stability and speed are insufficient.” - Steve Smith (@SteveSmithCD) 13/07/2018 @danielbryantuk
  • 9. Creation of a build pipeline is mandatory for continuous delivery 13/07/2018 @danielbryantuk
  • 10. 13/07/2018 @danielbryantuk Feedback: - Was our initial hypothesis proven? - How can we improve business, architecture and ops?
  • 11. The impact of containers on CD 13/07/2018 @danielbryantuk
  • 12. Container technology (and CD) • OS-level virtualisation • cgroups, namespaces, rootfs • Package and execute software • Container image == ‘single binary’ 13/07/2018 @danielbryantuk
  • 15. Microservices multiply the challenges 13/07/2018 @danielbryantuk https://www.youtube.com/watch?v=b9Fu1So0bXA
  • 16. Creating a pipeline for containers 13/07/2018 @danielbryantuk
  • 18. Make your dev environment like production • Develop locally or copy/code in container • Must build/test containers locally • Perform (at least) happy path tests • Use identical base images from production • With same configuration 13/07/2018 @danielbryantuk
  • 19. Working remotely, locally… 13/07/2018 @danielbryantuk https://opencredo.com/working-locally-with-microservices/ https://www.telepresence.io/
  • 20. Lesson learned: Dockerfile content is super important • OS choice • Configuration • Build artifacts • Exposing ports • Java • JDK vs JRE and Oracle vs OpenJDK? • Golang • Statically compiled binary in scratch? • Python • Virtualenv? 13/07/2018 @danielbryantuk
  • 21. Please talk to the sysadmin people: Their operational knowledge is invaluable 13/07/2018 @danielbryantuk
  • 22. Different test and prod containers? • Create “test” version of container • Full OS (e.g. Ubuntu) • Test tools and data • Easy to see app/configuration drift • Use test sidecar containers instead • ONTEST proposal by Alexi Ledenev 13/07/2018 @danielbryantuk http://blog.terranillius.com/post/docker_testing/
  • 23. Docker multi-stage builds 13/07/2018 @danielbryantuk http://blog.alexellis.io/mutli-stage-docker-builds/ https://github.com/moby/moby/pull/31257 https://github.com/moby/moby/pull/32063
  • 25. Building images with Jenkins • My report covers this • Build as usual… • Build Docker Image • Cloudbees Docker Build and Publish Plugin • Push image to registry 13/07/2018 @danielbryantuk
  • 26. Lesson learned: Metadata is valuable • Application metadata • Version / GIT SHA • Build metadata • Build date • Image name • Vendor • Quality metadata • QA control, signed binaries, ephemeral support • Security profiles (AppArmor), Security audited etc 13/07/2018 @danielbryantuk
  • 27. Metadata – Beware of “latest” Docker Tag • Beware of the ‘latest’ Docker tag • “Latest” simply means • the last build/tag that ran without a specific tag/version specified • Ignore “latest” tag • Version your tags, every time • danielbryantuk/test:2.4.1 13/07/2018 @danielbryantuk
  • 28. Metadata - Adding Labels at build time • Docker Labels • Add key/value data to image 13/07/2018 @danielbryantuk
  • 29. Metadata - Adding Labels at build time • Microscaling Systems’ Makefile • Labelling automated builds on DockerHub (h/t Ross Fairbanks) • Create file ‘/hooks/build’ • label-schema.org • microbadger.com 13/07/2018 @danielbryantuk
  • 30. Metadata - Adding Labels at runtime 13/07/2018 @danielbryantuk $ docker run -d --label uk.co.danielbryant.lbname=frontdoor nginx • Can ’docker commit’, but creates new image • Not possible to update running container • Docker Proposal: Update labels #21721
  • 31. External registry with metadata support 13/07/2018 @danielbryantuk
  • 32. Grafeas + Kritis 13/07/2018 @danielbryantuk
  • 35. Running tests with containers 13/07/2018 @danielbryantuk
  • 36. Testing NFRs in the build pipeline • Architecture • Performance and Load testing • Gatling / jmeter / Flood.io • Security testing • Findsecbugs / OWASP Dependency check • Bdd-security (OWASP ZAP) / Arachni • Gauntlt / Serverspec • Docker Bench for Security / CoreOS Clair 13/07/2018 @danielbryantuk
  • 37. Security Visibility: Basic (Java) Code Scanning 13/07/2018 @danielbryantuk
  • 39. Static Image Scanning 13/07/2018 @danielbryantuk github.com/arminc/clair-scanner
  • 40. Delaying NFRs to the ‘Last Responsible Moment’ Newsflash! Sometimes the last responsible moment is up-front Modern platforms/architectures don’t necessarily make this easier 13/07/2018 @danielbryantuk
  • 41. Important things not covered 13/07/2018 @danielbryantuk
  • 42. Mechanical sympathy: Docker and Java • Watch for JVM cgroup/taskset awareness (with JDK <= 8) • getAvailableProcessors() may incorrectly report the number of cpus in Docker (JDK-8140793) • Runtime.availableProcessors() ignores Linux taskset command (JDK-6515172) • Default fork/join thread pool sizes (and others) is based from host CPU count • Set container memory appropriately • JVM requirements = Heap size (Xmx) + Metaspace + JVM overhead • Account for native thread requirements e.g. thread stack size (Xss) • Entropy • Host entropy can soon be exhausted by crypto operations and /dev/random blocks • -Djava.security.egd=file:/dev/./urandom (notes on this) 13/07/2018 @danielbryantuk 42
  • 44. Observability is core to continuous delivery 13/07/2018 @danielbryantuk www.infoq.com/articles/monitoring-containers-at-scale
  • 45. Containers are not a silver bullet 13/07/2018 @danielbryantuk
  • 46. Moving to containers: Going all-in? 13/07/2018 @danielbryantuk OR
  • 47. Using containers does not get rid of the need for good architectural practices 13/07/2018 @danielbryantuk
  • 50. In summary • Continuous delivery is vitally important with modern architecture/tech • Container images must be the (single) source of truth within pipeline • And metadata added as appropriate… • Mechanical sympathy is important (assert properties in the pipeline) • Not all developers are operationally aware • The tooling is now becoming stable/mature • We need to re-apply existing CD practices with new technologies/tooling 13/07/2018 @danielbryantuk
  • 51. Thanks for listening… Twitter: @danielbryantuk Email: daniel.bryant@tai-dev.co.uk Writing: https://www.infoq.com/profile/Daniel-Bryant Talks: https://www.youtube.com/playlist?list=PLoVYf_0qOYNeBmrpjuBOOAqJnQb3QAEtM 13/07/2018 @danielbryantuk bit.ly/2jWDSF7 Coming soon!
  • 53. Bonus slides (for extra context) 13/07/2018 @danielbryantuk
  • 54. Containerise an existing (monolithic) app? • For • We know the monolith well • Allows homogenization of the pipeline and deployment platform • Can be a demonstrable win for tech and the business • Against • Can be difficult (100+ line scripts) • Often not designed for operation within containers, nor cloud native • Putting lipstick on a pig? 13/07/2018 @danielbryantuk
  • 55. Key lessons learned • Conduct an architectural review • Architecture for Developers, by Simon Brown • Architecture Interview, by Susan Fowler • Look for data ingress/egress • File system access • Support resource constraints/transience • Optimise for quick startup and shutdown • Evaluate approach to concurrency • Store configuration (secrets) remotely 13/07/2018 @danielbryantuk
  • 56. New design patterns 13/07/2018 @danielbryantuk bit.ly/2efe0TP
  • 57. Microservices… Containers and microservices are complementary Testing and deployment change 13/07/2018 @danielbryantuk https://specto.io/blog/recipe-for-designing-building-testing-microservices.html
  • 61. Quick Aside: Running *entire* system locally 13/07/2018 @danielbryantuk https://news.ycombinator.com/item?id=13960107 https://opencredo.com/working-locally-with-microservices/ https://www.datawire.io/telepresence/ | https://hoverfly.io/