SlideShare a Scribd company logo
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

More Related Content

PDF
Kubernetes - introduction
PDF
Hands-On Introduction to Kubernetes at LISA17
PDF
Kubernetes Introduction
PDF
CI/CD with Github Actions
PDF
Autoscaling Kubernetes
PDF
Getting Started with Kubernetes
PDF
Kubernetes 101
PDF
Spring Boot & Containers - Do's & Don'ts
Kubernetes - introduction
Hands-On Introduction to Kubernetes at LISA17
Kubernetes Introduction
CI/CD with Github Actions
Autoscaling Kubernetes
Getting Started with Kubernetes
Kubernetes 101
Spring Boot & Containers - Do's & Don'ts

What's hot (20)

PDF
Introduction to kubernetes
PDF
Microservices with Java, Spring Boot and Spring Cloud
PPTX
Docker and kubernetes_introduction
PDF
Introduction to GitHub Actions
PPTX
CI/CD Overview
PDF
Kubernetes Secrets Management on Production with Demo
PDF
Kubernetes
PDF
Introduction to Kubernetes Workshop
PPTX
Kubernetes
PPTX
Introduction to helm
PDF
(Draft) Kubernetes - A Comprehensive Overview
PDF
Cloud Native Application
PDF
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
PPTX
Steering the Course with Helm
PPTX
Kubernetes 101 for Beginners
PDF
Rancher 2.0 Technical Deep Dive
PPSX
Microservices, Containers, Kubernetes, Kafka, Kanban
PDF
What Is Kubernetes | Kubernetes Introduction | Kubernetes Tutorial For Beginn...
PDF
Kubernetes 101 - an Introduction to Containers, Kubernetes, and OpenShift
PDF
Introduction of Kubernetes - Trang Nguyen
Introduction to kubernetes
Microservices with Java, Spring Boot and Spring Cloud
Docker and kubernetes_introduction
Introduction to GitHub Actions
CI/CD Overview
Kubernetes Secrets Management on Production with Demo
Kubernetes
Introduction to Kubernetes Workshop
Kubernetes
Introduction to helm
(Draft) Kubernetes - A Comprehensive Overview
Cloud Native Application
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Steering the Course with Helm
Kubernetes 101 for Beginners
Rancher 2.0 Technical Deep Dive
Microservices, Containers, Kubernetes, Kafka, Kanban
What Is Kubernetes | Kubernetes Introduction | Kubernetes Tutorial For Beginn...
Kubernetes 101 - an Introduction to Containers, Kubernetes, and OpenShift
Introduction of Kubernetes - Trang Nguyen
Ad

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

