SlideShare ist ein Scribd-Unternehmen logo
1 von 56
Continuous Delivery with Containers:
The Good, the Bad, and the Ugly
Daniel Bryant
@danielbryantuk
Containers: Expectations versus reality
22/10/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
• Books contains more details
22/10/2018 @danielbryantuk
bit.ly/2jWDSF7
bit.ly/2BTjpir
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)
22/10/2018 @danielbryantuk
@danielbryantuk
• Tech Consultant, Product Architect at Datawire, InfoQ News Manager
• Ex-academic, software developer, ops, ex-CTO, conference tourist
• Continuous Delivery (CI/CD) advocate
• Leading change through technology and teams
22/10/2018 @danielbryantuk
Continuous Delivery 101
22/10/2018 @danielbryantuk
Continuous Delivery
• Produce valuable and robust software in short cycles
• Optimising for feedback and learning
• Not (necessarily) Continuous Deployment
22/10/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)
22/10/2018 @danielbryantuk
Creation of a build pipeline is mandatory for continuous delivery
22/10/2018 @danielbryantuk
22/10/2018 @danielbryantuk
Feedback:
- Was our initial
hypothesis proven?
- How can we improve
business, architecture
and ops?
The impact of containers on CD
22/10/2018 @danielbryantuk
Container technology (and CD)
• OS-level virtualisation
• cgroups, namespaces, rootfs
• Package and execute software
• Container image == ‘single binary’
22/10/2018 @danielbryantuk
22/10/2018 @danielbryantuk
22/10/2018 @danielbryantuk
Microservices multiply the challenges
22/10/2018 @danielbryantuk
https://www.youtube.com/watch?v=b9Fu1So0bXA
Creating a pipeline for containers
22/10/2018 @danielbryantuk
22/10/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
22/10/2018 @danielbryantuk
Quick aside: Working remotely, locally…
22/10/2018 @danielbryantuk
https://opencredo.com/working-locally-with-microservices/
https://www.telepresence.io/
Lesson learned: Dockerfile content is super important
• OS choice (alpine or Distroless?)
• Configuration
• Build artifacts
• Exposing ports
• Oracle vs OpenJDK vs …?
• JDK vs JRE (vs jlinked binary?)
• Hotspot vs OpenJ9 vs GraalVM vs…?
• JIT vs AOT?
22/10/2018 @danielbryantuk
Please talk to the sysadmin people:
Their operational knowledge is invaluable
22/10/2018 @danielbryantuk
And watch out for these antipatterns/patterns
22/10/2018 @danielbryantuk
Antipattern: 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
22/10/2018 @danielbryantuk
http://blog.terranillius.com/post/docker_testing/
Pattern: Multi-stage building for minimisation
22/10/2018 @danielbryantuk
https://dzone.com/articles/multi-stage-docker-image-build-for-java-apps
Docker multi-stage builds
22/10/2018 @danielbryantuk
https://dzone.com/articles/multi-stage-docker-image-build-for-java-apps http://blog.arungupta.me/smaller-java-image-docker-multi-stage-build/
22/10/2018 @danielbryantuk
Building Container Images: Jenkins (X?)
• Jenkins
• My O’Reilly report covers this
• Build as usual…
• Build Docker Image
• Cloudbees Docker Build and Publish Plugin
• Push image to registry
• All-in on Kubernetes?
• You can use Jenkins X
22/10/2018 @danielbryantuk
Other options: Docker buildkit and Google Jib
22/10/2018 @danielbryantuk
github.com/GoogleContainerTools/jibgithub.com/moby/buildkit
Other options: Docker buildkit and Google Jib
22/10/2018 @danielbryantuk
github.com/GoogleContainerTools/jibgithub.com/moby/buildkit
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
22/10/2018 @danielbryantuk
Metadata - Adding Labels at build time
• Docker Labels
• Add key/value data to image
22/10/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
22/10/2018 @danielbryantuk
Metadata - Adding Labels at runtime
22/10/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
22/10/2018 @danielbryantuk
22/10/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
22/10/2018 @danielbryantuk
Security Visibility: Basic (Java) Code Scanning
22/10/2018 @danielbryantuk
Dependency Scanning
22/10/2018 @danielbryantuk
www.owasp.org/index.php/OWASP_Dependency_Check
Static Image Scanning
22/10/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
22/10/2018 @danielbryantuk
Important things not covered
22/10/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)
22/10/2018 @danielbryantuk 42
Performance
• Java 11
• Eclipse OpenJ9
• www.eclipse.org/openj9/oj9_performance.html
• Ahead of Time (AOT) Compilation
• Application Class Data Sharing (ACDS)
• blog.codefx.org/java/application-class-data-sharing/
22/10/2018 @danielbryantuk
https://www.ibm.com/developerworks/library/j-rtj2/
An interesting CodeOne session I spotted
22/10/2018 @danielbryantuk
Whatever tweaks you make…
Test
Test
Test…
22/10/2018 @danielbryantuk
Deployment
22/10/2018 @danielbryantuk
https://blog.hasura.io/draft-vs-gitkube-vs-helm-vs-ksonnet-vs-metaparticle-vs-skaffold-f5aa9561f948
Observability is core to continuous delivery
22/10/2018 @danielbryantuk
www.infoq.com/articles/monitoring-containers-at-scale
Containers are not a silver bullet
22/10/2018 @danielbryantuk
Moving to containers: Going all-in?
22/10/2018 @danielbryantuk
OR
Using containers does not get rid of the need for
good architectural practices
22/10/2018 @danielbryantuk
22/10/2018 @danielbryantuk
https://speakerdeck.com/caseywest/containercon-north-america-cloud-anti-patterns
Summary
22/10/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
22/10/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
22/10/2018 @danielbryantuk
bit.ly/2jWDSF7
bit.ly/2BTjpir
Bedtime reading
22/10/2018 @danielbryantuk
Testing with Dependencies?
22/10/2018 @danielbryantuk
https://www.testcontainers.org/
https://hoverfly.io/

