SlideShare une entreprise Scribd logo
1  sur  35
Télécharger pour lire hors ligne
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 1@armillz
DevOps Patterns to Enable Success with
Microservices
Richard Mills
DevOps Solution Architect, Coveros Inc.
rich.mills@coveros.com
@armillz
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 2@armillz
Who is this guy?
• Me: Mad-Software-Developer turned Mad-Software-Engineer
turned DevOps-Solution-Architect. Pragmatist. Particular
focus on tools and automation. CI, CD, Agile, DevOps …
what’s next?
• PS: Thanks for inventing the term “DevOps” to describe what I like
to do.
• Pays my bills: Coveros helps organizations accelerate the
delivery of secure, reliable software using agile methods. We
provide expert consulting, mentoring, and training in:
• Agile transformations, coaching, development
• Agile testing and automation
• DevOps and DevSecOps transformation and implementations
• DevOps engineering
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 3@armillz
Why is he here?
• Share some of my experiences (and failures) on a journey from “classic” enterprise monolithic
systems into the “utopia” of microservices architecture
• Show some patterns for delivering highly-buzzword-compliant, microservices-based software
applications
• Give you a reference to walk away with
• NOT: Explain fundamentals of DevOps (or Agile)
• NOT: Sell you on DevOps (or Agile), necessarily
WARNING: I do everything very fast. Try to keep up.
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 4@armillz
Microservices: utopia or nightmare?
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 5@armillz
Microservices are all the rage!
“Let’s take all of our busted monolithic systems and
split them up!” they said.
Successful microservices require a combination of
technical architecture, automation, and
development methodology that all relate closely to
Agile and DevOps
Without the right mix of these, things often don’t go
as well as you planned
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 6@armillz
Microservices in the non-ideal real world
• Federated services with hidden dependencies
• Independently changing applications, but ...
• Loosely coupled, unspecified, AND STILL-PRESENT dependencies
• Teams that don’t talk to each other
• Hide behind (poorly defined) APIs
• Freedom to move at their own pace
• Desire: Deploy small changes rapidly to production
• Problem: can’t figure out which versions work together, even in test environments
You have many things changing at different rates (fast vs. never) with
“decoupled” interfaces that are hard to verify independently
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 7@armillz
What you need
•Bring teams closer
•Continuously integrate services
•Deploy integrated services into various environments
•Frequently test still-monolithic system in pieces and as a whole
This looks suspiciously like a DevOps problem
Conclusion: your DevOps pipeline is critical to your success
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 9@armillz
Context:
Modern Microservices Example
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 10@armillz
Dozen-ish independent services acting as a federated product in a registration and workflow system
React/JS front-end UI, Java Spring Boot REST Services, PostgreSQL back-end
Service Architecture
NRPM
UI
REST API
DB
Page
Service
Case Mgmt
UI
REST API
DB
App Entry
UI
REST API
DB
V&A
UI
REST API
DB
Auth
UI
REST API
DB
Gateway
UI
REST API
DB
UI
PostgreSQL RDS instance in AWS
External
Services
REST API
REST API
REST API
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 13@armillz
DevOps Baseline – what do we mean?
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 14@armillz
A DevOps Solution Includes...
• Team structure and skill set across the delivery chain
• Infrastructure and tools to support automation and team collaboration
• Delivery pipeline to build, package, deploy, test for repositories and branches of code
• Test automation (lots and lots of it) capable of evaluating changes
... all wrapped up in a supporting Agile development methodology
Overall: the ability to deliver independent changes into a working
environment rapidly and reliability while maintaining a high quality
system
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 15@armillz
Pipeline Design: Patterns of Success
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 16@armillz
Pipeline defines delivery process
The software delivery process is automated through a CI/CD pipeline to deliver application
microservices into various test (and eventually production) environments
Continuous MonitoringContinuous Integration
BuildCode
Continuous Delivery
commit
DEV
TEST
PROD
Compile
Test
Package
Publish
Unit Test
Integration Test
Code coverage
Code Scanning
Static Analysis
Bugs
Vulnerabilities
Technical Debt
Package
Dependency
checking
Vulnerable
components
Deploy Test
Provision
Install
Configure
Vulnerability Scanning
Deployment verification
Smoke test
Manual Testing
- Exploratory
- UAT
Functional Testing
- Behavioral
- API
- Web UI
Non-Functional Testing
- Load/Performance
- Web Security
Platform
Vulnerabilities
Test Results Defects
Change Requests
Test Promote
Operate
Monitor
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 17@armillz
Pipeline links to branching strategy
•Strive for "main line" development
• Small changes are easy to build, test, deploy, AND FIX
• Use short, small feature branches for isolated changes
• Consider Github Flow (very simple), Git Flow (complex)
• Avoid "parallel release development" at all costs
•What problems does branching cause vs. solve?
•Delivery pipeline will align with branching
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 18@armillz
Pattern: minimalist branching delivery pattern
• Features – simple CI build with compile, static analysis, unit test
• Pull Request (merge request) – pre-merge with master, deploy to on-demand ephemeral
environment, run automated tests (more on tests later)
• Use peer review to investigate impact on other services
• Master – after successful merge, build and deploy to dev-staging environment, run more
tests, promote upwards
• Remember:
SMALLER IS BETTER
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 19@armillz
Foreshadowing: branch everything with the code
• Tenet of DevOps and CI/CD: version-control everything so you can automate
everything
• We will discuss a lot of different artifacts that match your application code
• Application code
• Build scripts
• Deployment scripts
• Database scripts
• Tests
• ... more
• All of these should be stored and branched as a related code base!
Stand by for station identification...
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 20@armillz
Pattern: independent pipelines
• Each service has it’s own pipeline (elsewhere: shared pipeline code)
• Example: use “Jenkinsfile” or localized build script configuration
• Major parts of the “independent” pipelines
• Compile
• Unit test
• Static analysis (security, quality, composition analysis)
• Packaging
• Integration testing ... Pre/post deployment
• Test deployment
• Is your service independently deployable?
• How much testing can you do?
• What are your dependencies? (and what will eventually depend on you?)
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 21@armillz
Pattern: pipeline should branch with code
• Your build/delivery process will evolve with the code
• Example: Build scripts ... historically always live with code (maven, gradle, ...)
• Your “pipeline” automation code should live with code, as well.
• Pattern: Use “pipeline as code” to define your pipeline automation
• NOT: Traditional complicated UI-driven multi-job monsters (more elsewhere)
• Store pipeline definition (e.g., “Jenkinsfile”) in repository with code
• New branches of code can have local build/test pipeline updates
• Similar for deployment and configuration scripts (more elsewhere)
• Ansible/Chef – playbooks and recipes change to address code changes (new
config parameters, etc.)
• Docker/Kubernetes/Helm – orchestration and deployment YAML for containers
adjust with code
Ideally, these live in the same code repository
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 22@armillz
Pipelines run in parallel
• Each of your independent service pipelines can (will) execute in parallel
• This can be very resource intensive – plan for it
• At some point, you need to deploy your code into an “environment”
• Will these be shared/mixed environments, or dedicated to the independent pipeline?
• Note: static environment can cause issues if you are changing multiple things simultaneously
• “Dynamic” environments become VERY beneficial...
App
A
W
B
C
D
App
A
W
B
C
D
Service “A”
Service “B”
App
A
W
B
C
D
- OR -
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 23@armillz
Pattern: dynamic on-demand environments
• Microservices can have high rates of change across many services
• This can continually disrupt shared/static environments as new services are updated
• The ability to launch a new environment with all supporting services becomes valuable
• Replicate current PROD (or other) version of services
• Deploy newly changed service into replica
• Test, test, test
• Seeding data becomes important for new copies
App A
W
B
C
D
App A
W
B
C
D
PROD Replica
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 26@armillz
Pipeline join points
• At some point, your pipelines come together and
services work in a combined environment
• You will need to deploy multiple services and make
them work together
• Need some snapshot of “versions” to know which
versions are where and how they are verified against
each other
• Options:
• extensions of independent pipelines
• ”join” jobs that deploy lots of things together
• Note: consider “locking” shared environment during
testing to avoid blips and test failures
App
A
W
B
C
D
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 28@armillz
Pattern: capturing a “product” version
• As your services progress through environments, it’s useful to know what versions of services
work with each other
• Your “promotion” mechanism might need to consider moving groups of services together
• Single service
• Group of known-good services
• This may identify your subsystem of coupled monoliths
• Capture versions of your services
• SHA, semver, whatever
• Pattern: typically capture in single “release inventory” file to feed to deployment automation scripts
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 30@armillz
Pattern: UI and REST service code integration
• Problem: UI invokes back-end services through APIs
• What happens when they need to change?
• How do you test these continuously?
• Similar to cross-service integration
• Scenario 1: Full-stack developers building UI and API
• Consider having UI and API code live together
• Aligns UI and API changes automatically
• Scenario 2: Separate UI and API teams (anti-pattern?)
• UI and API might change at different rates
• Need mechanism to alter/change APIs (deprecate, multiple versions, etc.)
• UI and API might be in different repositories
• This leads to cross-service testing issues (stay tuned for a few more slides...)
App
Aw
W
Bw
Cw
Dw
A
B
C
D
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 35@armillz
Ensuring quality (aka: testing)
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 36@armillz
Your efforts in DevOps (and microservices)
will fail without proper automated testing
and assessment that is fully integrated into
the pipeline.
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 38@armillz
Test factors to consider with microservices
• Take every opportunity you can to test the code
• This will enable rapid changes throughout business cycle
• Testing paths to consider
• Testing in isolation (totally in your control)
• verify what you think your contract is
• Testing with downstream dependencies (database, other services)
• What else do you need to work properly?
• Verify what you think other contracts are
• Testing with upstream dependencies (UI, other services)
• Who needs YOU to work properly?
• Verify what other people think your contract (actually) is
• ”The Pipeline” needs enough global knowledge to orchestrate this
Pathological case: what happens when APIs change unexpectedly or don’t
fulfill their (poorly specified) contracts?
App
W
B
D
A
C
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 40@armillz
Pattern: tests live with code and pipeline
•Tests for microservices should live with the microservice code
• Unit tests ... part of code tree (e.g., junit) ... Duh!
• Automated REST tests ... part of code repository (Postman, REST Assured, ...)
• UI tests ... part of UI repository (Selenium, ...)
•This allows you to easily match code version to test version
Pro tip: bundling tests in a docker container makes them easy for anyone
to execute
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 41@armillz
Challenge: cross-service and cross-branch testing
• Major problem: multiple services (e.g., UI or multiple APIs) need similar linked
changes
• How do I implement this?
• Code based solutions (feature flags, API versions, ...)
• Deployment based solutions (concurrent running service versions)
• More important: how do I test this?
• Will depend on your implementation
• May require the ability to link changes between services/repositories
App
A’
W
B
C’
D
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 42@armillz
Pattern: testing simultaneous changes
• Deploy and execute simultaneous branch and cross-service testing
• Example: specify multiple builds or deployment versions during test environment creation
• Build/deploy multiple changed versions into same environment
• Minimize concurrent versions to avoid integration problems
• Force the integration problems as soon as possible
• Anti-pattern: multiple versions of all APIs deployed everywhere
• How do you wire them together?
• Do you have to develop parallel versions? ß torture
App
A’
W
B
C’
D
App
A’
W
B
C’
D
A
?
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 43@armillz
Important Non-Pipeline Aspects
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 44@armillz
Importance of team structure and communication
• Teams must align with delivery process (and Conway’s law)
• Your teams are likely part of a shared product
• If not: great! Rock on with your independence!
• If so, don’t pretend to be separate
• Example: ever had problems with remote, isolated vendors?
• Communicate with each other!
• Regardless, you will likely have shared patterns (devops, testing, architecture) that can be
leveraged to avoid re-inventing the wheel in your enterprise
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 45@armillz
Example “DevOps” product team structure
Our team organization on a 50-ish person development project
Important for the vertical development teams to actually work with each other (painful at first)
Horizontal Teams
DevOps Engr
DevOps Lead
Platform Engr
Platform Lead
Platform Engr Security
Security
Security
Performance
Performance
Agile Vertical Team
Scrum master
DevOps Engr
Biz Analyst
Agile Tester
Front End
Full Stack
Agile Vertical Team
Scrum master
DevOps Engr
Biz Analyst
Agile Tester
Front End
Full Stack
Agile Vertical Team
Scrum master
DevOps Engr
Biz Analyst
Agile Tester
Front End
Full Stack
Agile Vertical Team
Scrum master
DevOps Engr
Biz Analyst
Agile Tester
Front End
Full Stack
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 46@armillz
Integrating with software architecture
• Not all software lends itself to easy build, test, and deployment
• Work directly with software architecture and development teams
• Meaningful, testable service architecture is critical
• Each software service must support:
• Rapid build
• Automated test (controllability, observability) – between services
• Data initialization
• Installation/configuration
• Monitoring/metrics
• Cross-service debugging
• Standards and "Definition of Done" should reflect this
• Development stories aren’t complete until all these things work
• Keep product value and cross-service features in mind
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 48@armillz
Take-aways
• Version control everything, automate everything
• Your pipeline implements your branching strategy
• Independent pipelines with join points
• Use dynamic environments (containers!)
• Store and branch everything together – code, tests, database, pipeline code
• Test in isolation, test with downstream, and test with upstream
• Use shared/central pipeline libraries to avoid duplication and enforce standards
• And don’t forget:
WORK TOGETHER, DAMMIT!
© COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 49@armillz
Questions?
Thank you!
rich.mills@coveros.com
@armillz
https://www.coveros.com/services/devops/

