SlideShare a Scribd company logo
Continuous Delivery the hard
way with Kubernetes
Luke Marsden, Developer Experience
@lmarsden
Agenda
1. Why should I deliver continuously?
2. Kubernetes primer
3. GitLab primer
4. β€œOK, so we’ve got these pieces, how are we
going to put them together?”
5. Let’s iterate on a design!
6. Conclusions
Agenda
1. Why should I deliver continuously?
2. Kubernetes primer
3. GitLab primer
4. β€œOK, so we’ve got these pieces, how are we
going to put them together?”
5. Let’s iterate on a design!
6. Conclusions
Why should I continuously deliver?
β€’ Microservices
β€’ Conway’s law
β€’ Scaling project, scaling team
β€’ Velocity!
Kubernetes: all you need to know
Pods
containers
ServicesDeployments
Container
Image
Docker container image, contains your application code in an isolated
environment.
Pod A set of containers, sharing network namespace and local volumes,
co-scheduled on one machine. Mortal. Has pod IP. Has labels.
Deployment Specify how many replicas of a pod should run in a cluster. Then
ensures that many are running across the cluster. Has labels.
Service Names things in DNS. Gets virtual IP. Two types: ClusterIP for internal
services, NodePort for publishing to outside. Routes based on labels.
GitLab primer
β€’ Or you can use GitHub, Travis, Circle,
Docker Hub, Quay.io, GCR…
CI system
Docker
registry
GitLab
Version
controlled
code
Version
controlled
code
Version
controlled
code
These are the things that we’ve got
Version
controlled
code
CI system
Docker
registry
Kubernetes
clusterCode
Docker image
Kubernetes YAML
Version
controlled
code
These are the things that we’ve got
Version
controlled
code
CI system
Docker
registry
Kubernetes
clusterCode
Docker image
Kubernetes YAML
git
git + shell docker
registry
API
kubernetes
API
These are the things that we’ve got
Version
controlled
code
CI system
Docker
registry
Kubernetes
clusterCode
Docker image
Kubernetes YAML
V1
Initial deploy (manually)
Version
controlled
code
V1 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
code
V1 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
clusterkubectl apply -f service.yaml
V1
Deploy update (with CI system)
Version
controlled
code
V1 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Code
Docker image
Version
controlled
code
V1 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
clustergit push
master
Version
controlled
code
V1 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
clusterdocker build
:a1b2c3
Version
controlled
code
V1 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
clusterdocker push
:a1b2c3
Version
controlled
code
V1 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
clusterkubectl set image
:a1b2c3
V1
Rollback
Version
controlled
code
V1 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
code
V1 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
git checkout master
git revert HEAD

