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
Patterns In Infrastructure as Code
Search
Takeshi Kondo
April 24, 2020
Technology
8
5.4k
Patterns In Infrastructure as Code
Infra Study Meetup#1
https://forkwell.connpass.com/event/171560/
Takeshi Kondo
April 24, 2020
Tweet
Share
More Decks by Takeshi Kondo
See All by Takeshi Kondo
エンジニアブランディングチームの KPI / KPI's of engineer branding team
chaspy
1
140
「SLO Review」今やるならこうする / If I had to do the "SLO Review" again
chaspy
3
660
開発者とともに作る Site Reliability Engineering / SREing with Developers
chaspy
10
5.6k
自己診断能力の獲得を目指して / Toward the acquisition of self-diagnostic skills
chaspy
1
2.5k
『スタディサプリ 中学講座』における E2E Test の運用と計測による改善 / Improved E2E testing through measurement
chaspy
0
2.7k
『スタディサプリ』における SLI/SLO の継続的改善 / Continuous improvement of SLI/SLO at StudySapuri
chaspy
1
1.8k
ポストモーテム運用を支える文化と技術 / Culture and Technology Supporting Postmortem Operations
chaspy
2
1.1k
Who owns the Service Level?
chaspy
5
9.7k
多様な働き方を支える Working Agreements / Working agreements that support diverse work styles
chaspy
1
1.9k
Other Decks in Technology
See All in Technology
生成AI・LLM時代における 機械学習エンジニアとしてのキャリア戦略・開発戦略 / my-career-and-development-strategies-for-ml-engineer-2024
yuya4
4
950
大規模なアジャイル開発の現場と技術負債 / Technical Debt
yoshiitaka
21
4.1k
Kubeflow Pipelines v2 で変わる機械学習パイプライン開発
asei
4
340
プッシュ型子育てサービスを、先行プロジェクト実施自治体において開始します
govtechtokyo
0
290
Building a RAG app to chat with your data (on Azure)
pamelafox
0
140
Autify Company Deck
autifyhq
1
30k
オブジェクト指向CSSが叶えたかったことと、CSSのいま / The aims of Object-oriented CSS and the current state of CSS usage
shinkufencer
11
3.7k
生成AIサービスPanorama AIご説明資料
sdt
0
300
長文から長文を生成するLLMツールをオープンソースで作ってみた。
tomohisa
2
150
技術イベントはなんとかひねり出す 日経の技術広報の取り組み/techpr3
nishiuma
0
230
GraphQLに入門してみた
chiroruxx
2
130
KubeCon EU 2024 : Knative Maintainers Session
salaboy
0
380
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
174
21k
GraphQLとの向き合い方2022年版
quramy
28
12k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
124
32k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
6
950
StorybookのUI Testing Handbookを読んだ
zakiyama
10
4.5k
Building Applications with DynamoDB
mza
88
5.6k
BBQ
matthewcrist
78
8.7k
The Mythical Team-Month
searls
214
42k
Art, The Web, and Tiny UX
lynnandtonic
288
19k
Designing on Purpose - Digital PM Summit 2013
jponch
109
6.4k
How STYLIGHT went responsive
nonsquared
92
4.7k
Building Adaptive Systems
keathley
29
1.8k
Transcript
Patterns In Infrastructure as Code Takeshi Kondo / @chaspy Infra
Study Meetup #1
Passed
Agenda • Infrastructure as Code in Quipper • Patterns in
Infrastructure as Code 1. Environment Pattern 2. Scaffold Pattern 3. Backup Pattern
Agenda • Infrastructure as Code in Quipper • Patterns in
Infrastructure as Code 1. Environment Pattern 2. Scaffold Pattern 3. Backup Pattern • What • Why • Point • Example
Agenda • Infrastructure as Code in Quipper • Patterns in
Infrastructure as Code 1. Environment Pattern 2. Scaffold Pattern 3. Backup Pattern
Infrastructure as Code in Quipper (1) • Infrastructure / Cloud
(AWS) • Terraform • Codenize.tools (Miam, Roadworker) • Application Platform (Kubernetes) • Kube-aws • Server Provisioning • Ansible
Infrastructure as Code in Quipper (2) • SaaS Configuration •
Datadog • Dashboard • SLO • Monitor • Pingdom • Deadman’s snitch • CircleCI • Environment Variables
Infrastructure as Code in Quipper(2) • SaaS Configuration • Datadog
• Dashboard • SLO • Monitor • Pingdom • Deadman’s snitch • CircleCI • Environment Variables Terraform Codenize.tools (Barkdog) circleci-env (Internal tool)
Infrastructure as Code in Quipper(2) • SaaS Configuration • Datadog
• Dashboard • SLO • Monitor • Pingdom • Deadman’s snitch • CircleCI • Environment Variables Terraform Codenize.tools (Barkdog) circleci-env (Internal tool)
Infrastructure as Code in Quipper(2) • SaaS Configuration • Datadog
• Dashboard • SLO • Monitor • Pingdom • Deadman’s snitch • CircleCI • Environment Variables Terraform Codenize.tools (Barkdog) circleci-env (Internal tool)
Agenda • Infrastructure as Code in Quipper • Patterns in
Infrastructure as Code 1. Environment Pattern 2. Scaffold Pattern 3. Backup Pattern • What • Why • Point • Example
Environment Pattern
Environment Pattern Production Resource Staging Resource Staging Code Production Code
Infrastructure as Code - Chapter 9. Patterns for Defining Infrastructure Apply Apply Change Change
Environment Pattern: Why • To minimize blast radius • To
test before releasing to production
Environment Pattern: Point • Don’t Repeat Yourself • Minimize commonality
• Keep it simple stupid • Enforcing, not communize Infrastructure as Code - 9.2.7 Approaches to Sharing Definitions
Environment Pattern: Example services ᵓᴷᴷ hoge-service ᴹ ᵓᴷᴷ production ᴹ
ᴹ ᵓᴷᴷ aurora.tf ᴹ ᴹ ᵓᴷᴷ main.tf ᴹ ᴹ ᵓᴷᴷ provider.tf ᴹ ᴹ ᵓᴷᴷ terraform.tf ᴹ ᴹ ᵓᴷᴷ terraform.tfvars ᴹ ᴹ ᵓᴷᴷ variables.tf ᴹ ᴹ ᵋᴷᴷ versions.tf ᴹ ᵋᴷᴷ staging ᴹ ᵓᴷᴷ aurora.tf ᴹ ᵓᴷᴷ main.tf ᴹ ᵓᴷᴷ provider.tf ᴹ ᵓᴷᴷ terraform.tf ᴹ ᵓᴷᴷ terraform.tfvars ᴹ ᵓᴷᴷ variables.tf ᴹ ᵋᴷᴷ versions.tf ᵋᴷᴷ modules Terraform ansible ᵋᴷᴷ ubuntu1804 ᵓᴷᴷ reverse-proxy-production ᴹ ᵓᴷᴷ goss ᴹ ᵓᴷᴷ group_vars ᴹ ᴹ ᵓᴷᴷ all.yml ᴹ ᴹ ᵓᴷᴷ development.yml ᴹ ᴹ ᵋᴷᴷ staging.yml ᴹ ᵓᴷᴷ hosts-development ᴹ ᵓᴷᴷ hosts-test ᴹ ᵓᴷᴷ roles ᴹ ᴹ ᵋᴷᴷ nginx ᴹ ᴹ ᵓᴷᴷ files ᴹ ᴹ ᵓᴷᴷ tasks ᴹ ᴹ ᵋᴷᴷ templates ᴹ ᵋᴷᴷ site.yml ᵓᴷᴷ reverse-proxy-staging ᵓᴷᴷ common-roles ᵓᴷᴷ datadog ᵓᴷᴷ td-agent Ansible
Scaffold Pattern
Scaffold Pattern Template Input variable Code Generate
Scaffold Pattern: Why • To make self-service easier • Reduce
cognitive load Infrastructure as Code - 9.1.6 Self-Service Environments
Scaffold Pattern: Point • Write a document • Make each
program do one thing well https://en.wikipedia.org/wiki/Unix_philosophy
Scaffold Pattern: Example • Create new application with Kubernetes manifest
• Create new resource with Terraform HCL • Create AWS Aurora resource definition • Create Datadog SLO Definition
Create AWS Aurora resource definition
Backup Pattern
Backup Pattern Code Resource Import Change manually
Backup Pattern Code Resource Import Change manually Apply
Backup Pattern: Why • Easy to change from GUI (especially
SaaS Configuration) • For backup • For greppability • For bulk replacement
Backup Pattern: Point • Sync Interval • If long, it
may overwrite the actual configuration
Backup Pattern: Example • Datadog Dashboard • Datadog Monitor •
Jenkins Configuration (SCM Sync Plugin)
Datadog Dashboard
Let’s Read http://shop.oreilly.com/product/0636920294382.do
Special Thanks • @suzuki-shunsuke • To lead splitting Terraform state
• To improve CI/CD pipeline • SRE graduates • To introduce of Infrastructure as Code • To build workflow with maintainability
Happy (Infrastructure as) Coding
Thank You! chaspy chaspy_ Site Reliability Engineer at Quipper Takeshi
Kondo Terraform-jp