Modern CI/CD in the microservices world with Kubernetes

Mikalai Alimenkou
Mikalai AlimenkouIndependent Consultant at XP Injection
Modern CI/CD in the
microservices world with
Kubernetes
Mikalai Alimenkou
@xpinjection
https://t.me/xpinjection_channel
https://xpinjection.com
Modern CI/CD in the microservices world with Kubernetes
Telegram channel
https://t.me/xpinjection_channel
Disclaimer
This talk is based on
personal experience
Hello world samples on conferences
Real world is a little bit more complex
CI/CD of the son of your mother’s friend
After moving to its own cloud, Amazon engineers
deploy code every 11.7 seconds, on average
reducing both the number and duration of outages
at the same time.
Why this is not your case?
Product is developed in iterative way (Scrum, 2 weeks)
Engineering culture is far from perfect
Level of developers is not so high
No big investments in test automation at all levels
Engineering practices are not used on regular basis
Legacy services or dependencies
Business is not ready to continuous delivery
… many more reasons
Chaos deployment in DEV/QA
QA/DEV environment always contain latest versions of
all microservices
Deployment on QA/DEV is done continuously by
different dev teams when something is ‘READY’
Compatibility of microservices is not verified
There is no way to rollback on specific system version
QA life looks like a hell (random issues, non-
reproducible results, 500 HTTP codes everywhere,
chaos testing)
Does it look familiar to you?
Old monolith mindset doesn’t work
Microservices has their own lifecycles
Difference between CI and CD
Step #1: Dockerize your microservices
Immutable infrastructure principle
Artifacts promotion with tags
Unified blocks for CD stage, no dependency on
technical stack
Simplified deployment and environment management
Common configuration approach
Efficient resources utilization
Modern CI/CD in the microservices world with Kubernetes
Step #2: Specify versioning policy
Semantic versioning as a basis
Major version for API breaking changes or major
service release
Minor version corresponds to current dev iteration
Patch version is reserved for hot fixes
Commit hash as suffix to snapshot versioning and
tracing
Build date as an additional optional suffix
CI pipeline for each microservice
QUALITY GATES:
- Unit tests
- Integration tests
- Static code analysis
- API tests
- Contract tests
- Security checks
- … FULL VERSION: 2.3.0-350fca-20200218
What is shippable version of the system?
Step #3: Introduce compatibility sets
Store full list of compatible microservices as dedicated
artifact
VCS provides historical timeline, rollback, full tracing
Used as primary artifact for Continuous Delivery
Promoted between different environments in CD
pipeline (dev, qa, stage, prod)
Add middleware versions for full compatibility set
Compatibility set in properties file
Clear logical versions management independent from
concrete deployment technologies
Flexible usage for different purposes
Separation between deployment artifacts versioning
Customization step before deployment
Compatibility set in Helm/helmfile
Single versioned storage for environment configuration
Ability to specify compatibility on configuration level
The same toolset is used for all environments
Additional level of abstraction around K8S manifests
Helm is needed as an additional component
Step #4: Implement system level pipeline
Triggered when new candidate is built
Uses latest compatible set as a baseline
Overrides versions for ALL pending candidates
Creates new environment for system deployment
Deploys all microservices according to their versions
Waits for all health checks to become OK
Runs system level quality gates
Stores new compatibility set in case of SUCCESS
Retag and promote artifacts for the next stage
System pipeline for compatibility checks
QUALITY GATES:
- Health checks
- Smoke API tests
- Smoke UI tests
- Smoke system tests
- Smoke security tests
- …
ADDITIONAL TAGS: qa-ready, set-283gpt
Example from the real life
USER SERVICE
1.0.3-abc
EVENT SERVICE
1.0.0-cde
SCHEDULE SERVICE
0.9.1-fgh
COMPATIBLE SET
1.0.3-prs
NEW CANDIDATE
1.0.0-cde
1.0.3-prs
0.9.1-fgh
FAILED SYSTEM BUILD
1.0.1-tuv
FIX APPLIED
1.0.3-prs
0.9.1-fgh
SUCCESS SYSTEM BUILD
1.0.1-tuv
1.0.3-prs
1.0.1-tuv
0.9.1-fgh
COMPATIBLE SET
System pipeline: important notes
If pipeline fails, then candidate is not approved and it's
artifact is invisible for other environments, but pending
for the next pipeline run
Every build takes ALL available pending candidates
Different concurrency strategies may be applied:
• single build with lock on compatibility set
• concurrent builds with “last win” approach
• concurrent builds with optimistic locking in VSC
We are almost GitOps ready now!
New tools become available for CD
Step #5: Implement deployment pipeline
Triggered manually, automatically by successful system
pipeline build or by specific schedule
Predefined set of environments (dev, qa, stage, prod)
New environment may be created with specified or
generated name
Only appropriate compatible sets may be deployed
Environment TTL could be set manually or smart
default value is applied
Full CI/CD
cycle
FEATURE BRANCH PIPELINE:
- Environment name equals to feature branch name
- Reused to speed up development
- DEV compatibility set is used as a baseline
- Artifacts on microservices pipeline are tagged with branch name
- For each microservice latest available version from the branch
with the same name is used as candidate
PULL REQUEST PIPELINE:
- Triggered on each PR
- Special flag to activate system
level quality gates
- DEV compatibility set is used
as a baseline
- Only light system level quality
gates are run
- No compatibility sets updated
Modern CI/CD in the microservices world with Kubernetes
It is time for Kubernetes to show up!
Step #6: Speed up environments in K8S
Create dedicated namespace for each environment
Configure minimal limits and scale factors everywhere
Share common external heavy resources (DB,
Elasticsearch, Redis, Kafka, etc.)
Invest in performant K8S nodes
Use prepopulated images with data to speed up
Configure common observability tools
Reuse environments where possible with smart TTLs
Destroy environments asynchronously
Use full power of K8S namespaces
COMMON
Glossary
Service
Redis
Cache
FB-243
User
Service
Reuse
from DEV
STAGE
User
Service
Event
Service
Schedule
Service
Reuse
from DEV
QA
User
Service
Event
Service
Schedule
Service
DEV
User
Service
Event
Service
Schedule
Service
RDBMS
Kafka
Cluster Elasticsearch
How to share common resources?
It is really important to follow cloud-native 12 factors!
Redis via key prefixes or databases
RDBMS via databases or schemas
Kafka via common topics prefix
Elasticsearch via indexes
Now developers could use Skaffold continuously
QC is shifted as left as possible
Several teams could develop in common environment
Step #7: Start using K8S native CD tools
Dockerize tests with required test environment
Execute tests as K8S jobs
Manage test infrastructure in K8S
Choose suitable K8S native CD tool
Summary and take aways
Dockerize your microservices
Specify versioning policy
Introduce compatibility sets
Implement system level pipeline
Implement deployment pipeline
Speed up environments in K8S
Start using K8S native CD tools
Enjoy your life in amazing CI/CD world!
@xpinjection
https://xpinjection.com
https://t.me/xpinjection_channel
1 of 39

