Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Abstractions – Pittsburgh – The Twelve-Factor C...
Search
Casey West
August 19, 2016
Technology
0
310
Abstractions – Pittsburgh – The Twelve-Factor Container + BONUS
My talk for Abstractions, with bonus material.
Casey West
August 19, 2016
Tweet
Share
More Decks by Casey West
See All by Casey West
Voxxed Days Belgrade 2017: Deploying Image Recognition with TensorFlow and Kubernetes
caseywest
0
130
TechSummit Amsterdam 2017: Enhance! Deploying Image Recognition with TensorFlow and Kubernetes
caseywest
0
160
Said no CEO ever: Things that don't matter in the cloud
caseywest
12
3.2k
OperabilityIO 2016 – Achieving Cloud-Native Operability
caseywest
0
550
ContainerCon North America – Cloud Anti-Patterns
caseywest
3
3.2k
Velocity — Minimum Viable Platform
caseywest
0
270
Minimum Viable Platform - Devops MSP
caseywest
0
220
How Platforms Work
caseywest
0
610
Linux Conf Australia 2016 - The Twelve-Factor Container
caseywest
3
560
Other Decks in Technology
See All in Technology
Opcodeを読んでいたら何故かphp-srcを読んでいた話
murashotaro
0
300
watsonx.ai Dojo #5 ファインチューニングとInstructLAB
oniak3ibm
PRO
0
190
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
300
Amazon VPC Lattice 最新アップデート紹介 - PrivateLink も似たようなアップデートあったけど違いとは
bigmuramura
0
200
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
110
レンジャーシステムズ | 会社紹介(採用ピッチ)
rssytems
0
240
サーバーなしでWordPress運用、できますよ。
sogaoh
PRO
0
110
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
370
祝!Iceberg祭開幕!re:Invent 2024データレイク関連アップデート10分総ざらい
kniino
3
330
PHP ユーザのための OpenTelemetry 入門 / phpcon2024-opentelemetry
shin1x1
3
1.3k
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
280
pg_bigmをRustで実装する(第50回PostgreSQLアンカンファレンス@オンライン 発表資料)
shinyakato_
0
110
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Music & Morning Musume
bryan
46
6.2k
Gamification - CAS2011
davidbonilla
80
5.1k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
A Tale of Four Properties
chriscoyier
157
23k
Designing for humans not robots
tammielis
250
25k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
The Pragmatic Product Professional
lauravandoore
32
6.3k
The Invisible Side of Design
smashingmag
298
50k
GraphQLとの向き合い方2022年版
quramy
44
13k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Transcript
The Twelve-Factor Container 1 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
A word about consent… Please do: Take pictures, tweet, take
notes. Please don't: Record or live stream without my explicit consent. 2 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
The Twelve-Factor Container • Twitter @caseywest • Email
[email protected]
•
Web http://caseywest.com 3 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Thanks, Pivotal 4 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
This isn't really a talk about containers 5 ! @caseywest
#abstractions #containers #realworld #sorrynotsorry
This is a talk about operational maturity 6 ! @caseywest
#abstractions #containers #realworld #sorrynotsorry
You must be this tall to ride this ride 7
! @caseywest #abstractions #containers #realworld #sorrynotsorry
Audience Participation • Containers? • Schedulers? • Cloud? 8 !
@caseywest #abstractions #containers #realworld #sorrynotsorry
Docker Docker Docker Docker Docker Docker Docker Docker 9 !
@caseywest #abstractions #containers #realworld #sorrynotsorry
The factors http://12factor.net 10 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
1: One codebase tracked in revision control, many deploys 11
! @caseywest #abstractions #containers #realworld #sorrynotsorry
Anti-pattern Building separate images for staging and production 12 !
@caseywest #abstractions #containers #realworld #sorrynotsorry
Anti-pattern Tags for dev and prod 13 ! @caseywest #abstractions
#containers #realworld #sorrynotsorry
Best Practice Use the environment and/or feature flags 14 !
@caseywest #abstractions #containers #realworld #sorrynotsorry
2: Explicitly declare and isolate dependencies 15 ! @caseywest #abstractions
#containers #realworld #sorrynotsorry
2: Explicitly declare and isolate dependencies 16 ! @caseywest #abstractions
#containers #realworld #sorrynotsorry
Anti-pattern latest 17 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Best Practice Declare version numbers of upstream dependencies 18 !
@caseywest #abstractions #containers #realworld #sorrynotsorry
Best Practice Depend on base images for default filesystem and
runtimes 19 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
3: Store config in the environment 20 ! @caseywest #abstractions
#containers #realworld #sorrynotsorry
Anti-pattern config.yml 21 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Anti-pattern properties.xml 22 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Anti-pattern Hard-coded feature flags 23 ! @caseywest #abstractions #containers #realworld
#sorrynotsorry
Best Practice This one is literally about environment variables 24
! @caseywest #abstractions #containers #realworld #sorrynotsorry
Best Practice This one is literally about environment variables !
‑ 25 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
4: Treat backing services as attached resources 26 ! @caseywest
#abstractions #containers #realworld #sorrynotsorry
Anti-pattern Local disk 27 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Anti-pattern Local disk 28 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Anti-pattern Local disk 29 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Best Practice Connect to network- attached services using connection info
from the environment 30 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
5: Strictly separate build and run stages 31 ! @caseywest
#abstractions #containers #realworld #sorrynotsorry
Anti-pattern Install on deploy 32 ! @caseywest #abstractions #containers #realworld
#sorrynotsorry
Best Practice Build immutable images then run those images 33
! @caseywest #abstractions #containers #realworld #sorrynotsorry
Painfully Obvious Best Practices 1. Eat when hungry 2. Sleep
when tired 3. Book Casey West for speaking gigs 34 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Best Practice Respect the lifecycle: buid, run, destroy 35 !
@caseywest #abstractions #containers #realworld #sorrynotsorry
6: Execute the app as one or more stateless processes
36 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Best Practice Schedule LRPs by distributing them across a cluster
of physical hardware 37 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Anti-pattern NFS 38 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Anti-pattern NFS Need I say more? 39 ! @caseywest #abstractions
#containers #realworld #sorrynotsorry
7: Export services via port binding 40 ! @caseywest #abstractions
#containers #realworld #sorrynotsorry
Best Practice port = Env.fetch(:PORT) 41 ! @caseywest #abstractions #containers
#realworld #sorrynotsorry
Best Practice my $port = $ENV{PORT}; 42 ! @caseywest #abstractions
#containers #realworld #sorrynotsorry
Best Practice private String getPort() { Map<String, String> env =
System.getenv(); return env.get("PORT"); } 43 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Best Practice let port = env::var("PORT").unwrap() 44 ! @caseywest #abstractions
#containers #realworld #sorrynotsorry
8: Scale out via the process model 45 ! @caseywest
#abstractions #containers #realworld #sorrynotsorry
Best Practice Horizontally scale by adding instances 46 ! @caseywest
#abstractions #containers #realworld #sorrynotsorry
9: Maximize robustness with fast startup and graceful shutdown 47
! @caseywest #abstractions #containers #realworld #sorrynotsorry
10: Keep development, staging, and production as similar as possible
48 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Best Practice Run containers in development 49 ! @caseywest #abstractions
#containers #realworld #sorrynotsorry
11: Treat logs as event streams 50 ! @caseywest #abstractions
#containers #realworld #sorrynotsorry
Anti-pattern Random log files #yolo'd all over the file system
51 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Best Practice STDOUT STDOUT STDOUT STDOUT 52 ! @caseywest #abstractions
#containers #realworld #sorrynotsorry
12: Run admin/ management tasks as one-off processes 53 !
@caseywest #abstractions #containers #realworld #sorrynotsorry
Anti-pattern Custom containers for tasks 54 ! @caseywest #abstractions #containers
#realworld #sorrynotsorry
Best Practice Reuse application images with specific entrypoints for tasks
55 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
More factors? • API first • Secrets management • Health
metrics • Global distribution 56 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
You are now cloud-native 57 ! @caseywest #abstractions #containers #realworld
#sorrynotsorry
Repeatability Reliability Resiliency 58 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Bonus Material 59 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
The five stages of cloud- native 1. Denial 2. Anger
3. Bargaining 4. Depression 5. Acceptance 60 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Have a seat on the couch 61 ! @caseywest #abstractions
#containers #realworld #sorrynotsorry
Whatever makes you comfortable 62 ! @caseywest #abstractions #containers #realworld
#sorrynotsorry
Now for some basic ground rules 63 ! @caseywest #abstractions
#containers #realworld #sorrynotsorry
Rules We will talk about your delivery pipeline 64 !
@caseywest #abstractions #containers #realworld #sorrynotsorry
Rules We will talk about your architecture 65 ! @caseywest
#abstractions #containers #realworld #sorrynotsorry
Rules We will talk about your automation 66 ! @caseywest
#abstractions #containers #realworld #sorrynotsorry
⏰ 67 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
"Deploying my apps to 'the cloud' is paintful. Why?" 68
! @caseywest #abstractions #containers #realworld #sorrynotsorry
Denial 69 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Denial Containers are just like tiny virtual machines 70 !
@caseywest #abstractions #containers #realworld #sorrynotsorry
Denial We don't need to automate continuous delivery 71 !
@caseywest #abstractions #containers #realworld #sorrynotsorry
Anger 72 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Anger Works on my machine 73 ! @caseywest #abstractions #containers
#realworld #sorrynotsorry
Anger Dev is just #YOLO-ing shit to production 74 !
@caseywest #abstractions #containers #realworld #sorrynotsorry
Bargaining 75 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Bargaining We crammed this monolith into a container and called
it a microservice 76 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Bargaining "Bi-Modal IT" 77 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Bargaining What if we create "microservices" that all talk to
the same data source? 78 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Depression 79 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Depression We made 200 microservices and forgot to set up
jenkins 80 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Depression We have an automated build pipeline but release twice
a year 81 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Acceptance 82 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Acceptance All software sucks 83 ! @caseywest #abstractions #containers #realworld
#sorrynotsorry
Acceptance Respect CAP Theorem 84 ! @caseywest #abstractions #containers #realworld
#sorrynotsorry
Acceptance Respect Conway's Law 85 ! @caseywest #abstractions #containers #realworld
#sorrynotsorry
Acceptance Small batch size works for replatforming, too 86 !
@caseywest #abstractions #containers #realworld #sorrynotsorry
Acceptance Automate everything 87 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
⏰'s up 88 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
What have we learned? 89 ! @caseywest #abstractions #containers #realworld
#sorrynotsorry
Operability is 1. Microservices Architecture 2. Devops Culture 3. Continuous
Delivery Pick Three 90 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
@caseywest Let's be friends ! 91 ! @caseywest #abstractions #containers
#realworld #sorrynotsorry