Weitere ähnliche Inhalte

Ähnlich wie CodeOne SF 2018 "Continuous Delivery with Containers: Lessons Learned"

Docker Birthday #3 Slides - Overview
Docker Birthday #3 Slides - OverviewDocker Birthday #3 Slides - Overview
Docker Birthday #3 Slides - Overview
Chris Ciborowski
 
Lessons Learned Running Hadoop and Spark in Docker Containers
Lessons Learned Running Hadoop and Spark in Docker ContainersLessons Learned Running Hadoop and Spark in Docker Containers
Lessons Learned Running Hadoop and Spark in Docker Containers
BlueData, Inc.
 

Ähnlich wie CodeOne SF 2018 "Continuous Delivery with Containers: Lessons Learned" (20)

DCEU 18: Continuous Delivery with Docker Containers and Java: The Good, the B...
DCEU 18: Continuous Delivery with Docker Containers and Java: The Good, the B...DCEU 18: Continuous Delivery with Docker Containers and Java: The Good, the B...
DCEU 18: Continuous Delivery with Docker Containers and Java: The Good, the B...
 
DockerCon EU 2018 "Continuous Delivery with Docker and Java"
DockerCon EU 2018 "Continuous Delivery with Docker and Java"DockerCon EU 2018 "Continuous Delivery with Docker and Java"
DockerCon EU 2018 "Continuous Delivery with Docker and Java"
 
Devoxx 2017 "Continuous Delivery with Containers: The Good, the Bad, and the ...
Devoxx 2017 "Continuous Delivery with Containers: The Good, the Bad, and the ...Devoxx 2017 "Continuous Delivery with Containers: The Good, the Bad, and the ...
Devoxx 2017 "Continuous Delivery with Containers: The Good, the Bad, and the ...
 
ContainerSched 2017 "Continuous Delivery with Containers: The Good, the Bad, ...
ContainerSched 2017 "Continuous Delivery with Containers: The Good, the Bad, ...ContainerSched 2017 "Continuous Delivery with Containers: The Good, the Bad, ...
ContainerSched 2017 "Continuous Delivery with Containers: The Good, the Bad, ...
 
O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...
O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...
O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...
 
Cloud Native CI/CD with Jenkins X and Knative Pipelines
Cloud Native CI/CD with Jenkins X and Knative PipelinesCloud Native CI/CD with Jenkins X and Knative Pipelines
Cloud Native CI/CD with Jenkins X and Knative Pipelines
 
Docker Enterprise Workshop - Intro
Docker Enterprise Workshop - IntroDocker Enterprise Workshop - Intro
Docker Enterprise Workshop - Intro
 