Recommended

Azure DevOps by
Azure DevOpsAzure DevOps
Azure DevOpsJuan Fabian
33.3K views52 slides
Azure DevOps Presentation by
Azure DevOps PresentationAzure DevOps Presentation
Azure DevOps PresentationInCycleSoftware
9.6K views36 slides
Deploy 22 microservices from scratch in 30 mins with GitOps by
Deploy 22 microservices from scratch in 30 mins with GitOpsDeploy 22 microservices from scratch in 30 mins with GitOps
Deploy 22 microservices from scratch in 30 mins with GitOpsOpsta
205 views46 slides
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train... by
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...Simplilearn
2.3K views106 slides
DevOps by
DevOps DevOps
DevOps Hakan Yüksel
1.1K views6 slides
Vmware Tanzu Kubernetes Connect(Spanish) by
Vmware Tanzu Kubernetes Connect(Spanish)Vmware Tanzu Kubernetes Connect(Spanish)
Vmware Tanzu Kubernetes Connect(Spanish)GabrielaRodriguez182401
134 views51 slides

More Related Content

What's hot

What Is DevOps? | Introduction To DevOps | DevOps Tools | DevOps Tutorial | D... by
What Is DevOps? | Introduction To DevOps | DevOps Tools | DevOps Tutorial | D...What Is DevOps? | Introduction To DevOps | DevOps Tools | DevOps Tutorial | D...
What Is DevOps? | Introduction To DevOps | DevOps Tools | DevOps Tutorial | D...Edureka!
2.9K views9 slides
DevOps by
DevOpsDevOps
DevOpsGehad Elsayed
1.4K views42 slides
DevOps introduction by
DevOps introductionDevOps introduction
DevOps introductionSridhara T V
569 views36 slides
Introduction to DevOps | Edureka by
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | EdurekaEdureka!
1.5K views32 slides
Secure Spring Boot Microservices with Keycloak by
Secure Spring Boot Microservices with KeycloakSecure Spring Boot Microservices with Keycloak
Secure Spring Boot Microservices with KeycloakRed Hat Developers
5.8K views18 slides
Introduction to Nginx by
Introduction to NginxIntroduction to Nginx
Introduction to NginxKnoldus Inc.
6.5K views18 slides