Contenu connexe

Tendances

From ci to cd - LavaJug 2012
From ci to cd  - LavaJug 2012From ci to cd  - LavaJug 2012
From ci to cd - LavaJug 2012
Henri Gomez
 
Microservice Scars - Alt.net 2hr
Microservice Scars - Alt.net 2hrMicroservice Scars - Alt.net 2hr
Microservice Scars - Alt.net 2hr
Joshua Toth
 

Tendances (20)

DevOps For Everyone: Bringing DevOps Success to Every App and Every Role in y...
DevOps For Everyone: Bringing DevOps Success to Every App and Every Role in y...DevOps For Everyone: Bringing DevOps Success to Every App and Every Role in y...
DevOps For Everyone: Bringing DevOps Success to Every App and Every Role in y...
 
Why to Cloud Native
Why to Cloud NativeWhy to Cloud Native
Why to Cloud Native
 
From ci to cd - LavaJug 2012
From ci to cd  - LavaJug 2012From ci to cd  - LavaJug 2012
From ci to cd - LavaJug 2012
 
Keynote: Software Kept Eating the World (Pivotal Cloud Platform Roadshow)
Keynote: Software Kept Eating the World (Pivotal Cloud Platform Roadshow)Keynote: Software Kept Eating the World (Pivotal Cloud Platform Roadshow)
Keynote: Software Kept Eating the World (Pivotal Cloud Platform Roadshow)
 