Gerrit + Jenkins = Continuous Delivery For Big Data
Gerrit + Jenkins = Continuous Delivery For Big DataGerrit + Jenkins = Continuous Delivery For Big Data
Gerrit + Jenkins = Continuous Delivery For Big Data
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
Ambassador Developer Office Hours: Summer of Kubernetes Ship Week 1: Intro to...
Ambassador Developer Office Hours: Summer of Kubernetes Ship Week 1: Intro to...Ambassador Developer Office Hours: Summer of Kubernetes Ship Week 1: Intro to...
Ambassador Developer Office Hours: Summer of Kubernetes Ship Week 1: Intro to...
 
Effiziente CI/CD-Pipelines – mit den richtigen Tools klappt das
Effiziente CI/CD-Pipelines – mit den richtigen Tools klappt dasEffiziente CI/CD-Pipelines – mit den richtigen Tools klappt das
Effiziente CI/CD-Pipelines – mit den richtigen Tools klappt das
 
Preparing your dockerised application for production deployment
Preparing your dockerised application for production deploymentPreparing your dockerised application for production deployment
Preparing your dockerised application for production deployment
 
Docker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker SlidesDocker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker Slides
 
Docker Birthday #3 Slides - Overview
Docker Birthday #3 Slides - OverviewDocker Birthday #3 Slides - Overview
Docker Birthday #3 Slides - Overview
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
 
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
 
Oracle and Docker
Oracle and DockerOracle and Docker
Oracle and Docker
 
Scalable Clusters On Demand
Scalable Clusters On DemandScalable Clusters On Demand
Scalable Clusters On Demand
 
MEAN Stack Warm-up
MEAN Stack Warm-upMEAN Stack Warm-up
MEAN Stack Warm-up
 
Lessons Learned Running Hadoop and Spark in Docker Containers
Lessons Learned Running Hadoop and Spark in Docker ContainersLessons Learned Running Hadoop and Spark in Docker Containers
Lessons Learned Running Hadoop and Spark in Docker Containers
 

Mehr von Daniel Bryant

Mehr von Daniel Bryant (20)

ITKonekt 2023: The Busy Platform Engineers Guide to API Gateways
ITKonekt 2023: The Busy Platform Engineers Guide to API GatewaysITKonekt 2023: The Busy Platform Engineers Guide to API Gateways
ITKonekt 2023: The Busy Platform Engineers Guide to API Gateways
 
CraftConf 2023 "Microservice Testing Techniques: Mocks vs Service Virtualizat...
CraftConf 2023 "Microservice Testing Techniques: Mocks vs Service Virtualizat...CraftConf 2023 "Microservice Testing Techniques: Mocks vs Service Virtualizat...
CraftConf 2023 "Microservice Testing Techniques: Mocks vs Service Virtualizat...
 
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"
 
Java Meetup 23: 'Debugging Microservices "Remocally" in Kubernetes with Telep...
Java Meetup 23: 'Debugging Microservices "Remocally" in Kubernetes with Telep...Java Meetup 23: 'Debugging Microservices "Remocally" in Kubernetes with Telep...
Java Meetup 23: 'Debugging Microservices "Remocally" in Kubernetes with Telep...
 
DevRelCon 2022: "Is Product Led Growth (PLG) the “DevOps” of the DevRel World"
DevRelCon 2022: "Is Product Led Growth (PLG) the “DevOps” of the DevRel World"DevRelCon 2022: "Is Product Led Growth (PLG) the “DevOps” of the DevRel World"
DevRelCon 2022: "Is Product Led Growth (PLG) the “DevOps” of the DevRel World"
 
Fall 22: "From Kubernetes to PaaS to... err, what's next"
Fall 22: "From Kubernetes to PaaS to... err, what's next"Fall 22: "From Kubernetes to PaaS to... err, what's next"
Fall 22: "From Kubernetes to PaaS to... err, what's next"
 
Building Microservice Systems Without Cooking Your Laptop: Going “Remocal” wi...
Building Microservice Systems Without Cooking Your Laptop: Going “Remocal” wi...Building Microservice Systems Without Cooking Your Laptop: Going “Remocal” wi...
Building Microservice Systems Without Cooking Your Laptop: Going “Remocal” wi...
 
KubeCrash 22: Debugging Microservices "Remocally" in Kubernetes with Telepres...
KubeCrash 22: Debugging Microservices "Remocally" in Kubernetes with Telepres...KubeCrash 22: Debugging Microservices "Remocally" in Kubernetes with Telepres...
KubeCrash 22: Debugging Microservices "Remocally" in Kubernetes with Telepres...
 