What's hot(20)

What Is DevOps? | Introduction To DevOps | DevOps Tools | DevOps Tutorial | D... by Edureka!
What Is DevOps? | Introduction To DevOps | DevOps Tools | DevOps Tutorial | D...What Is DevOps? | Introduction To DevOps | DevOps Tools | DevOps Tutorial | D...
What Is DevOps? | Introduction To DevOps | DevOps Tools | DevOps Tutorial | D...
Edureka!2.9K views
Introduction to DevOps | Edureka by Edureka!
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
Edureka!1.5K views
Secure Spring Boot Microservices with Keycloak by Red Hat Developers
Secure Spring Boot Microservices with KeycloakSecure Spring Boot Microservices with Keycloak
Secure Spring Boot Microservices with Keycloak
Red Hat Developers5.8K views
Introduction to Nginx by Knoldus Inc.
Introduction to NginxIntroduction to Nginx
Introduction to Nginx
Knoldus Inc.6.5K views
Microsoft DevOps Solution - DevOps by Chetan Gordhan
Microsoft DevOps Solution - DevOps  Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps
Chetan Gordhan709 views
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp... by Edureka!
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...
Edureka!531 views
Managing Infrastructure as a Product - Introduction to Platform Engineering by Adityo Pratomo
Managing Infrastructure as a Product - Introduction to Platform EngineeringManaging Infrastructure as a Product - Introduction to Platform Engineering
Managing Infrastructure as a Product - Introduction to Platform Engineering
Adityo Pratomo242 views
Building secure applications with keycloak by Abhishek Koserwal
Building secure applications with keycloak Building secure applications with keycloak
Building secure applications with keycloak
Abhishek Koserwal7.9K views
DevOps Powerpoint Presentation Slides by SlideTeam
DevOps Powerpoint Presentation SlidesDevOps Powerpoint Presentation Slides
DevOps Powerpoint Presentation Slides
SlideTeam5.6K views
FedScoop Public Sector Innovation Summit DOD Enterprise DevSecOps Initiative ... by scoopnewsgroup
FedScoop Public Sector Innovation Summit DOD Enterprise DevSecOps Initiative ...FedScoop Public Sector Innovation Summit DOD Enterprise DevSecOps Initiative ...
FedScoop Public Sector Innovation Summit DOD Enterprise DevSecOps Initiative ...
scoopnewsgroup1.3K views
High level design document template by anosha jamshed
High level design document templateHigh level design document template
High level design document template
anosha jamshed14.5K views
ABN AMRO DevSecOps Journey by Derek E. Weeks
ABN AMRO DevSecOps JourneyABN AMRO DevSecOps Journey
ABN AMRO DevSecOps Journey
Derek E. Weeks1.4K views
Dev ops != Dev+Ops by Shalu Ahuja
Dev ops != Dev+OpsDev ops != Dev+Ops
Dev ops != Dev+Ops
Shalu Ahuja1.7K views

Similar to Modern CI/CD in the microservices world with Kubernetes