Cloud Native Patterns with Bluemix Developer Console
Cloud Native Patterns with Bluemix Developer ConsoleCloud Native Patterns with Bluemix Developer Console
Cloud Native Patterns with Bluemix Developer Console
 
Driving Enterprise Architecture Redesign: Cloud-Native Platforms, APIs, and D...
Driving Enterprise Architecture Redesign: Cloud-Native Platforms, APIs, and D...Driving Enterprise Architecture Redesign: Cloud-Native Platforms, APIs, and D...
Driving Enterprise Architecture Redesign: Cloud-Native Platforms, APIs, and D...
 
App Development Evolution: What has changed?
App Development Evolution: What has changed? App Development Evolution: What has changed?
App Development Evolution: What has changed?
 
The Muda, Mura and Muri of DevOps
The Muda, Mura and Muri of DevOpsThe Muda, Mura and Muri of DevOps
The Muda, Mura and Muri of DevOps
 
From Apollo 13 to Google SRE
From Apollo 13 to Google SREFrom Apollo 13 to Google SRE
From Apollo 13 to Google SRE
 
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps – What EXACTLY Does that Mean for Spring Deve...
 
Building next gen applications and microservices
Building next gen applications and microservicesBuilding next gen applications and microservices
Building next gen applications and microservices
 