JAX London 22: Debugging Microservices "Remocally" in Kubernetes with Telepre...
JAX London 22: Debugging Microservices "Remocally" in Kubernetes with Telepre...JAX London 22: Debugging Microservices "Remocally" in Kubernetes with Telepre...
JAX London 22: Debugging Microservices "Remocally" in Kubernetes with Telepre...
 
CloudBuilders 2022: "The Past, Present, and Future of Cloud Native API Gateways"
CloudBuilders 2022: "The Past, Present, and Future of Cloud Native API Gateways"CloudBuilders 2022: "The Past, Present, and Future of Cloud Native API Gateways"
CloudBuilders 2022: "The Past, Present, and Future of Cloud Native API Gateways"
 
KubeCon EU 2022: From Kubernetes to PaaS to Err What's Next
KubeCon EU 2022: From Kubernetes to PaaS to Err What's NextKubeCon EU 2022: From Kubernetes to PaaS to Err What's Next
KubeCon EU 2022: From Kubernetes to PaaS to Err What's Next
 
Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...
Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...
Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...
 
DevXDay KubeCon NA 2021: "From Kubernetes to PaaS to Developer Control Planes"
DevXDay KubeCon NA 2021: "From Kubernetes to PaaS to Developer Control Planes"DevXDay KubeCon NA 2021: "From Kubernetes to PaaS to Developer Control Planes"
DevXDay KubeCon NA 2021: "From Kubernetes to PaaS to Developer Control Planes"
 
JAX London 2021: Jumpstart Your Cloud Native Development: An Overview of Prac...
JAX London 2021: Jumpstart Your Cloud Native Development: An Overview of Prac...JAX London 2021: Jumpstart Your Cloud Native Development: An Overview of Prac...
JAX London 2021: Jumpstart Your Cloud Native Development: An Overview of Prac...
 
Container Days: Easy Debugging of Microservices Running on Kubernetes with Te...
Container Days: Easy Debugging of Microservices Running on Kubernetes with Te...Container Days: Easy Debugging of Microservices Running on Kubernetes with Te...
Container Days: Easy Debugging of Microservices Running on Kubernetes with Te...
 
Canadian CNCF: "Emissary-ingress 101: An introduction to the CNCF incubation-...
Canadian CNCF: "Emissary-ingress 101: An introduction to the CNCF incubation-...Canadian CNCF: "Emissary-ingress 101: An introduction to the CNCF incubation-...
Canadian CNCF: "Emissary-ingress 101: An introduction to the CNCF incubation-...
 
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
 
LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...
LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...
LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...
 
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
 
HashiCorp Webinar: "Getting started with Ambassador and Consul on Kubernetes ...
HashiCorp Webinar: "Getting started with Ambassador and Consul on Kubernetes ...HashiCorp Webinar: "Getting started with Ambassador and Consul on Kubernetes ...
HashiCorp Webinar: "Getting started with Ambassador and Consul on Kubernetes ...
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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 Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