MidSem by
MidSemMidSem
MidSemasmita sharma
193 views25 slides
A Bit of Everything Chef by
A Bit of Everything ChefA Bit of Everything Chef
A Bit of Everything ChefMandi Walls
141 views74 slides
Why so continuous by
Why so continuousWhy so continuous
Why so continuousMax Lobur
193 views21 slides
Simplify and Scale Enterprise Spring Apps in the Cloud | March 23, 2023 by
Simplify and Scale Enterprise Spring Apps in the Cloud | March 23, 2023Simplify and Scale Enterprise Spring Apps in the Cloud | March 23, 2023
Simplify and Scale Enterprise Spring Apps in the Cloud | March 23, 2023VMware Tanzu
255 views75 slides
20171122 aws usergrp_coretech-spn-cicd-aws-v01 by
20171122 aws usergrp_coretech-spn-cicd-aws-v0120171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v01Scott Miao
662 views43 slides
Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ... by
Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ...Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ...
Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ...DevOps.com
253 views38 slides

Similar to Modern CI/CD in the microservices world with Kubernetes(20)

A Bit of Everything Chef by Mandi Walls
A Bit of Everything ChefA Bit of Everything Chef
A Bit of Everything Chef
Mandi Walls141 views
Why so continuous by Max Lobur
Why so continuousWhy so continuous
Why so continuous
Max Lobur193 views
Simplify and Scale Enterprise Spring Apps in the Cloud | March 23, 2023 by VMware Tanzu
Simplify and Scale Enterprise Spring Apps in the Cloud | March 23, 2023Simplify and Scale Enterprise Spring Apps in the Cloud | March 23, 2023
Simplify and Scale Enterprise Spring Apps in the Cloud | March 23, 2023
VMware Tanzu255 views
20171122 aws usergrp_coretech-spn-cicd-aws-v01 by Scott Miao
20171122 aws usergrp_coretech-spn-cicd-aws-v0120171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v01
Scott Miao662 views
Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ... by DevOps.com
Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ...Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ...
Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ...
DevOps.com253 views
Chef Workflow Demo by Chef
Chef Workflow DemoChef Workflow Demo
Chef Workflow Demo
Chef482 views
Zero Down Time Move From Apache Kafka to Confluent With Justin Dempsey | Curr... by HostedbyConfluent
Zero Down Time Move From Apache Kafka to Confluent With Justin Dempsey | Curr...Zero Down Time Move From Apache Kafka to Confluent With Justin Dempsey | Curr...
Zero Down Time Move From Apache Kafka to Confluent With Justin Dempsey | Curr...
HostedbyConfluent561 views
Enabling Production Grade Containerized Applications through Policy Based Inf... by Docker, Inc.
Enabling Production Grade Containerized Applications through Policy Based Inf...Enabling Production Grade Containerized Applications through Policy Based Inf...
Enabling Production Grade Containerized Applications through Policy Based Inf...
Docker, Inc.4.7K views
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz) by QAware GmbH
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
QAware GmbH501 views
PCF: Platform for a New Era - Kubernetes for the Enterprise - London by VMware Tanzu
PCF: Platform for a New Era - Kubernetes for the Enterprise - LondonPCF: Platform for a New Era - Kubernetes for the Enterprise - London
PCF: Platform for a New Era - Kubernetes for the Enterprise - London
VMware Tanzu1.5K views
AWS Webcast - Continuous integration with AWS and Ravello by Amazon Web Services
AWS Webcast - Continuous integration with AWS and RavelloAWS Webcast - Continuous integration with AWS and Ravello
AWS Webcast - Continuous integration with AWS and Ravello
Amazon Web Services1.7K views
8 - OpenShift - A look at a container platform: what's in the box by Kangaroot
8 - OpenShift - A look at a container platform: what's in the box8 - OpenShift - A look at a container platform: what's in the box
8 - OpenShift - A look at a container platform: what's in the box
Kangaroot1.3K views
Spring and Pivotal Application Service - SpringOne Tour - Boston by VMware Tanzu
Spring and Pivotal Application Service - SpringOne Tour - BostonSpring and Pivotal Application Service - SpringOne Tour - Boston
Spring and Pivotal Application Service - SpringOne Tour - Boston
VMware Tanzu678 views
Spring and Pivotal Application Service - SpringOne Tour Dallas by VMware Tanzu
Spring and Pivotal Application Service - SpringOne Tour DallasSpring and Pivotal Application Service - SpringOne Tour Dallas
Spring and Pivotal Application Service - SpringOne Tour Dallas
VMware Tanzu373 views
Cloud Platform Symantec Meetup Nov 2014 by Miguel Zuniga
Cloud Platform Symantec Meetup Nov 2014Cloud Platform Symantec Meetup Nov 2014
Cloud Platform Symantec Meetup Nov 2014
Miguel Zuniga1.3K views
Tips to achieve continuous integration/delivery using HP ALM, Jenkins, and S... by Skytap Cloud
 Tips to achieve continuous integration/delivery using HP ALM, Jenkins, and S... Tips to achieve continuous integration/delivery using HP ALM, Jenkins, and S...