PPTX
PPTX
A Bit of Everything Chef
PDF
Why so continuous
PDF
Simplify and Scale Enterprise Spring Apps in the Cloud | March 23, 2023
PPTX
20171122 aws usergrp_coretech-spn-cicd-aws-v01
PDF
Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ...
PPTX
Chef Workflow Demo
PDF
Zero Down Time Move From Apache Kafka to Confluent With Justin Dempsey | Curr...
PDF
Kubernetes + Jenkins X: a Cloud Native Approach
PPTX
Enabling Production Grade Containerized Applications through Policy Based Inf...
PDF
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
PDF
PCF: Platform for a New Era - Kubernetes for the Enterprise - London
PDF
8 - OpenShift - A look at a container platform: what's in the box
PDF
Spring and Pivotal Application Service - SpringOne Tour - Boston
PDF
Spring and Pivotal Application Service - SpringOne Tour Dallas
PPTX
Cloud Platform Symantec Meetup Nov 2014
PDF
Tips to achieve continuous integration/delivery using HP ALM, Jenkins, and S...
PDF
Driving Systems Stability & Delivery Agility through DevOps [Decoding DevOps ...
PPT
Managing Software from Development to Deployment in the Cloud
PPTX
Gatekeeper: API gateway
A Bit of Everything Chef
Why so continuous
Simplify and Scale Enterprise Spring Apps in the Cloud | March 23, 2023
20171122 aws usergrp_coretech-spn-cicd-aws-v01
Zero to 1000+ Applications - Large Scale CD Adoption at Cisco with Spinnaker ...
Chef Workflow Demo
Zero Down Time Move From Apache Kafka to Confluent With Justin Dempsey | Curr...
Kubernetes + Jenkins X: a Cloud Native Approach
Enabling Production Grade Containerized Applications through Policy Based Inf...
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
PCF: Platform for a New Era - Kubernetes for the Enterprise - London
8 - OpenShift - A look at a container platform: what's in the box
Spring and Pivotal Application Service - SpringOne Tour - Boston
Spring and Pivotal Application Service - SpringOne Tour Dallas
Cloud Platform Symantec Meetup Nov 2014
Tips to achieve continuous integration/delivery using HP ALM, Jenkins, and S...
Driving Systems Stability & Delivery Agility through DevOps [Decoding DevOps ...
Managing Software from Development to Deployment in the Cloud
Gatekeeper: API gateway
Ad

More from Mikalai Alimenkou (20)

PPTX
Rise and fall of Story Points. Capacity based planning from the trenches.
PPTX
Static analysis tools as the best friend of QA
PPTX
Saga about distributed business transactions in microservices world
PPTX
Effectiveness tips from Kubernetes trenches by Captain Obvious
PPTX
Ride the database in JUnit tests with Database Rider
PPTX
Wastful waste or why everything is so slow in development
PPTX
Hexagonal architecture with Spring Boot
PPTX
Wastful waste or why everything is so slow in development
PPTX
DevOps checklist or how to understand where is your team in DevOps landscape ...
PPTX
DevOps checklist or how to understand where is your team in DevOps landscape
PDF
Практические трудности в разработке Медкарты для целой страны
PPTX
Hexagonal architecture with Spring Boot [EPAM Java online conference]
PPTX
Bro, manage test data like a pro! [QA Fest 2018]
PPTX
Agile antipatterns: review after 10 years of practice
PPTX
Hexagonal architecture with Spring Boot
PPTX
Bro, manage test data like a pro!
PPTX
Бытовая классификация тестировщиков с точки зрения разработчика
PPTX
Code Review tool for personal effectiveness and waste analysis
PDF
Funny stories and anti-patterns from DevOps landscape
PPTX
Developer + tester = quality++
Rise and fall of Story Points. Capacity based planning from the trenches.
Static analysis tools as the best friend of QA
Saga about distributed business transactions in microservices world
Effectiveness tips from Kubernetes trenches by Captain Obvious
Ride the database in JUnit tests with Database Rider
Wastful waste or why everything is so slow in development
Hexagonal architecture with Spring Boot
Wastful waste or why everything is so slow in development
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
Практические трудности в разработке Медкарты для целой страны
Hexagonal architecture with Spring Boot [EPAM Java online conference]
Bro, manage test data like a pro! [QA Fest 2018]
Agile antipatterns: review after 10 years of practice
Hexagonal architecture with Spring Boot
Bro, manage test data like a pro!
Бытовая классификация тестировщиков с точки зрения разработчика
Code Review tool for personal effectiveness and waste analysis
Funny stories and anti-patterns from DevOps landscape
Developer + tester = quality++

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
cuic standard and advanced reporting.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Machine learning based COVID-19 study performance prediction
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Electronic commerce courselecture one. Pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Encapsulation theory and applications.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Cloud computing and distributed systems.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
Teaching material agriculture food technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Spectral efficient network and resource selection model in 5G networks
cuic standard and advanced reporting.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Machine learning based COVID-19 study performance prediction
20250228 LYD VKU AI Blended-Learning.pptx
Programs and apps: productivity, graphics, security and other tools
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Spectroscopy.pptx food analysis technology
Electronic commerce courselecture one. Pdf
MIND Revenue Release Quarter 2 2025 Press Release
Encapsulation theory and applications.pdf
Review of recent advances in non-invasive hemoglobin estimation
Network Security Unit 5.pdf for BCA BBA.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Cloud computing and distributed systems.
Advanced methodologies resolving dimensionality complications for autism neur...
The AUB Centre for AI in Media Proposal.docx
Building Integrated photovoltaic BIPV_UPV.pdf

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!