Digital Disruption with DevOps - Reference Architecture Overview
Digital Disruption with DevOps - Reference Architecture OverviewDigital Disruption with DevOps - Reference Architecture Overview
Digital Disruption with DevOps - Reference Architecture Overview
 
Hybrid Cloud DevOps with Apprenda and UrbanCode Deploy
Hybrid Cloud DevOps with Apprenda and UrbanCode DeployHybrid Cloud DevOps with Apprenda and UrbanCode Deploy
Hybrid Cloud DevOps with Apprenda and UrbanCode Deploy
 
IBM Think 2020 Openshift on IBM Z and LinuxONE
IBM Think 2020 Openshift on IBM Z and LinuxONEIBM Think 2020 Openshift on IBM Z and LinuxONE
IBM Think 2020 Openshift on IBM Z and LinuxONE
 
Microservice Scars - Alt.net 2hr
Microservice Scars - Alt.net 2hrMicroservice Scars - Alt.net 2hr
Microservice Scars - Alt.net 2hr
 
Red Hhat Summit 2017 : Love Containers, Love Devops, Love Openshift, Where's ...
Red Hhat Summit 2017 : Love Containers, Love Devops, Love Openshift, Where's ...Red Hhat Summit 2017 : Love Containers, Love Devops, Love Openshift, Where's ...
Red Hhat Summit 2017 : Love Containers, Love Devops, Love Openshift, Where's ...
 