CodeOne SF 2018 "Continuous Delivery with Containers: Lessons Learned"

  • 1. Continuous Delivery with Containers: The Good, the Bad, and the Ugly Daniel Bryant @danielbryantuk
  • 2. Containers: Expectations versus reality 22/10/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 • Books contains more details 22/10/2018 @danielbryantuk bit.ly/2jWDSF7 bit.ly/2BTjpir
  • 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) 22/10/2018 @danielbryantuk
  • 5. @danielbryantuk • Tech Consultant, Product Architect at Datawire, InfoQ News Manager • Ex-academic, software developer, ops, ex-CTO, conference tourist • Continuous Delivery (CI/CD) advocate • Leading change through technology and teams 22/10/2018 @danielbryantuk
  • 7. Continuous Delivery • Produce valuable and robust software in short cycles • Optimising for feedback and learning • Not (necessarily) Continuous Deployment 22/10/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) 22/10/2018 @danielbryantuk
  • 9. Creation of a build pipeline is mandatory for continuous delivery 22/10/2018 @danielbryantuk
  • 10. 22/10/2018 @danielbryantuk Feedback: - Was our initial hypothesis proven? - How can we improve business, architecture and ops?
  • 11. The impact of containers on CD 22/10/2018 @danielbryantuk
  • 12. Container technology (and CD) • OS-level virtualisation • cgroups, namespaces, rootfs • Package and execute software • Container image == ‘single binary’ 22/10/2018 @danielbryantuk
  • 15. Microservices multiply the challenges 22/10/2018 @danielbryantuk https://www.youtube.com/watch?v=b9Fu1So0bXA
  • 16. Creating a pipeline for containers 22/10/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 22/10/2018 @danielbryantuk
  • 19. Quick aside: Working remotely, locally… 22/10/2018 @danielbryantuk https://opencredo.com/working-locally-with-microservices/ https://www.telepresence.io/
  • 20. Lesson learned: Dockerfile content is super important • OS choice (alpine or Distroless?) • Configuration • Build artifacts • Exposing ports • Oracle vs OpenJDK vs …? • JDK vs JRE (vs jlinked binary?) • Hotspot vs OpenJ9 vs GraalVM vs…? • JIT vs AOT? 22/10/2018 @danielbryantuk
  • 21. Please talk to the sysadmin people: Their operational knowledge is invaluable 22/10/2018 @danielbryantuk
  • 22. And watch out for these antipatterns/patterns 22/10/2018 @danielbryantuk
  • 23. Antipattern: 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 22/10/2018 @danielbryantuk http://blog.terranillius.com/post/docker_testing/
  • 24. Pattern: Multi-stage building for minimisation 22/10/2018 @danielbryantuk https://dzone.com/articles/multi-stage-docker-image-build-for-java-apps
  • 25. Docker multi-stage builds 22/10/2018 @danielbryantuk https://dzone.com/articles/multi-stage-docker-image-build-for-java-apps http://blog.arungupta.me/smaller-java-image-docker-multi-stage-build/
  • 27. Building Container Images: Jenkins (X?) • Jenkins • My O’Reilly report covers this • Build as usual… • Build Docker Image • Cloudbees Docker Build and Publish Plugin • Push image to registry • All-in on Kubernetes? • You can use Jenkins X 22/10/2018 @danielbryantuk
  • 28. Other options: Docker buildkit and Google Jib 22/10/2018 @danielbryantuk github.com/GoogleContainerTools/jibgithub.com/moby/buildkit
  • 29. Other options: Docker buildkit and Google Jib 22/10/2018 @danielbryantuk github.com/GoogleContainerTools/jibgithub.com/moby/buildkit
  • 30. 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 22/10/2018 @danielbryantuk
  • 31. Metadata - Adding Labels at build time • Docker Labels • Add key/value data to image 22/10/2018 @danielbryantuk
  • 32. 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 22/10/2018 @danielbryantuk
  • 33. Metadata - Adding Labels at runtime 22/10/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
  • 34. External registry with metadata support 22/10/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 22/10/2018 @danielbryantuk
  • 37. Security Visibility: Basic (Java) Code Scanning 22/10/2018 @danielbryantuk
  • 39. Static Image Scanning 22/10/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 22/10/2018 @danielbryantuk
  • 41. Important things not covered 22/10/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) 22/10/2018 @danielbryantuk 42
  • 43. Performance • Java 11 • Eclipse OpenJ9 • www.eclipse.org/openj9/oj9_performance.html • Ahead of Time (AOT) Compilation • Application Class Data Sharing (ACDS) • blog.codefx.org/java/application-class-data-sharing/ 22/10/2018 @danielbryantuk https://www.ibm.com/developerworks/library/j-rtj2/
  • 44. An interesting CodeOne session I spotted 22/10/2018 @danielbryantuk
  • 45. Whatever tweaks you make… Test Test Test… 22/10/2018 @danielbryantuk
  • 47. Observability is core to continuous delivery 22/10/2018 @danielbryantuk www.infoq.com/articles/monitoring-containers-at-scale
  • 48. Containers are not a silver bullet 22/10/2018 @danielbryantuk
  • 49. Moving to containers: Going all-in? 22/10/2018 @danielbryantuk OR
  • 50. Using containers does not get rid of the need for good architectural practices 22/10/2018 @danielbryantuk
  • 53. 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 22/10/2018 @danielbryantuk
  • 54. 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 22/10/2018 @danielbryantuk bit.ly/2jWDSF7 bit.ly/2BTjpir
  • 56. Testing with Dependencies? 22/10/2018 @danielbryantuk https://www.testcontainers.org/ https://hoverfly.io/