AgileStacks
DevOps.2D: two dimensions

of engineering
Antons Kranga
@acankr AgileStacks
~whoami Antons Kranga

Director of Engineering

@ Agile Stacks

Building next-gen DevOps automation
@acankr

github.com/akranga

anton@agilestacks.com
Speaking (on the left) 

@OpenSlava 2013, 2014, 2015

• DevOps Automation

• Platform as a Service

• Containers
@acankr AgileStacks
DevOps
@acankr AgileStacks
Culture Engineering
DevOps
@acankr AgileStacks
Culture
* Remove organisational silos
* Build autonomous teams
* Manage releases
Engineering
DevOps
@acankr AgileStacks
* Remove organisational silos
* Build autonomous teams
* Manage releases
* Automate Infrastructure
* Build Continuous Delivery
* Build Operators
* Collect and visualise feedback data
* Cloud computing
* Containers
Culture Engineering
DevOps
@acankr AgileStacks
* Remove organisational silos
* Build autonomous teams
* Manage releases
* Automate Infrastructure
* Build Continuous Delivery
* Build Operators
* Collect and visualise feedback data
* Cloud computing
* Containers
reading reading
(???)
DevOps
Culture Engineering
@acankr AgileStacks
Let’s talk about Engineering
@acankr AgileStacks
Automation
@acankr AgileStacks
Cloud
Networking
Containers
…
appdb cachestorage
Cluster
Infrastructure Stack
@acankr AgileStacks
Cloud
Networking
Containers
…
appdb cachestorage
Cluster
Infrastructure Stack
Security
Performance
Scalability
Availability
Architectureilities…
@acankr AgileStacks
Cloud
Networking
Containers
…
appdb cachestorage
Cluster
Infrastructure Stack
DeploymentTechnology
Security
Performance
Scalability
Availability
Architectureilities…
@acankr AgileStacks
Infrastructure as Code
@acankr AgileStacks
Cloud
Networking
Containers
…
appcache
Cluster
DeploymentTechnology
@acankr AgileStacks
Cloud
Networking
Containers
…
appcache
Cluster
DeploymentTechnology
Code
git
dev
ops
@acankr AgileStacks
Code
git
dev
ops
Code is…
@acankr AgileStacks
Code
git
dev
ops
Code is…
Repeatable
@acankr AgileStacks
Code
git
dev
ops
Code is…
Evolving
Repeatable
@acankr AgileStacks
Code
git
dev
ops
Contract between engineers
Code is…
Repeatable
Evolving
@acankr AgileStacks
Code
git
dev
ops
Exact model of the System
Code is…
Contract between engineers
Repeatable
Evolving
@acankr AgileStacks
D for Deployment
@acankr AgileStacks
Code
engineer
Deployment
Cloud
Networking
Containers
…
Cluster
git
#3ab56d3
Infrastructure Stack
@acankr AgileStacks
Disposable
@acankr AgileStacks
Code
mike
Disposable Deployment
Cloud
Networking
Containers
…
Cluster
…
@acankr AgileStacks
Code
mike
Disposable Deployment
Cloud
Networking
Containers
…
Cluster
…
@acankr AgileStacks
Code
mike
Disposable Deployment
Cloud
Networking
Containers
…
Cluster
…
Stack is broken
@acankr AgileStacks
mike
Disposable Deployment
Disposes a stack
@acankr AgileStacks
Code
mike
Disposable Deployment
Cloud
Networking
Containers
…
Cluster
…
@acankr AgileStacks
Pet vs Cattle
@acankr AgileStacks
Has names

Long living entity

Requires patching, backups etc

Often needs manual nursing

Described as configuration
Pet Cattle
Have numbers not name

Short living entity

Immutable

Dispose instead of nursing

Described as code
@acankr AgileStacks
Where is my pet?
application
database
@acankr AgileStacks
Where is my pet?
application
database
pet
cattle
@acankr AgileStacks
Where is my pet?
application
database
pet
cattle
code
code
@acankr AgileStacks
Where is my pet?
application
database
pet
cattle
user data
@acankr AgileStacks
Secrets (passwords, ssl etc)