Enterprise DevOps: Scaling Build, Deploy, Test, Release
Enterprise DevOps: Scaling Build, Deploy, Test, ReleaseEnterprise DevOps: Scaling Build, Deploy, Test, Release
Enterprise DevOps: Scaling Build, Deploy, Test, Release
 
Modern application development with heroku
Modern application development with herokuModern application development with heroku
Modern application development with heroku
 
Dockercon State of the Art in Microservices
Dockercon State of the Art in MicroservicesDockercon State of the Art in Microservices
Dockercon State of the Art in Microservices
 
Software development in the modern age
Software development in the modern ageSoftware development in the modern age
Software development in the modern age
 

Similaire à DevOps Patterns to Enable Success in Microservices

Cloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
Cloud Foundry and Microservices: A Mutualistic Symbiotic RelationshipCloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
Cloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
VMware Tanzu
 
Cloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
Cloud Foundry and Microservices: A Mutualistic Symbiotic RelationshipCloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
Cloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
Matt Stine
 
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
Daniel Berg
 

Similaire à DevOps Patterns to Enable Success in Microservices (20)

Cloud Foundry Technical Overview at IBM Interconnect 2016
Cloud Foundry Technical Overview at IBM Interconnect 2016Cloud Foundry Technical Overview at IBM Interconnect 2016
Cloud Foundry Technical Overview at IBM Interconnect 2016
 
Made for Each Other: Microservices + PaaS
Made for Each Other: Microservices + PaaSMade for Each Other: Microservices + PaaS
Made for Each Other: Microservices + PaaS
 
Engineering DevOps and Cloud
Engineering DevOps and CloudEngineering DevOps and Cloud
Engineering DevOps and Cloud
 
Navigating the service mesh landscape with Istio, Consul Connect, and Linkerd
Navigating the service mesh landscape with Istio, Consul Connect, and LinkerdNavigating the service mesh landscape with Istio, Consul Connect, and Linkerd
Navigating the service mesh landscape with Istio, Consul Connect, and Linkerd
 
DevOps for Enterprise Systems : Innovate like a Startup
DevOps for Enterprise Systems : Innovate like a StartupDevOps for Enterprise Systems : Innovate like a Startup
DevOps for Enterprise Systems : Innovate like a Startup
 
Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)
Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)
Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)
 
Agile DevOps Transformation At HUD (AgileDC 2017)
Agile DevOps Transformation At HUD (AgileDC 2017)Agile DevOps Transformation At HUD (AgileDC 2017)
Agile DevOps Transformation At HUD (AgileDC 2017)
 
AWS Initiate Day Dublin 2019 – Breaking down the Monoliths
AWS Initiate Day Dublin 2019 – Breaking down the MonolithsAWS Initiate Day Dublin 2019 – Breaking down the Monoliths
AWS Initiate Day Dublin 2019 – Breaking down the Monoliths
 
Cloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
Cloud Foundry and Microservices: A Mutualistic Symbiotic RelationshipCloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
Cloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
 
Cloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
Cloud Foundry and Microservices: A Mutualistic Symbiotic RelationshipCloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
Cloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
 
Service-mesh options with Linkerd, Consul, Istio and AWS AppMesh
Service-mesh options with Linkerd, Consul, Istio and AWS AppMeshService-mesh options with Linkerd, Consul, Istio and AWS AppMesh
Service-mesh options with Linkerd, Consul, Istio and AWS AppMesh
 
Build 12-Factor apps with Docker
Build 12-Factor apps with DockerBuild 12-Factor apps with Docker
Build 12-Factor apps with Docker
 
GitOps, Jenkins X &Future of CI/CD
GitOps, Jenkins X &Future of CI/CDGitOps, Jenkins X &Future of CI/CD
GitOps, Jenkins X &Future of CI/CD
 
Diving Into Docker
Diving Into Docker Diving Into Docker
Diving Into Docker
 
Technology insights: Decision Science Platform
Technology insights: Decision Science PlatformTechnology insights: Decision Science Platform
Technology insights: Decision Science Platform
 
Choosing the right business model and license - OW2con'19, June 12-13, 2019, ...
Choosing the right business model and license - OW2con'19, June 12-13, 2019, ...Choosing the right business model and license - OW2con'19, June 12-13, 2019, ...
Choosing the right business model and license - OW2con'19, June 12-13, 2019, ...
 
First Caracas MuleSoft Meetup Slides
First Caracas MuleSoft Meetup SlidesFirst Caracas MuleSoft Meetup Slides
First Caracas MuleSoft Meetup Slides
 
