Orchestration is
(necessary)
bad
#0: who am I?
Piotr Stapp
Piotr Stapp
- Unique name - just sing a song: "Don't Stapp me know" ;)
- CEO @ Dotnetomaniak
- VP @ devWarsztaty
- ex - Senior software/DevOps/Architect @mBank/@FinAi/@Allegro
- Principal SAFe System Architect @ Demant Technology Center
- M.Sc (distction) Oxford Brooks University in Web Tech
- M.Sc. Warsaw University of Technology in Computer Science
- And ......
#1: History
(or architecture)
If you can’t feed a team with two pizzas, it’s too large. That limits a task force to five to seven people, depending on their appetites
Jeff Bezos
Why two pizza rule?
\Huge\tfrac{n*(n-1)}{2}
%n = # of people
n = # of people
How many links are in your group?
=> 15 links
=> 66 links
=> 1225 links
\tfrac{n*(n-1)}{2}
Two-pizza team (n=6)
2x two-pizza team
My company (~50 ppl)
Important dates
- 2007.02 -> RabbitMQ initial release -(1.0.0-alpha)
- 2010.10 -> AngularJS initial release
- 2011.05-> "microservice" term in Venice
- 2012.05 -> James Lewis - Micro services - Java, the Unix Way at Kraków
- 2013.03 -> Docker debuted at PyCon
- 2013.05 -> React initial release
- 2014.02 -> Vue.js initial release
- 2014.03 -> Docker 0.9 released
- 2014.06 -> Kubernetes initial release
- 2014.11 -> Docker annouced for AWS EC2
1
#2 Arch VS. release
???
From spaghetti to ...
(simple one)
by @gutek
Repeat & repeat
A bit lasagna and ravioli
by @gutek
"IKEA" release
Modern one
by @gutek and me :)
and ....
Title Text
Who runs the world?
Who runs the world?
The new kingmakers
The new kingmakers
#3 Kubernetes
or K8S (k12345678s)
From standard
by @gutek
to K8S pods
by @gutek
Uwaga: NIEBEZPIECZEŃSTWO
to K8S
1000 words
YAML
apiVersion: apps/v1
kind: Deployment
metadata:
name: #{ApplicationName}#
spec:
selector:
matchLabels:
app: #{ApplicationName}#
replicas: 2
template:
metadata:
labels:
app: #{ApplicationName}#
spec:
containers:
- name: #{ApplicationName}#
image: #{image}#
ports:
- containerPort: 80
---
kind: Service
apiVersion: v1
metadata:
name: #{ApplicationName}#
spec:
selector:
app: #{ApplicationName}#
ports:
- protocol: TCP
port: 80
targetPort: 80
type: ClusterIP
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: #{ApplicationName}#
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
kubernetes.io/ingress.class: internal
spec:
rules:
- http:
paths:
- path: /
backend:
serviceName: #{ApplicationName}#
servicePort: 80
host: #{ApplicationName}#-app-#{EnvironmentName}#.internal.comapny.com
tls:
- secretName: internal.comapny.com
hosts:
- #{ApplicationName}#-app-#{EnvironmentName}#..internal.comapny.com
Deployment strategies
Happy ever after?
Not exactly :(
#4 Five typical problems
Five? O RLY?
#1 - Docker versus VM
VM versus docker
#2 - One instance
Pod are ephemeral
#3 - Deployment...
Deployment
probes
#3 - Automation & CI/CD
CI/CD 7 steps
- Prepare environment variables
- Replace variables in template
- Validate YAML (or Helm)
- Run 'apply' (or Helm)
- Check rollout status
- If status fail then do rollback
- Check rollback status
Example: 7 steps
# prepare variables
export IMAGE=poznajkubernetes/pkad:red
# replace variables
envsubst < yaml/template.yaml > yaml/dep-ready.yaml
# validate
kubeval --strict yaml/dep-ready.yaml
# apply
kubectl apply -f yaml/dep-ready.yaml
# check rollout status
if ! kubectl rollout status deployment pkad-dep; then
# rollback
kubectl rollout undo deployment pkad-dep;
# rollback status
kubectl rollout status deployment pkad-dep;
echo "ERROR - should exit ;)"
fi
#4 - One to rule them all
Databases on K8s
#5 - vanitas vanitatum et omnia vanitas
#5 Future
or not
Next one
Kubernetes-based event-driven autoscaling.
by
Serverless in server room
#7 Where is IaC?
and why
#8 Bad things
or sum-up
Pets VS. cattle
Danger included
Too many tools
Even in Azure
Questions?
Orchestration is bad - doing devops better
By Piotr Stapp
Orchestration is bad - doing devops better
- 75