Feature toggles

Certificates (TLS)

Domain names

User data backups
Good pets
@acankr AgileStacks
Idempotent
@acankr AgileStacks
Code
john
Cloud
Networking
Containers
…
Cluster
#3ab56d3
Idempotent deployment
@acankr AgileStacks
Code
john
Cloud
Networking
Containers
…
Cluster
#3ab56d3
Codemike
Cloud
Networking
Containers
…
Cluster
===
#3ab56d3
Idempotent deployment
@acankr AgileStacks
Idempotent deployment
Cloud
Networking
Containers
…
Cluster
#3ab56d3
Cloud
Networking
Containers
…
Cluster
===
#3ab56d3
Repeated deployment
produces the same result
@acankr AgileStacks
Idempotent deployment
Cloud
Networking
Containers
…
Cluster
#3ab56d3
Cloud
Networking
Containers
…
Cluster
===
#3ab56d3
Repeated deployment
produces the same result
Every component must be idempotent
@acankr AgileStacks
Idempotent deployment
Cloud
Networking
Containers
…
Cluster
#3ab56d3
Cloud
Networking
Containers
…
Cluster
===
#3ab56d3
Repeated deployment
produces the same result
Every component must be idempotent
Commit hash is an exact version
@acankr AgileStacks
Git Ops
@acankr AgileStacks
Git is the only source of truth
@acankr AgileStacks
Git is the only source of truth
User makes a pull request to start
deployment
@acankr AgileStacks
mike
Cloud
Networking
Containers
…
Cluster
…
gitcode
+
operator
@acankr AgileStacks
mike
Cloud
Networking
Containers
…
Cluster
…
gitcode
+
operator
Pull Request
#73ba2ef
@acankr AgileStacks
mike
Cloud
Networking
Containers
…
Cluster
…
gitcode
+
operator
Pull Request
#73ba2ef
web hook

notification
@acankr AgileStacks
mike
Cloud
Networking
Containers
…
Cluster
…
gitcode
+
operator
#73ba2ef
Pull Request
web hook

notification
check

difference
@acankr AgileStacks
mike
Cloud
Networking
Containers
…
Cluster
…
gitcode
+
operator
#73ba2ef
Pull Request
web hook

notification
check