Containers, microservices and serverless for realists
Containers, microservices and serverless for realistsContainers, microservices and serverless for realists
Containers, microservices and serverless for realists
 
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
InterConnect 2015: 3045 Hybrid Cloud - How to get a return from an investment...
 
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
NUS-ISS Learning Day 2018- Designing software to make the most of cloud platf...
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+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@
 

Dernier (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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?
 
+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...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

DevOps Patterns to Enable Success in Microservices

  • 1. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 1@armillz DevOps Patterns to Enable Success with Microservices Richard Mills DevOps Solution Architect, Coveros Inc. rich.mills@coveros.com @armillz
  • 2. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 2@armillz Who is this guy? • Me: Mad-Software-Developer turned Mad-Software-Engineer turned DevOps-Solution-Architect. Pragmatist. Particular focus on tools and automation. CI, CD, Agile, DevOps … what’s next? • PS: Thanks for inventing the term “DevOps” to describe what I like to do. • Pays my bills: Coveros helps organizations accelerate the delivery of secure, reliable software using agile methods. We provide expert consulting, mentoring, and training in: • Agile transformations, coaching, development • Agile testing and automation • DevOps and DevSecOps transformation and implementations • DevOps engineering
  • 3. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 3@armillz Why is he here? • Share some of my experiences (and failures) on a journey from “classic” enterprise monolithic systems into the “utopia” of microservices architecture • Show some patterns for delivering highly-buzzword-compliant, microservices-based software applications • Give you a reference to walk away with • NOT: Explain fundamentals of DevOps (or Agile) • NOT: Sell you on DevOps (or Agile), necessarily WARNING: I do everything very fast. Try to keep up.
  • 4. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 4@armillz Microservices: utopia or nightmare?
  • 5. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 5@armillz Microservices are all the rage! “Let’s take all of our busted monolithic systems and split them up!” they said. Successful microservices require a combination of technical architecture, automation, and development methodology that all relate closely to Agile and DevOps Without the right mix of these, things often don’t go as well as you planned
  • 6. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 6@armillz Microservices in the non-ideal real world • Federated services with hidden dependencies • Independently changing applications, but ... • Loosely coupled, unspecified, AND STILL-PRESENT dependencies • Teams that don’t talk to each other • Hide behind (poorly defined) APIs • Freedom to move at their own pace • Desire: Deploy small changes rapidly to production • Problem: can’t figure out which versions work together, even in test environments You have many things changing at different rates (fast vs. never) with “decoupled” interfaces that are hard to verify independently
  • 7. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 7@armillz What you need •Bring teams closer •Continuously integrate services •Deploy integrated services into various environments •Frequently test still-monolithic system in pieces and as a whole This looks suspiciously like a DevOps problem Conclusion: your DevOps pipeline is critical to your success
  • 8. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 9@armillz Context: Modern Microservices Example
  • 9. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 10@armillz Dozen-ish independent services acting as a federated product in a registration and workflow system React/JS front-end UI, Java Spring Boot REST Services, PostgreSQL back-end Service Architecture NRPM UI REST API DB Page Service Case Mgmt UI REST API DB App Entry UI REST API DB V&A UI REST API DB Auth UI REST API DB Gateway UI REST API DB UI PostgreSQL RDS instance in AWS External Services REST API REST API REST API
  • 10. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 13@armillz DevOps Baseline – what do we mean?
  • 11. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 14@armillz A DevOps Solution Includes... • Team structure and skill set across the delivery chain • Infrastructure and tools to support automation and team collaboration • Delivery pipeline to build, package, deploy, test for repositories and branches of code • Test automation (lots and lots of it) capable of evaluating changes ... all wrapped up in a supporting Agile development methodology Overall: the ability to deliver independent changes into a working environment rapidly and reliability while maintaining a high quality system
  • 12. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 15@armillz Pipeline Design: Patterns of Success
  • 13. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 16@armillz Pipeline defines delivery process The software delivery process is automated through a CI/CD pipeline to deliver application microservices into various test (and eventually production) environments Continuous MonitoringContinuous Integration BuildCode Continuous Delivery commit DEV TEST PROD Compile Test Package Publish Unit Test Integration Test Code coverage Code Scanning Static Analysis Bugs Vulnerabilities Technical Debt Package Dependency checking Vulnerable components Deploy Test Provision Install Configure Vulnerability Scanning Deployment verification Smoke test Manual Testing - Exploratory - UAT Functional Testing - Behavioral - API - Web UI Non-Functional Testing - Load/Performance - Web Security Platform Vulnerabilities Test Results Defects Change Requests Test Promote Operate Monitor
  • 14. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 17@armillz Pipeline links to branching strategy •Strive for "main line" development • Small changes are easy to build, test, deploy, AND FIX • Use short, small feature branches for isolated changes • Consider Github Flow (very simple), Git Flow (complex) • Avoid "parallel release development" at all costs •What problems does branching cause vs. solve? •Delivery pipeline will align with branching
  • 15. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 18@armillz Pattern: minimalist branching delivery pattern • Features – simple CI build with compile, static analysis, unit test • Pull Request (merge request) – pre-merge with master, deploy to on-demand ephemeral environment, run automated tests (more on tests later) • Use peer review to investigate impact on other services • Master – after successful merge, build and deploy to dev-staging environment, run more tests, promote upwards • Remember: SMALLER IS BETTER
  • 16. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 19@armillz Foreshadowing: branch everything with the code • Tenet of DevOps and CI/CD: version-control everything so you can automate everything • We will discuss a lot of different artifacts that match your application code • Application code • Build scripts • Deployment scripts • Database scripts • Tests • ... more • All of these should be stored and branched as a related code base! Stand by for station identification...
  • 17. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 20@armillz Pattern: independent pipelines • Each service has it’s own pipeline (elsewhere: shared pipeline code) • Example: use “Jenkinsfile” or localized build script configuration • Major parts of the “independent” pipelines • Compile • Unit test • Static analysis (security, quality, composition analysis) • Packaging • Integration testing ... Pre/post deployment • Test deployment • Is your service independently deployable? • How much testing can you do? • What are your dependencies? (and what will eventually depend on you?)
  • 18. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 21@armillz Pattern: pipeline should branch with code • Your build/delivery process will evolve with the code • Example: Build scripts ... historically always live with code (maven, gradle, ...) • Your “pipeline” automation code should live with code, as well. • Pattern: Use “pipeline as code” to define your pipeline automation • NOT: Traditional complicated UI-driven multi-job monsters (more elsewhere) • Store pipeline definition (e.g., “Jenkinsfile”) in repository with code • New branches of code can have local build/test pipeline updates • Similar for deployment and configuration scripts (more elsewhere) • Ansible/Chef – playbooks and recipes change to address code changes (new config parameters, etc.) • Docker/Kubernetes/Helm – orchestration and deployment YAML for containers adjust with code Ideally, these live in the same code repository
  • 19. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 22@armillz Pipelines run in parallel • Each of your independent service pipelines can (will) execute in parallel • This can be very resource intensive – plan for it • At some point, you need to deploy your code into an “environment” • Will these be shared/mixed environments, or dedicated to the independent pipeline? • Note: static environment can cause issues if you are changing multiple things simultaneously • “Dynamic” environments become VERY beneficial... App A W B C D App A W B C D Service “A” Service “B” App A W B C D - OR -
  • 20. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 23@armillz Pattern: dynamic on-demand environments • Microservices can have high rates of change across many services • This can continually disrupt shared/static environments as new services are updated • The ability to launch a new environment with all supporting services becomes valuable • Replicate current PROD (or other) version of services • Deploy newly changed service into replica • Test, test, test • Seeding data becomes important for new copies App A W B C D App A W B C D PROD Replica
  • 21. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 26@armillz Pipeline join points • At some point, your pipelines come together and services work in a combined environment • You will need to deploy multiple services and make them work together • Need some snapshot of “versions” to know which versions are where and how they are verified against each other • Options: • extensions of independent pipelines • ”join” jobs that deploy lots of things together • Note: consider “locking” shared environment during testing to avoid blips and test failures App A W B C D
  • 22. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 28@armillz Pattern: capturing a “product” version • As your services progress through environments, it’s useful to know what versions of services work with each other • Your “promotion” mechanism might need to consider moving groups of services together • Single service • Group of known-good services • This may identify your subsystem of coupled monoliths • Capture versions of your services • SHA, semver, whatever • Pattern: typically capture in single “release inventory” file to feed to deployment automation scripts
  • 23. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 30@armillz Pattern: UI and REST service code integration • Problem: UI invokes back-end services through APIs • What happens when they need to change? • How do you test these continuously? • Similar to cross-service integration • Scenario 1: Full-stack developers building UI and API • Consider having UI and API code live together • Aligns UI and API changes automatically • Scenario 2: Separate UI and API teams (anti-pattern?) • UI and API might change at different rates • Need mechanism to alter/change APIs (deprecate, multiple versions, etc.) • UI and API might be in different repositories • This leads to cross-service testing issues (stay tuned for a few more slides...) App Aw W Bw Cw Dw A B C D
  • 24. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 35@armillz Ensuring quality (aka: testing)
  • 25. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 36@armillz Your efforts in DevOps (and microservices) will fail without proper automated testing and assessment that is fully integrated into the pipeline.
  • 26. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 38@armillz Test factors to consider with microservices • Take every opportunity you can to test the code • This will enable rapid changes throughout business cycle • Testing paths to consider • Testing in isolation (totally in your control) • verify what you think your contract is • Testing with downstream dependencies (database, other services) • What else do you need to work properly? • Verify what you think other contracts are • Testing with upstream dependencies (UI, other services) • Who needs YOU to work properly? • Verify what other people think your contract (actually) is • ”The Pipeline” needs enough global knowledge to orchestrate this Pathological case: what happens when APIs change unexpectedly or don’t fulfill their (poorly specified) contracts? App W B D A C
  • 27. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 40@armillz Pattern: tests live with code and pipeline •Tests for microservices should live with the microservice code • Unit tests ... part of code tree (e.g., junit) ... Duh! • Automated REST tests ... part of code repository (Postman, REST Assured, ...) • UI tests ... part of UI repository (Selenium, ...) •This allows you to easily match code version to test version Pro tip: bundling tests in a docker container makes them easy for anyone to execute
  • 28. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 41@armillz Challenge: cross-service and cross-branch testing • Major problem: multiple services (e.g., UI or multiple APIs) need similar linked changes • How do I implement this? • Code based solutions (feature flags, API versions, ...) • Deployment based solutions (concurrent running service versions) • More important: how do I test this? • Will depend on your implementation • May require the ability to link changes between services/repositories App A’ W B C’ D
  • 29. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 42@armillz Pattern: testing simultaneous changes • Deploy and execute simultaneous branch and cross-service testing • Example: specify multiple builds or deployment versions during test environment creation • Build/deploy multiple changed versions into same environment • Minimize concurrent versions to avoid integration problems • Force the integration problems as soon as possible • Anti-pattern: multiple versions of all APIs deployed everywhere • How do you wire them together? • Do you have to develop parallel versions? ß torture App A’ W B C’ D App A’ W B C’ D A ?
  • 30. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 43@armillz Important Non-Pipeline Aspects
  • 31. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 44@armillz Importance of team structure and communication • Teams must align with delivery process (and Conway’s law) • Your teams are likely part of a shared product • If not: great! Rock on with your independence! • If so, don’t pretend to be separate • Example: ever had problems with remote, isolated vendors? • Communicate with each other! • Regardless, you will likely have shared patterns (devops, testing, architecture) that can be leveraged to avoid re-inventing the wheel in your enterprise
  • 32. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 45@armillz Example “DevOps” product team structure Our team organization on a 50-ish person development project Important for the vertical development teams to actually work with each other (painful at first) Horizontal Teams DevOps Engr DevOps Lead Platform Engr Platform Lead Platform Engr Security Security Security Performance Performance Agile Vertical Team Scrum master DevOps Engr Biz Analyst Agile Tester Front End Full Stack Agile Vertical Team Scrum master DevOps Engr Biz Analyst Agile Tester Front End Full Stack Agile Vertical Team Scrum master DevOps Engr Biz Analyst Agile Tester Front End Full Stack Agile Vertical Team Scrum master DevOps Engr Biz Analyst Agile Tester Front End Full Stack
  • 33. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 46@armillz Integrating with software architecture • Not all software lends itself to easy build, test, and deployment • Work directly with software architecture and development teams • Meaningful, testable service architecture is critical • Each software service must support: • Rapid build • Automated test (controllability, observability) – between services • Data initialization • Installation/configuration • Monitoring/metrics • Cross-service debugging • Standards and "Definition of Done" should reflect this • Development stories aren’t complete until all these things work • Keep product value and cross-service features in mind
  • 34. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 48@armillz Take-aways • Version control everything, automate everything • Your pipeline implements your branching strategy • Independent pipelines with join points • Use dynamic environments (containers!) • Store and branch everything together – code, tests, database, pipeline code • Test in isolation, test with downstream, and test with upstream • Use shared/central pipeline libraries to avoid duplication and enforce standards • And don’t forget: WORK TOGETHER, DAMMIT!
  • 35. © COPYRIGHT 2019 COVEROS, INC. ALL RIGHTS RESERVED. 49@armillz Questions? Thank you! rich.mills@coveros.com @armillz https://www.coveros.com/services/devops/