git push
Version
controlled
code
V1 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
clusterdocker build
:b2c3d4
Version
controlled
code
V1 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
clusterdocker push
:b2c3d4
Version
controlled
code
V1 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
clusterkubectl set image
:b2c3d4
Demo!
https://www.katacoda.com/courses/weave/flux-training
Downsides
β€’ Building & pushing containers is slow (disk I/O,
network), shouldn’t need to this when rolling back
β€’ Branch per environment required per microservice
(explosion of branches, hard to manage & scale)
β€’ Only a matter of time until you get a git merge mess
β€’ Better to decouple version of code at HEAD from
version deployed…
Version controlled configuration
β€’ users service
β€’ code for users service
β€’ Kubernetes YAML
β€’ orders service
β€’ code for orders
service
β€’ Kubernetes YAML
β€’ config repo
β€’ Kubernetes YAML
for users
β€’ Kubernetes YAML
for orders
β€’ Version controlled config should be the source of truth for your whole
app (all the microservices)
Decoupling versions from releases
Code versions (branches, tags) Environments & releases
β€’ users service
β€’ master
β€’ feature_A
β€’ feature_B
β€’ orders service
β€’ master
β€’ feature_A
β€’ feature_B
β€’ …
β€’ production
β€’ users -> master @ t1
β€’ orders -> master @ t1
β€’ staging
β€’ orders -> master @ t2
β€’ orders -> master @ t2
conflating per-
service code
branches with
environments in
each repo is a
hack, and
doesn’t scale
well
V2
Put all the yamels
in one place
Version
controlled
code
V2 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Code
Docker image
Kubernetes YAML
Have the CI system update the yamels automatically for you
Version
controlled
code
V2 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Code
Docker image
Kubernetes YAML
Have the CI system update the yamels automatically for you
Version
controlled
code
V2 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Code
Docker image
Kubernetes YAML
Have the CI system update the yamels automatically for you
Version
controlled
code
V2 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Code
Docker image
Kubernetes YAML
Have the CI system update the yamels automatically for you
Version
controlled
code
V2 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Code
Docker image
Kubernetes YAML
Have the CI system update the yamels automatically for you
Version
controlled
code
V2 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Code
Docker image
Kubernetes YAML
Have the CI system update the yamels automatically for you
Version
controlled
code
V2 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Code
Docker image
Kubernetes YAML
Have the CI system update the yamels automatically for you
Version
controlled
code
V2 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Code
Docker image
Kubernetes YAML
Have the CI system update the yamels automatically for you
Version
controlled
code
Container builder demo
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Code
Docker image
Kubernetes YAML
Have the CI system update the yamels automatically for you
Builder used
as CD
system
Now you can recreate your production environment from the central
YAML repository even if your entire production cluster gets deleted
Demo!
Downsides
β€’ The CI system is responsible for a lot now (design smell – overloaded)
β€’ You can only trigger the CI system by pushing code (we wanted to be able
to rollback without pushing code)
β€’ If you rollback out of band (directly with kubectl), you have to
remember to update the central configuration repo as well
β€’ Parallel builds can tread on eachothers’ toes, not atomic: race between git
checkout and git push (need a global lock)
β€’ Scripting updates of yamels can be a pain… it mangles your yamels
β€’ Developers start asking for more release management features (rollback,
pinning, automation for some envs and manual gating for others, and your
once-simple script keeps growing…)
V3
Refactor architecture
Add β€œrelease manager”
Version
controlled
code
V3 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Release
manager
Code
Docker image
Kubernetes YAML
push
im
age
push
config
pull image
list
images
pull, modify, push config
push code
policy
Version
controlled
code
V3 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Release
manager
Code
Docker image
Kubernetes YAML
push
im
age
push
config
pull image
list
images
pull, modify, push config
push code
policy
Version
controlled
code
V3 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Release
manager
Code
Docker image
Kubernetes YAML
push
im
age
push
config
pull image
list
images
pull, modify, push config
push code
policy
Version
controlled
code
V3 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Release
manager
Code
Docker image
Kubernetes YAML
push
im
age
push
config
pull image
list
images
pull, modify, push config
push code
policy
Version
controlled
code
V3 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Release
manager
Code
Docker image
Kubernetes YAML
push
im
age
push
config
pull image
list
images
pull, modify, push config
push code
policy
Version
controlled
code
V3 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Release
manager
Code
Docker image
Kubernetes YAML
push
im
age
push
config
pull image
list
images
pull, modify, push config
push code
policy
Version
controlled
code
V3 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Release
manager
Code
Docker image
Kubernetes YAML
push
im
age
push
config
pull image
list
images
pull, modify, push config
push code
policy
Version
controlled
code
V3 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Release
manager
Code
Docker image
Kubernetes YAML
push
im
age
push
config
pull image
list
images
pull, modify, push config
push code
policy
V3
Rollback doesn’t go via CI
Version
controlled
code
V3 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Release
manager
Code
Docker image
Kubernetes YAML
push
im
age
push
config
pull image
list
images
pull, modify, push config
push code
policy
rollback!
Version
controlled
code
V3 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Release
manager
Code
Docker image
Kubernetes YAML
push
im
age
push
config
pull image
list
images
pull, modify, push config
push code
policy
rollback!
Version
controlled
code
V3 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Release
manager
Code
Docker image
Kubernetes YAML
push
im
age
push
config
pull image
list
images
pull, modify, push config
push code
policy
rollback!
Version
controlled
code
V3 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Release
manager
Code
Docker image
Kubernetes YAML
push
im
age
push
config
pull image
list
images
pull, modify, push config
push code
policy
rollback!
Version
controlled
code
V3 architecture
Version
controlled
code
CI system
Docker
registry
Kubernetes
cluster
Version
controlled
config
Release
manager
Code
Docker image
Kubernetes YAML
push
im
age
push
config
pull image
list
images
pull, modify, push config
push code
policy
rollback!
What does the release manager do?
β€’ Watches for changes in a container registry (output of CI
system)
β€’ Makes commits for you to version controlled configuration
(understands Kubernetes YAML)
β€’ Depending on release policy (per environment), either push
changes continuously or permit manually gated releases
β€’ Allows releases to be rolled back by changing a pointer
β€’ Releases can be β€œlocked” as a social cue
Different environments can have different release policies
(no tight coupling between individual microservices repos
and what’s released)
Demo!
https://www.katacoda.com/courses/weave/flux-training
This is how we deploy
Weave Cloud
Weave Cloud helps
devops iterate faster with:
β€’ observability &
monitoring
β€’ continuous delivery
β€’ container networks &
firewalls
Weave Flux is a release
manager for Kubernetes
Other topics
β€’ Kubernetes 101
β€’ How do I monitor this stuff? (Prometheus)
β€’ Network policy for isolating & firewalling different
microservices
We have talks & trainings on all these topics in the
Weave user group!
Join the Weave user group!
meetup.com/pro/Weave/