difference
deploy change
@acankr AgileStacks
Deployment
challenges
@acankr AgileStacks
gitcode
+
@acankr AgileStacks
Cloud
Networking
Containers
…
Cluster
#3ab56d3
Cloud
Networking
Containers
…
Cluster
#3ab56d3
Cloud
Networking
Containers
…
Cluster
gitcode
+
#3ab56d3
@acankr AgileStacks
Cloud
Networking
Containers
…
Cluster
#3ab56d3
Cloud
Networking
Containers
…
Cluster
#3ab56d3
Cloud
Networking
Containers
…
Cluster
gitcode
+
#3ab56d3
development QA production
@acankr AgileStacks
Cloud
Networking
Containers
…
Cluster
#3ab56d3
Cloud
Networking
Containers
…
Cluster
gitcode
+
#3ab56d3
QA production
@acankr AgileStacks
Challenges
Cloud
Networking
Containers
…
Cluster
#3ab56d3
Cloud
Networking
Containers
…
Cluster
gitcode
+
#3ab56d3
QA production
Time to deploy
@acankr AgileStacks
Challenges
Cloud
Networking
Containers
…
Cluster
#3ab56d3
Cloud
Networking
Containers
…
Cluster
gitcode
+
#3ab56d3
QA production
Time to deploy
Deployment success rate
@acankr AgileStacks
D for Delivery
@acankr AgileStacks
Every commit can trigger a new release
Wait time is a waste for engineering
@acankr AgileStacks
Cloud
Networking
Containers
…
Cluster
Cloud
Networking
Containers
…
Cluster
Cloud
Networking
Containers
…
Cluster
development QA production
mike
@acankr AgileStacks
Cloud
Networking
Containers
…
Cluster
Cloud
Networking
Containers
…
Cluster
Cloud
Networking
Containers
…
Cluster
development QA production
mike
@acankr AgileStacks
Cloud
Networking
Containers
…
Cluster
Cloud
Networking
Containers
…
Cluster
Cloud
Networking
Containers
…
Cluster
development QA production
mike git ci#73ba2ef
@acankr AgileStacks
Cloud
Networking
Containers
…
Cluster
Cloud
Networking
Containers
…
Cluster
Cloud
Networking
Containers
…
Cluster
development QA production
mike git ci#73ba2ef
@acankr AgileStacks
mike git ci#73ba2ef
Change must be non deterministic
@acankr AgileStacks
mike git ci#73ba2ef
Change must be non deterministic
Deployment must be atomic
@acankr AgileStacks
mike git ci#73ba2ef
Change must be non deterministic
Deployment must be atomic
Application must not becomes a pet
@acankr AgileStacks
mike git ci#73ba2ef
Change must be non deterministic
Deployment must be atomic
Application must not becomes a pet
Deployment breaks stack immutability
@acankr AgileStacks
Invert dependencies of application
Good delivery means
@acankr AgileStacks
Invert dependencies of application
Application should only make
assumptions about it’s state
Good delivery means
@acankr AgileStacks
Invert dependencies of application
Application should only make
assumptions about it’s state
Application should not make
assumptions about environment
Good delivery means
@acankr AgileStacks
Invert dependencies of application
Application should only make
assumptions about it’s state
Application should not make
assumptions about environment
Application can change state of the
stack via operators
Good delivery means
@acankr AgileStacks
Operators
@acankr AgileStacks
Operator is the program that
performs automated operation
@acankr AgileStacks
Operator is the program that
performs automated operation
Operator typically writes in general
purpose programming language
@acankr AgileStacks
Operator is the program that
performs automated operation
Reduces need of complex CD
tools like GoCD or Spinnaker
Operator typically writes in general
purpose programming language
@acankr AgileStacks
serviceoperator
backend
watch
@acankr AgileStacks
serviceoperator
backend
watch
john
make
backup
@acankr AgileStacks
serviceoperator
backend
watch
john
declare new state
@acankr AgileStacks
serviceoperator
backend
react
john
declare new state
@acankr AgileStacks
serviceoperator
backend
react
john
declare new state
check state
@acankr AgileStacks
serviceoperator
backend
react
john
declare new state
converge
check state
@acankr AgileStacks
Cloud
Networking
Containers
Cluster
git
Infrastructure Stack
mike git ci
db
Scenario:

Deployment requires 

database change
@acankr AgileStacks
Cloud
Networking
Containers
Cluster
git
Infrastructure Stack
mike git ci
db operator
Scenario:

Deployment requires 

database change
@acankr AgileStacks
Cloud
Networking
Containers
Cluster
git
Infrastructure Stack
mike git ci#73ba2ef
db operator
Scenario:

Deployment requires 

database change
app
@acankr AgileStacks
Cloud
Networking
Containers
Cluster
git
Infrastructure Stack
mike git ci#73ba2ef
db operator
Scenario:

Deployment requires 

database change
app
@acankr AgileStacks
Final thoughts
@acankr AgileStacks
You need to think in both D.
@acankr AgileStacks
You need to think in both D.
All code must be idempotent
@acankr AgileStacks
You need to think in both D.
All code must be idempotent
Avoid big over configured clusters.
Use micro clusters
@acankr AgileStacks
You need to think in both D.
All code must be idempotent
Avoid big over configured clusters.
Use micro clusters
Reduce tools if you can
@acankr AgileStacks
Thank you
https://www.slideshare.net/akranga/devops2d-two-dimensions-of-engineering
This presentation has been available
https://goo.gl/2hGR5S

DevOps.2D: two dimensions
of engineering