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
Opening - Itamae Meetup#1
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Ryota Arai
December 09, 2015
Programming
3.2k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Opening - Itamae Meetup#1
http://itamae.connpass.com/event/22857/
Ryota Arai
December 09, 2015
More Decks by Ryota Arai
See All by Ryota Arai
Spot Instances in Cookpad #CookpadTechConf 2017
ryotarai
7
9k
Itamae - Infra as Code 現状確認会
ryotarai
55
20k
Introducing Infrataster
ryotarai
9
13k
Infrataster - Infra Behavior Testing Framework #oedo04
ryotarai
17
6.8k
グリーにおけるChef導入事例 ~既存の資産を活かし新しい技術を導入する~
ryotarai
27
7.1k
Other Decks in Programming
See All in Programming
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
220
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.5k
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
14
5.9k
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
150
Contextとはなにか
chiroruxx
1
380
1B+ /day規模のログを管理する技術
broadleaf
0
120
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
610
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
150
Signal Forms: Details & Live Coding @enterJS 2026 in Mannheim
manfredsteyer
PRO
0
200
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
130
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.4k
The NotImplementedError Problem in Ruby
koic
1
970
Featured
See All Featured
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1k
Utilizing Notion as your number one productivity tool
mfonobong
4
330
Embracing the Ebb and Flow
colly
88
5.1k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Paper Plane
katiecoart
PRO
1
52k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
350
YesSQL, Process and Tooling at Scale
rocio
174
15k
Evolving SEO for Evolving Search Engines
ryanjones
0
230
Balancing Empowerment & Direction
lara
6
1.2k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
450
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
Transcript
Itamae Meetup #1 Ryota Arai
ߥҪ ྑଠ • ΫοΫύουͷΤϯδχΞ • Πϯϑϥ෦ॴଐ DevدΓͷOps • ItamaeInfratasterͷ࡞ऀ •
@ryotarai (GitHub), @ryot_a_rai (Twi>er)
Itamae • CFEngine • Puppet • Chef • Ansible •
Itamae
Itamae • Chefʹ͔ͭΕͨਓͷͨΊͷߏཧπʔϧ • ChefʹࣅͨRuby DSL • Chefʹൺγϯϓϧ • SSHܦ༝Ͱͷ࣮ߦΛαϙʔτ
• ࣮ߦରʹItamaeΛΠϯετʔϧ͠ͳ͍Ͱ࣮ߦͰ͖Δ
Chef vs Itamae • ֶ͍शίετ • ֮͑Δࣄฑ͕গͳ͍ • খͯ͘͞ϋϚΓͲ͜Ζ͕গͳ͍ •
͍͟ͱͳͬͨΒίʔυΛ͙͢ಡΊΔେ͖͞ • ChefDKͱ͔ͭΒ͍
Chef • Recipes • Cookbooks • Roles • Environments •
Berkshelf
Itamae • Recipes • Cookbooks -> Recipe • Roles ->
Recipe • Environments -> Recipe • Berkshelf -> Gem, Bundler
Itamae # recipe.rb package "nginx" service "nginx" template "/etc/nginx/nginx.conf" do
notifies :restart, "service[nginx]" end $ itamae local recipe.rb $ itamae ssh -h your-server recipe.rb
Itamaeͷݱঢ় • 513 stars • 802 commits • 38 plugin
gems • 35 contributors • ?? users
ͱ͜ΖͰ
Α͍͘ΘΕΔ͜ͱ ʮItamaeͷϩΰͳ͍ΜͰ͔͢ʙʯ
None
·ͱͳͭͰ͖·ͨ͠
None
ࣗ͝༝ʹ͓͍͍ͩ͘͞ github.com/itamae-kitchen/itamae-logos
ؓٳ
࣮ݧతػೳͷհ
Itamaeͷ࣮ݧతػೳ • ࣮ݧతػೳ: ͻΐͬͱͨ͠Βফ͑ͨΓ༷͕มΘͬͨΓ͢Δ͔ • --recipe-graphΦϓγϣϯ • --profileΦϓγϣϯ • Handler
--recipe-graphΦϓγϣϯ
--recipe-graphΦϓγϣϯ • ϨγϐͷґଘؔΛdotܗࣜͰग़ྗͰ͖Δ • include_recipeͨ͠Ϩγϐ • Ϩγϐ܊͕େ͖͘ͳͬͯ͘Δͱศར͔͠Εͳ͍
None
--recipe-graphΦϓγϣϯ Itamae v1.9.0Ҏ߱ʢv1.9.0Ҏલ--dotΦϓγϣϯʣ $ itamae local --recipe-graph /path/to/itamae-graph.dot recipe.rb $
dot -Tpng -o /path/to/itamae-graph.{png,dot}
--profileΦϓγϣϯ
--profileΦϓγϣϯ • ࣮ߦͨ͠ίϚϯυ͝ͱʹ͔͔͕ͬͨ࣌ؒऔಘͰ͖Δ • ݫີʹSpecinfraͷrun_commandʹ͔͔ͬͨ࣌ؒ • JSONͰग़ྗ͞ΕΔ • ϘτϧωοΫͷௐࠪʹ༗ޮ͔͠Εͳ͍
--profileΦϓγϣϯ $ itamae local --profile /path/to/profile.json recipe.rb $ cat /path/to/profile.json
| jq . | head [ { "command": "mkdir -p /tmp/itamae_tmp", "duration": 0.0037856101989746094 }, { "command": "chmod 777 /tmp/itamae_tmp", "duration": 0.0025980472564697266 }, {
--profileΦϓγϣϯ
Handler
Handler • ࣮ߦ࣌ͷΠϕϯτΛड͚औͬͯҙͷॲཧΛߦ͏ • action_started, attribute_updatedͳͲ • ChefͷHandlerʹࣅ͍ͯΔ • ಠࣗͷHandlerॻ͚Δ
• ࣮ݧతػೳͱ͍͏Ґஔ͚ͮɻͻΐͬͱ͢Δͱ༷͕มߋ͞ΕΔ ͔
$ cat config.yml handlers: - type: json path: /path/to/itamae-log.json $
itamae local -c config.yml recipe.rb $ cat /tmp/itamae-log.json | head {"time":"2015-12-08T15:47:55+09:00","event":"recipe_started", "payload":{"path":"/Users/ryota-arai/src/github.com/ryotarai/itamae/tmp/recipe.rb"}} {"time":"2015-12-08T15:47:55+09:00","event":"resource_started", "payload":{"resource_type":"execute","resource_name":"echo included"}} {"time":"2015-12-08T15:47:55+09:00","event":"action_started", "payload":{"action":"run"}} {"time":"2015-12-08T15:47:55+09:00","event":"attribute_changed", "payload":{"from":{"executed":false}, "to":{"action":"run","command":"echo included","executed":true}}}
Handler • debug handler • ϩάग़ྗ • json handler •
JSON per lineͰϑΝΠϧग़ྗ • fluentd handler • fluent-loggerͰFluentdʹग़ྗ
Handler Gem • lib/itamae/handler/<handler type>.rb͕ࣗಈతʹ require͞ΕΔ • itamae-handler-<type> gemΛͭͬͯ͘Gemfileʹॻ͍͓ͯ ͚ͩ͘ͰOK
Handler Gem # lib/itamae/handler/mail.rb module Itamae module Handler class Mail
< Base def event(type, payload = {}) super send_mail(subject: type.to_s, body: payload.inspect) end end end end
Handler Gem • ৄ͘͠ h$ps:/ /github.com/itamae-kitchen/itamae/tree/ master/lib/itamae/handler Λ
CookpadͱItamae
CookpadͰͷϫʔΫϑϩʔ • Jenkins͕Git্ͷϨγϐΛtar.gzʹ͔ͨΊͯS3ʹΞοϓϩʔυ • ֤ϗετͰS3͔Βμϯϩʔυ͠ItamaeΛ࣮ߦ͢Δckpd- itamaeίϚϯυΛ༻ҙ͍ͯ͠Δ • itamae sshւΛ͑Δͱॏ͍ͷͰϩʔΧϧ࣮ߦΛ͍ͬͯ Δ
• omnibus-itamaeͷdebύοέʔδΛར༻͍ͯ͠Δ
omnibus-itamae • Chef͕ࣾ։ൃ͍ͯ͠ΔOmnibusͱ͍͏ύοέʔδϯάπʔϧΛ ͬͯdeb, rpmύοέʔδΛ࡞ • /opt/itamaeҎԼʹRubyຊମؚΊͯΠϯετʔϧ͞ΕΔ • fat͚ͩͲɺsystem rubyͷόʔδϣϯʹࠨӈ͞Εͳ͍
• Fluentdʹ͓͚Δtd-agentͷΑ͏ͳͷ
omnibus-itamae • ϏϧυࡁΈύοέʔδˏBintray • Ubuntu 14.04, CentOS 7༻ • खݩͰϏϧυՄೳ
$ echo 'deb https://dl.bintray.com/itamae/itamae trusty contrib' | sudo tee /etc/apt/sources.list.d/itamae.list $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv D401AB61 $ sudo apt-get update $ sudo apt-get install itamae
՝ • ϨγϐΛมߋͨ͠ࡍʹશʹө͢ΔΘ͚Ͱͳ͍ • Ϩγϐͱϗετͷݱঢ়͕Εͯɺ͕ࠩେ͖͘ͳΔ • applyͨ͠ΒࢥΘ͵มߋͰোʹͳͬͨΓ • ಛఆͷϗετ͚ͩઃఆ͕ҟͳ͍ͬͯͯো͕ىͬͨ͜Γ •
ϦεΫ͕େ͖͘ͳΔ
Itamae Server • ݱࡏ։ൃதʢҰԠΦʔϓϯιʔεʹͳ͍ͬͯΔʣ • Itamaeͷ࣮ߦͱϩάͷӾཡ͕Ͱ͖Δαʔό • Itamae࣮ߦ෦ʢBackendʣࠩ͠ସ͑Մೳ • HandlerΛ͔ͭͬͯϩάૹ৴
• itamae-handler-itamae_server
None
ߏྫ
Itamae Server • ItamaeΛ࣮ߦ͢ΔBackendࠩ͠ସ͑Մೳ • ྫ͑ɺConsulɺSSHɺStretcherͳͲ • ඇಉظͰitamae-handler-itamae_server͕ϩάΛItamae Serverʹ ૹ৴͢Δ
Itamaeͷࠓޙ • όάϑΟοΫεɺػೳՃ • ֶशίετΛ্͛ͣεϞʔϧελʔτͰ͖ΔΑ͏ʹҡ࣋ • Itamae v2ʢ༧ఆʣ • ϦϑΝΫλɺॻ͖͠ʢಛʹResource::BaseΛࣺ͍ͯͨʣ
• ϨγϐɺϓϥάΠϯͷޙํޓੑҡ࣋ • όοΫΤϯυΛinfra_operatorҠߦ͢Δ͔
ϑΟʔυόοΫΛٻΊ͍ͯ·͢ • Twi%erͰ@ryot_a_rai • Slack: h%ps:/ /itamae-slackin.herokuapp.com/ • Issue: h%ps:/
/github.com/itamae-kitchen/itamae/issues • PR: h%ps:/ /github.com/itamae-kitchen/itamae/pulls