Come hang out on Slack!
weave.works/help
Thanks! Questions?
We are hiring!
DX in San Francisco
Engineers in London & SF
weave.works/weave-company/hiring
Check out Flux on GitHub: github.com/weaveworks/flux

More Related Content

PDF
How to install and use Kubernetes
PDF
DevJam 2019 - Introduction to Kubernetes
PPTX
Kubernetes Immersion
PDF
Observability beyond logging for Java Microservices
PDF
Docker Online Meetup: Infrakit update and Q&A
PPTX
Kubernetes networks
PPTX
Introducing LinuxKit
PPTX
Microservices and Best Practices
How to install and use Kubernetes
DevJam 2019 - Introduction to Kubernetes
Kubernetes Immersion
Observability beyond logging for Java Microservices
Docker Online Meetup: Infrakit update and Q&A
Kubernetes networks
Introducing LinuxKit
Microservices and Best Practices

What's hot (20)

PPTX
Docker Roadshow 2016
PDF
Online Meetup: What's new in docker 1.13.0
PDF
Docker Enterprise Edition: Building a Secure Supply Chain for the Enterprise ...
PDF
Docker for Ops - Scott Coulton, Puppet
PDF
Quick introduction to Kubernetes
PDF
Kubernetes in Docker
PPTX
LinuxKit Update at the Moby Summit
PPTX
Docker Platform 1.9
PDF
Effective Data Pipelines with Docker & Jenkins - Brian Donaldson
PPTX
Abc of docker
PPTX
Kubernetes Introduction & Whats new in Kubernetes 1.6
PDF
Taking Docker from Local to Production at Intuit JanJaap Lahpor, Intuit and H...
PPTX
LlinuxKit security, Security Scanning and Notary
PPTX
Docker Meetup 08 03-2016
Β 
PDF
Securing your Containers
PPTX
Enabling Production Grade Containerized Applications through Policy Based Inf...
PDF
DCSF 19 Data Center Networking with Containers
PPTX
Continuous deployment of polyglot microservices: A practical approach
PDF
Docker Online Meetup #22: Docker Networking
PDF
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
Docker Roadshow 2016
Online Meetup: What's new in docker 1.13.0
Docker Enterprise Edition: Building a Secure Supply Chain for the Enterprise ...
Docker for Ops - Scott Coulton, Puppet
Quick introduction to Kubernetes
Kubernetes in Docker
LinuxKit Update at the Moby Summit
Docker Platform 1.9
Effective Data Pipelines with Docker & Jenkins - Brian Donaldson
Abc of docker
Kubernetes Introduction & Whats new in Kubernetes 1.6
Taking Docker from Local to Production at Intuit JanJaap Lahpor, Intuit and H...
LlinuxKit security, Security Scanning and Notary
Docker Meetup 08 03-2016
Β 
Securing your Containers
Enabling Production Grade Containerized Applications through Policy Based Inf...
DCSF 19 Data Center Networking with Containers
Continuous deployment of polyglot microservices: A practical approach
Docker Online Meetup #22: Docker Networking
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
Ad

Similar to Continuous Delivery the hard way with Kubernetes (20)