Tips to achieve continuous integration/delivery using HP ALM, Jenkins, and S...
Skytap Cloud2.7K views
Driving Systems Stability & Delivery Agility through DevOps [Decoding DevOps ... by InfoSeption
Driving Systems Stability & Delivery Agility through DevOps [Decoding DevOps ...Driving Systems Stability & Delivery Agility through DevOps [Decoding DevOps ...
Driving Systems Stability & Delivery Agility through DevOps [Decoding DevOps ...
InfoSeption1.2K views
Managing Software from Development to Deployment in the Cloud by CloudBees
Managing Software from Development to Deployment in the CloudManaging Software from Development to Deployment in the Cloud
Managing Software from Development to Deployment in the Cloud
CloudBees2.3K views

More from Mikalai Alimenkou

Rise and fall of Story Points. Capacity based planning from the trenches. by
Rise and fall of Story Points. Capacity based planning from the trenches.Rise and fall of Story Points. Capacity based planning from the trenches.
Rise and fall of Story Points. Capacity based planning from the trenches.Mikalai Alimenkou
2.3K views44 slides
Static analysis tools as the best friend of QA by
Static analysis tools as the best friend of QAStatic analysis tools as the best friend of QA
Static analysis tools as the best friend of QAMikalai Alimenkou
1.7K views33 slides
Saga about distributed business transactions in microservices world by
Saga about distributed business transactions in microservices worldSaga about distributed business transactions in microservices world
Saga about distributed business transactions in microservices worldMikalai Alimenkou
2.6K views42 slides
Effectiveness tips from Kubernetes trenches by Captain Obvious by
Effectiveness tips from Kubernetes trenches by Captain ObviousEffectiveness tips from Kubernetes trenches by Captain Obvious
Effectiveness tips from Kubernetes trenches by Captain ObviousMikalai Alimenkou
812 views34 slides
Ride the database in JUnit tests with Database Rider by
Ride the database in JUnit tests with Database RiderRide the database in JUnit tests with Database Rider
Ride the database in JUnit tests with Database RiderMikalai Alimenkou
2.3K views33 slides
Wastful waste or why everything is so slow in development by
Wastful waste or why everything is so slow in developmentWastful waste or why everything is so slow in development
Wastful waste or why everything is so slow in developmentMikalai Alimenkou
564 views26 slides

More from Mikalai Alimenkou(20)

Rise and fall of Story Points. Capacity based planning from the trenches. by Mikalai Alimenkou
Rise and fall of Story Points. Capacity based planning from the trenches.Rise and fall of Story Points. Capacity based planning from the trenches.
Rise and fall of Story Points. Capacity based planning from the trenches.
Mikalai Alimenkou2.3K views
Static analysis tools as the best friend of QA by Mikalai Alimenkou
Static analysis tools as the best friend of QAStatic analysis tools as the best friend of QA
Static analysis tools as the best friend of QA
Mikalai Alimenkou1.7K views
Saga about distributed business transactions in microservices world by Mikalai Alimenkou
Saga about distributed business transactions in microservices worldSaga about distributed business transactions in microservices world
Saga about distributed business transactions in microservices world
Mikalai Alimenkou2.6K views
Effectiveness tips from Kubernetes trenches by Captain Obvious by Mikalai Alimenkou
Effectiveness tips from Kubernetes trenches by Captain ObviousEffectiveness tips from Kubernetes trenches by Captain Obvious
Effectiveness tips from Kubernetes trenches by Captain Obvious
Mikalai Alimenkou812 views
Ride the database in JUnit tests with Database Rider by Mikalai Alimenkou
Ride the database in JUnit tests with Database RiderRide the database in JUnit tests with Database Rider
Ride the database in JUnit tests with Database Rider
Mikalai Alimenkou2.3K views
Wastful waste or why everything is so slow in development by Mikalai Alimenkou
Wastful waste or why everything is so slow in developmentWastful waste or why everything is so slow in development
Wastful waste or why everything is so slow in development
Mikalai Alimenkou564 views
Hexagonal architecture with Spring Boot by Mikalai Alimenkou
Hexagonal architecture with Spring BootHexagonal architecture with Spring Boot
Hexagonal architecture with Spring Boot
Mikalai Alimenkou2.2K views
Wastful waste or why everything is so slow in development by Mikalai Alimenkou
Wastful waste or why everything is so slow in developmentWastful waste or why everything is so slow in development
Wastful waste or why everything is so slow in development
Mikalai Alimenkou1.1K views
DevOps checklist or how to understand where is your team in DevOps landscape ... by Mikalai Alimenkou
DevOps checklist or how to understand where is your team in DevOps landscape ...DevOps checklist or how to understand where is your team in DevOps landscape ...
DevOps checklist or how to understand where is your team in DevOps landscape ...
Mikalai Alimenkou1.2K views
DevOps checklist or how to understand where is your team in DevOps landscape by Mikalai Alimenkou
DevOps checklist or how to understand where is your team in DevOps landscapeDevOps checklist or how to understand where is your team in DevOps landscape
DevOps checklist or how to understand where is your team in DevOps landscape
Mikalai Alimenkou1.1K views
Практические трудности в разработке Медкарты для целой страны by Mikalai Alimenkou
Практические трудности в разработке Медкарты для целой страныПрактические трудности в разработке Медкарты для целой страны
Практические трудности в разработке Медкарты для целой страны
Mikalai Alimenkou434 views
Hexagonal architecture with Spring Boot [EPAM Java online conference] by Mikalai Alimenkou
Hexagonal architecture with Spring Boot [EPAM Java online conference]Hexagonal architecture with Spring Boot [EPAM Java online conference]
Hexagonal architecture with Spring Boot [EPAM Java online conference]
Mikalai Alimenkou1.3K views
Bro, manage test data like a pro! [QA Fest 2018] by Mikalai Alimenkou
Bro, manage test data like a pro! [QA Fest 2018]Bro, manage test data like a pro! [QA Fest 2018]
Bro, manage test data like a pro! [QA Fest 2018]
Mikalai Alimenkou764 views
Agile antipatterns: review after 10 years of practice by Mikalai Alimenkou
Agile antipatterns: review after 10 years of practiceAgile antipatterns: review after 10 years of practice
Agile antipatterns: review after 10 years of practice
Mikalai Alimenkou744 views
Hexagonal architecture with Spring Boot by Mikalai Alimenkou
Hexagonal architecture with Spring BootHexagonal architecture with Spring Boot
Hexagonal architecture with Spring Boot
Mikalai Alimenkou8.8K views
Бытовая классификация тестировщиков с точки зрения разработчика by Mikalai Alimenkou
Бытовая классификация тестировщиков с точки зрения разработчикаБытовая классификация тестировщиков с точки зрения разработчика
Бытовая классификация тестировщиков с точки зрения разработчика
Mikalai Alimenkou1.1K views
Code Review tool for personal effectiveness and waste analysis by Mikalai Alimenkou
Code Review tool for personal effectiveness and waste analysisCode Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysis
Mikalai Alimenkou1.4K views
Funny stories and anti-patterns from DevOps landscape by Mikalai Alimenkou
Funny stories and anti-patterns from DevOps landscapeFunny stories and anti-patterns from DevOps landscape
Funny stories and anti-patterns from DevOps landscape
Mikalai Alimenkou4.3K views

Recently uploaded

Roadmap to Become Experts.pptx by
Roadmap to Become Experts.pptxRoadmap to Become Experts.pptx
Roadmap to Become Experts.pptxdscwidyatamanew
14 views45 slides
From chaos to control: Managing migrations and Microsoft 365 with ShareGate! by
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!sammart93
9 views39 slides
Piloting & Scaling Successfully With Microsoft Viva by
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft VivaRichard Harbridge
12 views160 slides
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveNetwork Automation Forum
30 views35 slides
Empathic Computing: Delivering the Potential of the Metaverse by
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the MetaverseMark Billinghurst
476 views80 slides
Perth MeetUp November 2023 by
Perth MeetUp November 2023 Perth MeetUp November 2023
Perth MeetUp November 2023 Michael Price
19 views44 slides

Recently uploaded(20)

From chaos to control: Managing migrations and Microsoft 365 with ShareGate! by sammart93
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
sammart939 views
Piloting & Scaling Successfully With Microsoft Viva by Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Empathic Computing: Delivering the Potential of the Metaverse by Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst476 views
Perth MeetUp November 2023 by Michael Price
Perth MeetUp November 2023 Perth MeetUp November 2023
Perth MeetUp November 2023
Michael Price19 views
STPI OctaNE CoE Brochure.pdf by madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb13 views
AMAZON PRODUCT RESEARCH.pdf by JerikkLaureta
AMAZON PRODUCT RESEARCH.pdfAMAZON PRODUCT RESEARCH.pdf
AMAZON PRODUCT RESEARCH.pdf
JerikkLaureta19 views
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2217 views
6g - REPORT.pdf by Liveplex
6g - REPORT.pdf6g - REPORT.pdf
6g - REPORT.pdf
Liveplex10 views
Spesifikasi Lengkap ASUS Vivobook Go 14 by Dot Semarang
Spesifikasi Lengkap ASUS Vivobook Go 14Spesifikasi Lengkap ASUS Vivobook Go 14
Spesifikasi Lengkap ASUS Vivobook Go 14
Dot Semarang37 views
Black and White Modern Science Presentation.pptx by maryamkhalid2916
Black and White Modern Science Presentation.pptxBlack and White Modern Science Presentation.pptx
Black and White Modern Science Presentation.pptx
maryamkhalid291616 views
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 by IttrainingIttraining
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker33 views
HTTP headers that make your website go faster - devs.gent November 2023 by Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn21 views
The details of description: Techniques, tips, and tangents on alternative tex... by BookNet Canada
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...
BookNet Canada126 views

Modern CI/CD in the microservices world with Kubernetes

  • 1. Modern CI/CD in the microservices world with Kubernetes Mikalai Alimenkou @xpinjection https://t.me/xpinjection_channel https://xpinjection.com
  • 4. Disclaimer This talk is based on personal experience
  • 5. Hello world samples on conferences
  • 6. Real world is a little bit more complex
  • 7. CI/CD of the son of your mother’s friend After moving to its own cloud, Amazon engineers deploy code every 11.7 seconds, on average reducing both the number and duration of outages at the same time.
  • 8. Why this is not your case? Product is developed in iterative way (Scrum, 2 weeks) Engineering culture is far from perfect Level of developers is not so high No big investments in test automation at all levels Engineering practices are not used on regular basis Legacy services or dependencies Business is not ready to continuous delivery … many more reasons
  • 9. Chaos deployment in DEV/QA QA/DEV environment always contain latest versions of all microservices Deployment on QA/DEV is done continuously by different dev teams when something is ‘READY’ Compatibility of microservices is not verified There is no way to rollback on specific system version QA life looks like a hell (random issues, non- reproducible results, 500 HTTP codes everywhere, chaos testing)
  • 10. Does it look familiar to you?
  • 11. Old monolith mindset doesn’t work
  • 12. Microservices has their own lifecycles
  • 14. Step #1: Dockerize your microservices Immutable infrastructure principle Artifacts promotion with tags Unified blocks for CD stage, no dependency on technical stack Simplified deployment and environment management Common configuration approach Efficient resources utilization
  • 16. Step #2: Specify versioning policy Semantic versioning as a basis Major version for API breaking changes or major service release Minor version corresponds to current dev iteration Patch version is reserved for hot fixes Commit hash as suffix to snapshot versioning and tracing Build date as an additional optional suffix
  • 17. CI pipeline for each microservice QUALITY GATES: - Unit tests - Integration tests - Static code analysis - API tests - Contract tests - Security checks - … FULL VERSION: 2.3.0-350fca-20200218
  • 18. What is shippable version of the system?
  • 19. Step #3: Introduce compatibility sets Store full list of compatible microservices as dedicated artifact VCS provides historical timeline, rollback, full tracing Used as primary artifact for Continuous Delivery Promoted between different environments in CD pipeline (dev, qa, stage, prod) Add middleware versions for full compatibility set
  • 20. Compatibility set in properties file Clear logical versions management independent from concrete deployment technologies Flexible usage for different purposes Separation between deployment artifacts versioning Customization step before deployment
  • 21. Compatibility set in Helm/helmfile Single versioned storage for environment configuration Ability to specify compatibility on configuration level The same toolset is used for all environments Additional level of abstraction around K8S manifests Helm is needed as an additional component
  • 22. Step #4: Implement system level pipeline Triggered when new candidate is built Uses latest compatible set as a baseline Overrides versions for ALL pending candidates Creates new environment for system deployment Deploys all microservices according to their versions Waits for all health checks to become OK Runs system level quality gates Stores new compatibility set in case of SUCCESS Retag and promote artifacts for the next stage
  • 23. System pipeline for compatibility checks QUALITY GATES: - Health checks - Smoke API tests - Smoke UI tests - Smoke system tests - Smoke security tests - … ADDITIONAL TAGS: qa-ready, set-283gpt
  • 24. Example from the real life USER SERVICE 1.0.3-abc EVENT SERVICE 1.0.0-cde SCHEDULE SERVICE 0.9.1-fgh COMPATIBLE SET 1.0.3-prs NEW CANDIDATE 1.0.0-cde 1.0.3-prs 0.9.1-fgh FAILED SYSTEM BUILD 1.0.1-tuv FIX APPLIED 1.0.3-prs 0.9.1-fgh SUCCESS SYSTEM BUILD 1.0.1-tuv 1.0.3-prs 1.0.1-tuv 0.9.1-fgh COMPATIBLE SET
  • 25. System pipeline: important notes If pipeline fails, then candidate is not approved and it's artifact is invisible for other environments, but pending for the next pipeline run Every build takes ALL available pending candidates Different concurrency strategies may be applied: • single build with lock on compatibility set • concurrent builds with “last win” approach • concurrent builds with optimistic locking in VSC
  • 26. We are almost GitOps ready now!
  • 27. New tools become available for CD
  • 28. Step #5: Implement deployment pipeline Triggered manually, automatically by successful system pipeline build or by specific schedule Predefined set of environments (dev, qa, stage, prod) New environment may be created with specified or generated name Only appropriate compatible sets may be deployed Environment TTL could be set manually or smart default value is applied
  • 30. FEATURE BRANCH PIPELINE: - Environment name equals to feature branch name - Reused to speed up development - DEV compatibility set is used as a baseline - Artifacts on microservices pipeline are tagged with branch name - For each microservice latest available version from the branch with the same name is used as candidate PULL REQUEST PIPELINE: - Triggered on each PR - Special flag to activate system level quality gates - DEV compatibility set is used as a baseline - Only light system level quality gates are run - No compatibility sets updated
  • 32. It is time for Kubernetes to show up!
  • 33. Step #6: Speed up environments in K8S Create dedicated namespace for each environment Configure minimal limits and scale factors everywhere Share common external heavy resources (DB, Elasticsearch, Redis, Kafka, etc.) Invest in performant K8S nodes Use prepopulated images with data to speed up Configure common observability tools Reuse environments where possible with smart TTLs Destroy environments asynchronously
  • 34. Use full power of K8S namespaces COMMON Glossary Service Redis Cache FB-243 User Service Reuse from DEV STAGE User Service Event Service Schedule Service Reuse from DEV QA User Service Event Service Schedule Service DEV User Service Event Service Schedule Service RDBMS Kafka Cluster Elasticsearch
  • 35. How to share common resources? It is really important to follow cloud-native 12 factors! Redis via key prefixes or databases RDBMS via databases or schemas Kafka via common topics prefix Elasticsearch via indexes
  • 36. Now developers could use Skaffold continuously QC is shifted as left as possible Several teams could develop in common environment
  • 37. Step #7: Start using K8S native CD tools Dockerize tests with required test environment Execute tests as K8S jobs Manage test infrastructure in K8S Choose suitable K8S native CD tool
  • 38. Summary and take aways Dockerize your microservices Specify versioning policy Introduce compatibility sets Implement system level pipeline Implement deployment pipeline Speed up environments in K8S Start using K8S native CD tools Enjoy your life in amazing CI/CD world!