PDF
Continuous Delivery the Hard Way with Kubernetes
PPTX
Continuous Delivery the Hard Way with Kubernetes
PDF
A Tail of Two Containers: How docker made ci great again
PPTX
Kubernetes @ meetic
PDF
ИспользованиС AzureDevOps ΠΏΡ€ΠΈ Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ΅ микросСрвисных ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΉ
PDF
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
PPTX
Docker and kubernetes
PPTX
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
PPTX
Cont0519
PPTX
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
PDF
Docker in Production: How RightScale Delivers Cloud Applications
PDF
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
PPTX
ECS and Docker at Okta
PPTX
Containerization using docker and its applications
PPTX
Containerization using docker and its applications
PDF
DCEU 18: Building Your Development Pipeline
PPTX
DevOps with Azure, Kubernetes, and Helm Webinar
PDF
Continuous Deployment with Kubernetes, Docker and GitLab CI
PPT
Containers 101
PPTX
Docker Hub: Past, Present and Future by Ken Cochrane & BC Wong
Continuous Delivery the Hard Way with Kubernetes
Continuous Delivery the Hard Way with Kubernetes
A Tail of Two Containers: How docker made ci great again
Kubernetes @ meetic
ИспользованиС AzureDevOps ΠΏΡ€ΠΈ Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ΅ микросСрвисных ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΉ
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
Docker and kubernetes
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
Cont0519
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
Docker in Production: How RightScale Delivers Cloud Applications
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
ECS and Docker at Okta
Containerization using docker and its applications
Containerization using docker and its applications
DCEU 18: Building Your Development Pipeline
DevOps with Azure, Kubernetes, and Helm Webinar
Continuous Deployment with Kubernetes, Docker and GitLab CI
Containers 101
Docker Hub: Past, Present and Future by Ken Cochrane & BC Wong
Ad

More from Luke Marsden (7)

PDF
Inextricably linked: reproducibility and productivity in data science and AI
PDF
Monitoring your App in Kubernetes with Prometheus
PDF
How and why we got Prometheus working with Docker Swarm
PDF
Istio Service Mesh
PDF
Docs at Weaveworks: DX from open source to SaaS and beyond
PDF
Securing & Enforcing Network Policy and Encryption with Weave Net
PPTX
Data focused docker clustering
Inextricably linked: reproducibility and productivity in data science and AI
Monitoring your App in Kubernetes with Prometheus
How and why we got Prometheus working with Docker Swarm
Istio Service Mesh
Docs at Weaveworks: DX from open source to SaaS and beyond
Securing & Enforcing Network Policy and Encryption with Weave Net
Data focused docker clustering

Recently uploaded (20)

PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PDF
Cloud-Scale Log Monitoring _ Datadog.pdf
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
PPTX
Funds Management Learning Material for Beg
DOCX
Unit-3 cyber security network security of internet system
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PPTX
QR Codes Qr codecodecodecodecocodedecodecode
PPTX
international classification of diseases ICD-10 review PPT.pptx
PPTX
Internet___Basics___Styled_ presentation
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PDF
πŸ’° π”πŠπ“πˆ πŠπ„πŒπ„ππ€ππ†π€π πŠπˆππ„π‘πŸ’πƒ π‡π€π‘πˆ 𝐈𝐍𝐈 πŸπŸŽπŸπŸ“ πŸ’°
Β 
PDF
Sims 4 Historia para lo sims 4 para jugar
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PPTX
artificial intelligence overview of it and more
PDF
Testing WebRTC applications at scale.pdf
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
introduction about ICD -10 & ICD-11 ppt.pptx
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
Cloud-Scale Log Monitoring _ Datadog.pdf
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
Funds Management Learning Material for Beg
Unit-3 cyber security network security of internet system
Job_Card_System_Styled_lorem_ipsum_.pptx
QR Codes Qr codecodecodecodecocodedecodecode
international classification of diseases ICD-10 review PPT.pptx
Internet___Basics___Styled_ presentation
SASE Traffic Flow - ZTNA Connector-1.pdf
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PptxGenJS_Demo_Chart_20250317130215833.pptx
πŸ’° π”πŠπ“πˆ πŠπ„πŒπ„ππ€ππ†π€π πŠπˆππ„π‘πŸ’πƒ π‡π€π‘πˆ 𝐈𝐍𝐈 πŸπŸŽπŸπŸ“ πŸ’°
Β 
Sims 4 Historia para lo sims 4 para jugar
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
artificial intelligence overview of it and more
Testing WebRTC applications at scale.pdf
The New Creative Director: How AI Tools for Social Media Content Creation Are...
Decoding a Decade: 10 Years of Applied CTI Discipline

Continuous Delivery the hard way with Kubernetes