Infrastructure as Codeのこれまでとこれから/Infra Study Meetup #1

Infrastructure as Codeのこれまでとこれから/Infra Study Meetup #1

0d5d8fb9cc4c06f581825f5a61d3f5f1?s=128

Gosuke Miyashita

April 24, 2020
Tweet

Transcript

  1. Infrastructure as Code ͷ͜Ε·Ͱͱ͜Ε͔Β Infra Study Meetup #1ʮInfrastructure as Codeʯ

    1
  2. ͸͡Ίʹ • ຊ೔͓࿩͢͠Δ಺༰͸ɺҎԼͷϒϩάΤϯτϦ΍ϓϨθϯͷ಺༰Λ࠶ฤͨ͠΋ ͷͰ͢ • Infrastructure as Code ࠶ߟ -

    Gosuke Miyashita1 • Infrastructure as Code ͷ͜Ε·Ͱͱ͜Ε͔Β at Recruit Technologies Open Lab #032 • Infrastructure as Codeͱ͸Կ͔ͦͯ͠ԿͰ͋Δ΂͖͔ at Codenize Meetup3 3 https://speakerdeck.com/mizzy/infrastructure-as-code-at-codenize-meetup 2 https://speakerdeck.com/mizzy/infrastructure-as-code 1 https://mizzy.org/blog/2016/04/22/1/ Infra Study Meetup #1ʮInfrastructure as Codeʯ 2
  3. ֓ཁ • Infrastructure as Codeͷྺ࢙ • ݱࡏͷInfrastructure as Code •

    Infrastructure as Codeͷ͜Ε͔Β • ҎԼʮIaCʯͱུ͠·͢ Infra Study Meetup #1ʮInfrastructure as Codeʯ 3
  4. IaCͷྺ࢙ Infra Study Meetup #1ʮInfrastructure as Codeʯ 4

  5. IaCͱ͸Կ͔ • ௚༁͢Δͱʮίʔυͷͯ͠ͷΠϯϑϥʯ • ʮΠϯϑϥΛίʔυͰهड़͢Δʯ͜ͱ • ࣈٛతʹ͸͜Ε͚ͩ • ԿͷͨΊʹ΍Δͷ͔ɺͲΜͳԸܙ͕ड͚ΒΕΔͷ͔ɺͱ͍͏ ҙຯ͸͜ͷݴ༿ʹ͸ؚ·Ε͍ͯͳ͍

    Infra Study Meetup #1ʮInfrastructure as Codeʯ 5
  6. IaCͷྫ (Chef) package 'nginx' do action :install end service 'nginx'

    do action [:enable, :start] end Infra Study Meetup #1ʮInfrastructure as Codeʯ 6
  7. IaCͷྫ (Ansible) - name: install nginx apt: name=nginx - name:

    start nginx service: name=nginx enabled=yes state=started Infra Study Meetup #1ʮInfrastructure as Codeʯ 7
  8. IaCͷྫ (Kubernetes) apiVersion: v1 kind: Pod metadata: name: nginx spec:

    containers: - name: nginx-container - image: nginx:1.17 Infra Study Meetup #1ʮInfrastructure as Codeʯ 8
  9. IaCͷྫ (Terraform) resource "aws_instance" "example" { ami = "ami-07f4cb4629342979c" instance_type

    = "t3.medium" subnet_id = aws_subnet.private_0.id iam_instance_profile = aws_iam_instance_profile.ec2_for_ssm.name tags = { Name = "example" } } Infra Study Meetup #1ʮInfrastructure as Codeʯ 9
  10. IaCͱ͍͏ݴ༿ͷॳग़ • 2008೥ࠒ • ChefࣾCo-FounderͰ͋ΔAdam JcobࢯͷWeb 2.0 Expo San Francisco

    2008 ͰͷWhy Startups Need Automated Infrastructuresͱ͍͏λΠτϧͷϓϨθϯ4 • ͜ͷϓϨθϯ͸ChefͷϦϦʔεલ͕ͩɺChefͷInitial Commit5͸͜ΕΑΓগ͠ લ • Chef͸͍ΘΏΔConfiguration Management Toolsͷͻͱͭ 5 https://github.com/chef/chef/commit/b5117775e86cff40399187b6292c98fba9dc5034 4 https://www.slideshare.net/adamhjk/why-startups-need-automated-infrastructures Infra Study Meetup #1ʮInfrastructure as Codeʯ 10
  11. Infra Study Meetup #1ʮInfrastructure as Codeʯ 11

  12. IaCͷىݯ • Ͱ͸Chef͕IaCͷىݯʁ • Chef͸Puppet(2005೥ϦϦʔε)ͷӨڹΛड͚͍ͯΔ • Puppet͸CFEngine(1993೥ϦϦʔε)ʹӨڹΛड͚͍ͯΔ • CFEngine͕IaCͷىݯͱ͍͑ͦ͏ Infra

    Study Meetup #1ʮInfrastructure as Codeʯ 12
  13. IaCͷᴈ໌ظ • CFEngineͷӨڹΛड͚ͨPuppetొ৔ (2005೥) • Puppet͕޿͘ड͚ೖΕΒΕΔ • PuppetͷΑ͏ͳConfiguration Managementख๏ΛIaCͱݺ΅ ͏ͱ୭͔͕ݴͬͨʢAdam

    Jcobࢯʁʣ • Adam Jcobࢯ͕Puppet inspiredͳChefΛ։ൃͨ͠ • Chefͷ޿·Γͱͱ΋ʹIaCͱ͍͏ݴ༿΋޿·Δ Infra Study Meetup #1ʮInfrastructure as Codeʯ 13
  14. ᴈ໌ظ͸ࣗಈԽ͕য఺ • Configuration ManagementͷࣗಈԽ • CFEngingͱ͍͏໊લ͸ʮConfiguration Engineʯ͔Β7 • Puppet࿦จͷλΠτϧ͸ʮPuppet: Next-Generation

    Configuration Managementʯ8 • Adam JcobࢯͷIaCʹؔ͢ΔϓϨθϯͷλΠτϧ͸ʮWhy Startups Need Automated Infrastructuresʯ • ࠷ॳͷয఺͸Configuration ManagementͷࣗಈԽ 8 https://www.usenix.org/publications/login/february-2006-volume-31-number-1/puppet-next-generation-configuration- management 7 Burgess, Mark. "University of Oslo : Cfengine V2.0 : A network configuration tool" (PDF). Iu.hio.no. Archived from the original (PDF) on 2013-07-23. Retrieved 2013-09-08. Infra Study Meetup #1ʮInfrastructure as Codeʯ 14
  15. ༨ஊ: ผࢹ఺͔ΒͷIaC • ॻ੶ʮ΢ΣϒΦϖϨʔγϣϯʯ9ͰAdam Jcobࢯ͸ɺ IaC Λʮιʔείʔ υϦϙδτϦɾΞϓϦέʔγϣϯσʔλͷόοΫΞοϓɾαʔόϦιʔ ε͔ΒϏδωεΛ෮چͰ͖ΔΑ͏ʹ͢Δ͜ͱʯͱड़΂͍ͯΔ(2010೥) •

    ౰࣌Adam Jcobࢯ͸σΟβελϦΧόϦతͳࢹ఺͔Β΋IaCΛଊ͍͑ͯ ͨ • ͜Ε΋ࣗಈԽͱ͍͑͹ࣗಈԽͷ࿩Ͱ͸͋Δ 9 https://www.oreilly.co.jp/books/9784873114934/ Infra Study Meetup #1ʮInfrastructure as Codeʯ 15
  16. Πϯϑϥ΁ͷΞδϟΠϧͷྲྀೖ • Agile Infrastructure and Operations (2008೥)10 • DevOps (2009೥)

    • IaC͕͜ΕΒͱ݁ͼ͖ͭɺ୯ʹγεςϜ؅ཧΛࣗಈԽ͢ΔͨΊͷ΋ͷͰ͸ͳ͘ɺόʔδϣϯ؅ ཧɺςετɺܧଓతΠϯςάϨʔγϣϯ(CI)ͱ͍ͬͨɺιϑτ΢ΣΞ։ൃͷϓϥΫςΟεΛγ εςϜ؅ཧʹԠ༻͢ΔͨΊͷ΋ͷɺͱҙຯ߹͍͕มΘ͖ͬͯͨ • ͨͩ͠ɺ༗໊ͳʮ10+ Deploys Per Day: Dev and Ops Cooperation at Flickrʯ11ͱ͍͏εϥΠ υʹ͸ʮAutomated infrastructureʯͱ͍͏ݴ༿͕͋ΔΑ͏ʹɺ2009೥౰࣌΋·ͩࣗಈԽ͕য ఺ 11 https://www.slideshare.net/jallspaw/10-deploys-per-day-dev-and-ops-cooperation-at-flickr 10 http://www.jedi.be/presentations/IEEE-Agile-Infrastructure.pdf Infra Study Meetup #1ʮInfrastructure as Codeʯ 16
  17. ༨ஊ: DevOpsͱ͍͏ݴ༿ͷॳग़ • ʮ10+ Deploys Per Day: Dev and Ops

    Cooperation at Flickrʯʹ͸ʮDevOpsʯͱ͍͏ݴ༿͸௚઀͸ ग़ͯ͜ͳ͍ • ؍ଌͰ͖ΔݶΓҰ൪ݹ͍ॳग़͸ɺ্هεϥΠυʹݴٴͨ͠Andrew Cray ShaferࢯͷπΠʔτ12 • Devopsdays Ghent 2009(࠷ॳͷDevopsdaysΠϕϯτ)13Λओ࠵ͨ͠Patrick Deboisࢯ͕ͭ͘Γग़ͨ͠ ݴ༿ͱ΋ݴΘΕ͍ͯΔ • Agile Infrastructure and Operations΋Patrick DeboisࢯʹΑΔݴ༿ͰDevOpsͷݯྲྀͱݴΘΕ͍ͯΔ • DevOpsͱ͍͏ݴ༿Λͭͬͨ͘ͷ͸Patrick Deboisࢯɺͱ͍͏֬ͨΔূڌ͸ݟ͚ͭΒΕͳ͍͕ɺ Patrick Deboisࢯ͕ʮDevOpsͷ෕ʯͱݺ͹ΕΔ͜ͱʹҟΛএ͑Δਓ͸͍ͳͦ͞͏ 13 https://legacy.devopsdays.org/events/2009-ghent/ 12 https://twitter.com/littleidea/status/2299941379 Infra Study Meetup #1ʮInfrastructure as Codeʯ 17
  18. IaCͱ։ൃϓϥΫςΟεͷ༥߹ • 2011೥6݄ʹO'Reilly Media͔Βୈ1൛͕ग़൛͞ΕͨTest- Driven Infrastructure with Chef14 • ʮςετۦಈʯͱ͍͏۩ମతͳϓϥΫςΟε͕ొ৔ͨ͜͠ͱ

    ʹΑΓɺʮܧଓతΠϯςάϨʔγϣϯʯ΍ʮܧଓతσϓϩ Πʯͱ͍ͬͨଞͷϓϥΫςΟεʹ΋޿͕͍ͬͯͬͨ • ੿࡞ͷServerspec΋͜ͷྲྀΕΛՃ଎͢ΔͷʹҰ໾ങ͍ͬͯΔ 14 http://shop.oreilly.com/product/0636920030973.do Infra Study Meetup #1ʮInfrastructure as Codeʯ 18
  19. IaaSྖҬ΁ͷIaCͷద༻ • Amazon EC2ͷΑ͏ͳɺAPIͰϓϩάϥϚϒϧʹѻ͑ΔIaaSͷ ීٴ • IaaSΛѻ͏Terraform΍CloudFormationͱ͍ͬͨπʔϧ΍ αʔϏεͷొ৔ • ͜ΕΒͷϓϥοτϑΥʔϜ΍πʔϧ΋IaCͷର৅ྖҬʹͳͬͨ

    Infra Study Meetup #1ʮInfrastructure as Codeʯ 19
  20. Infra Study Meetup #1ʮInfrastructure as Codeʯ 20

  21. ίϯςφྖҬ΁ͷIaCͷద༻ • ྫ͑͹YAMLͰίϯςφΦʔέετϨʔγϣϯΛߦ͏ Kubernetes • ͜ͷลΓʹͳΔͱIaC͸طʹ౰ͨΓલͷ΋ͷʹͳ͍ͬͯͯɺ͜ ͱ͞ΒIaCΛ΍͍ͬͯΔɺͱ͍͏ҙࣝ͸ͳ͍ͷͰ͸ Infra Study Meetup

    #1ʮInfrastructure as Codeʯ 21
  22. IaCͷྺ࢙·ͱΊ • ࠷ॳ͸γεςϜ؅ཧͷࣗಈԽͷΈ͕য఺ͱͳ͍ͬͯͨ • ͦͷޙAgeile infrastructure/operations΍DevOpsͱͷ݁ͼͭ ͖ɺιϑτ΢ΣΞ։ൃͷϓϥΫςΟεΛγεςϜ؅ཧʹԠ༻ ͢ΔͨΊͷ΋ͷɺͱҙຯ߹͍͕มΘ͖ͬͯͨ • APIͰϓϩάϥϚϒϧʹѻ͑ΔIaaSͱͦΕΒΛૢ࡞͢Δπʔϧ

    ΍ίϯςφͷීٴʹΑΓର৅ྖҬ͕֦େͨ͠ Infra Study Meetup #1ʮInfrastructure as Codeʯ 22
  23. ݱࡏͷIaC Infra Study Meetup #1ʮInfrastructure as Codeʯ 23

  24. ΦϥΠϦʔຊ͔ΒಡΈ ղ͘ݱ୅ͷIaC • ݱࡏ͸IaC͕ͲͷΑ͏ʹଊ͑ΒΕ͍ͯ Δͷ͔ɺॻ੶ʮInfrastructure as Codeʯ15ୈ1ষͷ಺༰Λ༻͍ͯղઆ͠ ·͢ • ͻͱ͜ͱͰݴ͏ͱʮΫϥ΢υωΠ

    ςΟϒͳࢹ఺͔Βଊ͑ͨIaCʯ 15 https://www.oreilly.co.jp/books/9784873117966/ Infra Study Meetup #1ʮInfrastructure as Codeʯ 24
  25. Infrastructure as Code, 2nd Edition16 • 2020೥12݄ϦϦʔε༧ఆ • ΞʔϦʔϦϦʔε൛͕ಡΊΔ •

    ॳ൛ͱͷࠩ෼ʹ͍ͭͯ͸ཁॴཁॴͰ ݴٴ͠·͕͢ɺॳ൛Λϕʔεʹ͓࿩ ͠Λ͠·͢ 16 http://shop.oreilly.com/product/0636920294382.do Infra Study Meetup #1ʮInfrastructure as Codeʯ 25
  26. ৽ͨͳ໰୊ͷݦࡏԽ • μΠφϛοΫΠϯϑϥετϥΫνϟϓϥοτϑΥʔϜͷීٴ • खܰʹΠϯϑϥ͕ߏஙͰ͖ΔΑ͏ʹͳͬͨ • ΠϯϑϥௐୡͷϦʔυλΠϜ͕ϘτϧωοΫͰ͸ͳ͘ͳͬͨ • ͜ΕΒʹΑΓ৽ͨͳΠϯϑϥ؅ཧ্ͷ໰୊͕ݦࡏԽͨ͠ Infra

    Study Meetup #1ʮInfrastructure as Codeʯ 26
  27. ݦࡏԽͨ͠໰୊ • αʔόʔεϓϩʔϧ • ߏ੒υϦϑτ • εϊʔϑϨʔΫαʔόʔ • ੬ऑͳΠϯϑϥ •

    Φʔτϝʔγϣϯڪා঱ • γεςϜർ࿑ Infra Study Meetup #1ʮInfrastructure as Codeʯ 27
  28. αʔόʔεϓϩʔϧ • sprawlʲsprɔ́ːlʳ: όϥόϥʹ޿͕Δɺແடংʹ޿͕Δ • αʔό͕؆୯ʹཱͯΒΕΔͷͰ؅ཧೳྗΛ௒͑ͯཚཱ • ઃఆมߋ΍ύον౰ͯͷ࡞ۀʹ௥ΘΕΔ • ·ͨ͸์ஔ͞ΕΔ

    • ඍົʹߏ੒/ઃఆ͕ҧ͏αʔό͕૿͑Δ → ߏ੒υϦϑτ Infra Study Meetup #1ʮInfrastructure as Codeʯ 28
  29. ߏ੒υϦϑτ • ͕࣌ؒܦͭʹͭΕͯߏ੒/ઃఆͷࠩҧ͕ฆΕࠐΉ • ಛఆͷαʔό͚ͩҰ࣌తͳରԠͯ͠໭͠๨ΕΔ • ৬ਓʹΑΔख࡞ۀɺ͔͠΋ਓʹΑͬͯ΍Γํҧ͏ • εϊʔϑϨʔΫαʔό΍Φʔτϝʔγϣϯڪා঱ΛੜΈग़͢ Infra

    Study Meetup #1ʮInfrastructure as Codeʯ 29
  30. εϊʔϑϨʔΫαʔό • ଞͷαʔόͱߏ੒/ઃఆ͕ҟͳΔαʔό • εϊʔϑϨʔΫ ʹ ઇͷ݁থ • ߏ੒/ઃఆ͕೺Ѳ͖͠ΕͣΞϯλονϟϒϧʹ •

    εϊʔϑϨʔΫαʔόͷ૿৩ → ੬ऑͳΠϯϑϥ Infra Study Meetup #1ʮInfrastructure as Codeʯ 30
  31. ੬ऑͳΠϯϑϥ • εϊʔϑϨʔΫαʔό͕ຮԆͯ͠Πϯϑϥશମ͕੬ऑʹͳΔ • γεςϜશମ͕؆୯ʹյΕम෮ෆೳ Infra Study Meetup #1ʮInfrastructure as

    Codeʯ 31
  32. Φʔτϝʔγϣϯڪා঱ • εϊʔϑϨʔΫαʔό͕૿͑ΔͱɺࣗಈԽπʔϧ͕΋ͨΒ͢ ݁Ռ͕༧ଌෆೳʹͳΔ • ݁Ռͱͯ͠πʔϧ͕े෼ʹ׆͔ͤͳ͍ɺ࢖͑ͳ͍ • ࣗಈԽʹΑΓ໰୊ΛղফΛͨͯ͘͠΋Ͱ͖ͳ͍ѱ॥؀ Infra Study

    Meetup #1ʮInfrastructure as Codeʯ 32
  33. γεςϜർ࿑ • ݪจͰ͸Erosionʢਁ৯ɺ่յɺࢎḝͳͲʣ • Կ΋͠ͳͯ͘΋࣌ؒͷܦաͱͱ΋ʹγεςϜ͕յΕ͍ͯ͘ • OSΞοϓάϨʔυɺΧʔωϧύονɺϛυϧ΢ΣΞ੬ऑੑͷηΩϡϦ ςΟΞοϓσʔτ • ϩά૿େʹΑΔσΟεΫ࢒༰ྔͷফ໓

    • ϓϩηεͷΫϥογϡɺແݶϧʔϓͳͲͰհೖ͕ඞཁʹͳΔ • ϋʔυ΢ΣΞΤϥʔ Infra Study Meetup #1ʮInfrastructure as Codeʯ 33
  34. ݦࡏԽͨ͠໰୊఺·ͱΊ • αʔόʔεϓϩʔϧ • ߏ੒υϦϑτ • εϊʔϑϨʔΫαʔόʔ • ੬ऑͳΠϯϑϥ •

    Φʔτϝʔγϣϯڪා঱ • γεςϜർ࿑ • ཁ͢ΔʹɺαʔόΛ͹Μ͹ΜཱͯΒΕΔΑ͏ʹͳ͍ͬͨͤͰɺมߋ؅ཧ͕ഁ໓ͯ͠ γεςϜ͕ࢮ͵ɺͰ΋มߋ͠ͳ͍Θ͚ʹ͸͍͔ͳ͍ɺͱ͍͏࿩ Infra Study Meetup #1ʮInfrastructure as Codeʯ 34
  35. ৽ͨͳ໰୊͕ݦࡏԽͨ͠ཁҼ • ͦΕ·Ͱආ͚೉͍ϘτϧωοΫͱଊ͑ΒΕ͍ͯͨϦʔυλΠ Ϝ͕ϘτϧωοΫͰ͸ͳ͘ͳͬͨ • ϏδωεཁٻͷมԽʹΠϯϑϥଆ΋ਝ଎ʹରԠ͢Δඞཁੑ͕ ग़͖ͯͨ • ैདྷͷ؅ཧΞϓϩʔνͰ͸͜ͷ଎౓ʹ͍͍͚ͭͯͳ͍ Infra

    Study Meetup #1ʮInfrastructure as Codeʯ 35
  36. ݦࡏԽͨ͠໰୊Λղܾ͢ΔͨΊͷIaC • μΠφϛοΫΠϯϑϥετϥΫνϟͷൃలɾීٴʹΑΓɺ৽ ͨʹग़͖ͯͨ໰୊Λղܾ͢ΔͨΊͷΞϓϩʔν͕IaC • ϏδωεཁٻͷมԽʹ͋Θͤͯਝ଎ʹΠϯϑϥΛมߋ͢Δ • ৽ͨʹݦࡏԽͨ͠มߋ؅ཧ্ͷ໰୊Λղܾ͢Δ • ཁ͢Δʹʮมߋ؅ཧ͕༰қͳΠϯϑϥΛͭ͘ΔʯͨΊͷΞϓ

    ϩʔν͕IaC Infra Study Meetup #1ʮInfrastructure as Codeʯ 36
  37. IaCͷݪଇ • ؆୯ʹ࠶ݱͰ͖ΔγεςϜ • ࢖͍ࣺͯʹͰ͖ΔγεςϜ • ౷ҰతͳγεςϜ • ൓෮Ͱ͖Δϓϩηε •

    ઈ͑ͣมԽ͢ΔσβΠϯ Infra Study Meetup #1ʮInfrastructure as Codeʯ 37
  38. ؆୯ʹ࠶ݱͰ͖ΔγεςϜ • ͋ΒΏΔߏ੒ཁૉ͸ਓखΛ͔͚ͣʹ࣮֬ʹ࠶ߏஙͰ͖Ͷ͹ͳ Βͳ͍ • εϊʔϑϨʔΫԽΛආ͚ΒΕΔ • ߏஙɺ࠶ߏங͕؆୯Ͱ͋Ε͹ɺมߋΛՃ͑Δͱ͖ͷϦεΫ΍ ڪා৺ͷେ൒͕औΓআ͔ΕΔ Infra

    Study Meetup #1ʮInfrastructure as Codeʯ 38
  39. ࢖͍ࣺͯʹͰ͖ΔγεςϜ • μΠφϛοΫΠϯϑϥετϥΫνϟʹΑΓϦιʔε͕؆୯ʹ࡞ ੒ɺഁغɺަ׵ɺมߋɺҠಈͰ͖Δ • ͜ͷϝϦοτΛ׆͔ͨ͢Ίʹ͸ɺαʔό͕ফ͑ͨΓݱΕͨΓมԽ ͨ͠Γͯ͠΋ɺαʔϏε͕ܧଓͰ͖ΔΑ͏ʹઃܭ͢΂͖ • ͍ͭͰ΋࢖͍ࣺͯʹͰ͖Δͱ͍͏͜ͱ͸ɺมԽΛॊೈʹॲཧͰ ͖ɺվྑɺमਖ਼ΛՃ͑Δ͜ͱ͕؆୯ʹͳΔ

    • Τϥʔ଱ੑ΋ߴ͘ͳΔ Infra Study Meetup #1ʮInfrastructure as Codeʯ 39
  40. ౷ҰతͳγεςϜ • ಉ͡Α͏ͳαʔϏεΛఏڙ͢Δෳ਺ͷαʔό͸ಉ͡ߏ੒/ઃఆͰ ͋Δ΂͖ • ߏ੒/ઃఆʹҧ͍͕͋ΔͱࣗಈԽπʔϧ͕΋ͨΒ݁͢Ռ͕༧ଌෆ ೳʹ • ࣗಈԽͷ৴པੑ͕ଛͳΘΕΔͱɺมߋ͕ࠔ೉ʹͳΔ •

    ౷ҰతͳγεςϜΛ࠶ߏஙՄೳʹ͓ͯ͘͠ͱɺߏ੒υϦϑτͷղ ফʹ໾ཱͭ Infra Study Meetup #1ʮInfrastructure as Codeʯ 40
  41. ൓෮Ͱ͖Δϓϩηε • Πϯϑϥʹର͢ΔΞΫγϣϯΛεΫϦϓτͳΓπʔϧͳΓͰ ൓෮Մೳʹ͢Δ • ࠶ߏஙͷ͠΍͢͞ʹͭͳ͕Γɺ؆୯ʹ࠶ݱͰ͖Δ౷Ұతͳγ εςϜΛߏ੒Ͱ͖Δ Infra Study Meetup

    #1ʮInfrastructure as Codeʯ 41
  42. ઈ͑ͣมԽ͢ΔσβΠϯ • μΠφϛοΫΠϯϑϥετϥΫνϟͰ͸طଘγεςϜʹมߋΛՃ͑ Δͷ͸؆୯ • ͜Ε͸͢΂ͯͷ෦෼͕มߋ͠΍͘͢ઃܭ͞Ε͍ͯΔͱ͍͏લఏͷݩ • ιϑτ΢ΣΞͱΠϯϑϥ͸ɺมߋ͠΍͍͢Α͏Ͱ͖ΔݶΓ୯७ʹ ઃܭ͞Ε͍ͯͳ͚Ε͹ͳΒͳ͍ •

    ͻΜͺΜʹมߋ͢Δɻมߋ͕සൟͳΒ൱Ԡͳ͘มߋ؅ཧʹదͨ͠ श׳͕਎ʹͭ͘ Infra Study Meetup #1ʮInfrastructure as Codeʯ 42
  43. IaCͷݪଇʢ࠶ܝʣ • ؆୯ʹ࠶ݱͰ͖ΔγεςϜ • ࢖͍ࣺͯʹͰ͖ΔγεςϜ • ౷ҰతͳγεςϜ • ൓෮Մೳͳϓϩηε •

    ઈ͑ͣมԽ͢ΔσβΠϯ Infra Study Meetup #1ʮInfrastructure as Codeʯ 43
  44. 2nd EditionͰͷݪଇ • Assume systems are unreliable • Make everything

    reproducible • Create disposable things • Minimize variation • Ensure that you can repeat any process Infra Study Meetup #1ʮInfrastructure as Codeʯ 44
  45. IaCͷϓϥΫςΟε • ఆٛϑΝΠϧ • ࣗݾهड़γεςϜͱϓϩηε • όʔδϣϯ؅ཧ • ܧଓతςετ •

    খࠁΈͳมߋ • ʢܧଓతʹαʔϏεΛར༻Մೳঢ়ଶʹอͭʣ Infra Study Meetup #1ʮInfrastructure as Codeʯ 45
  46. ఆٛϑΝΠϧ • جૅதͷجૅ • PuppetͷϚχϑΣετ΍ChefͷϨγϐ • TerrformͷHCL΍KubernetesͷYAMLϑΝΠϧ • Πϯϑϥཁૉͱͦͷߏ੒/ઃఆํ๏Λࢦఆ͢Δ •

    ςΩετϑΝΠϧͰ؅ཧ Infra Study Meetup #1ʮInfrastructure as Codeʯ 46
  47. ࣗݾهड़γεςϜͱϓϩηε • υΩϡϝϯτΛͳΔ΂͘ॻ͔ͳ͍ • ϓϩηεΛ࣮ࢪ͢ΔͨΊͷखॱ͸ɺ࣮ࡍʹϓϩηεΛ࣮૷͠ ͍ͯΔεΫϦϓτɺఆٛϑΝΠϧɺπʔϧʹॻ͖ࠐ·Ε͍ͯΔ • ͍Θ͹ʮ࣮ߦͰ͖ΔυΩϡϝϯτʯ • ͦΕҎ֎ʹ͸ɺॳΊͯ࢖͏ਓͷͨΊͷ࠷খݶͷυΩϡϝϯτ

    ʹཹΊΔ Infra Study Meetup #1ʮInfrastructure as Codeʯ 47
  48. όʔδϣϯ؅ཧ • ͋ΒΏΔ΋ͷΛόʔδϣϯ؅ཧ͢Δͷ͕๬·͍͠ • τϨʔαϏϦςΟ • ϩʔϧόοΫ • ૬ؔؔ܎ͷ؅ཧ •

    Մࢹੑ • ΞΫγϣφϏϦςΟ Infra Study Meetup #1ʮInfrastructure as Codeʯ 48
  49. ܧଓతςετ • Πϯϑϥίʔυʹมߋ͕͋Δ౓ʹςετΛ࣮ߦ • ςελϏϦςΟΛߴΊΔͱૄ݁߹ͰΫϦʔϯͰ୯७ͳઃܭ͕ ଅ͞ΕΔ • มߋʹର͢ΔϑΟʔυόοΫ͕ૣ͘ɺͻΜͺΜʹมߋΛՃ͑ ͯ΋େৎ෉ͩͱ͍͏ࣗ৴͕ੜ·ΕΔ Infra

    Study Meetup #1ʮInfrastructure as Codeʯ 49
  50. খࠁΈͳมߋ • খ͞ͳมߋΛςετ࣮ͯ֬͠ʹಈ࡞͢ΔΑ͏ʹ͢Δํ͕؆୯ Ͱ࡞ۀྔ͕গͳ͍ • มߋʹΑΓൃੜͨ͠໰୊ͷݪҼ͕ಛఆ͠΍͍͢ • ϩʔϧόοΫ΋͠΍͍͢ • ͻΜͺΜʹมߋͯ͠ϦϦʔε͢Δํ͕Ϟνϕʔγϣϯ্͕Δ

    Infra Study Meetup #1ʮInfrastructure as Codeʯ 50
  51. IaCͷϓϥΫςΟεʢ࠶ܝʣ • ఆٛϑΝΠϧ • ࣗݾهड़γεςϜͱϓϩηε • όʔδϣϯ؅ཧ • ܧଓతςετ •

    খࠁΈͳมߋ • ʢܧଓతʹαʔϏεΛར༻Մೳঢ়ଶʹอͭʣ Infra Study Meetup #1ʮInfrastructure as Codeʯ 51
  52. 2nd EditionͰͷϓϥΫςΟε • Define everything as code • Continuously validate

    all your work in progress • Build small, simple pieces that you can change independently Infra Study Meetup #1ʮInfrastructure as Codeʯ 52
  53. ΞϯνϑϥδϟΠϧ • IaC͸ݎ࿚Λ௒͑ͯΞϯνϑϥδϟΠϧͳΠϯϑϥΛ໨ࢦ͢ • ਓؒ͸τϨʔχϯά͠ͳ͍ͱମ͕ऑ͘ͳΓյΕ΍͘͢ͳΔ • γεςϜ΋ಉ༷ɺมߋΛ࠷খݶʹ཈͑Δͱݎ࿚ʹͳΒͳ͍ • γεςϜΛઈ͑ͣมߋ͠վྑ͢Δ͜ͱͰΑΓݎ࿚ʹͳΔ Infra

    Study Meetup #1ʮInfrastructure as Codeʯ 53
  54. ਓؒத৺ઃܭ • ࣗಈԽ͚ͩͰ͸ΞϯνϑϥδϟΠϧʹͰ͖ͳ͍ • γεςϜΛΑ͘ཧղ͠ɺܧଓతʹมߋΛՃ͑ΒΕΔਓͷଘࡏ ͕ॏཁ • มԽʹରԠͰ͖ΔγεςϜΛઃܭ͢ΔͨΊͷൿ݃͸ɺਓΛத ৺ʹͯ͠ઃܭ͢Δ͜ͱ Infra

    Study Meetup #1ʮInfrastructure as Codeʯ 54
  55. ิ଍: ͦͷଞͷ1stͱ2ndͷେ͖ͳҧ͍ • 1stͰ͸IaCʹؔ͢ΔπʔϧΛҎԼͷ4ͭʹ෼ྨͯ͠ղઆ͍ͯ͠Δ • Dynamic Infrastructure Platforms • Infrastructure

    Definition Tools • Server Configuration Tools • Infrastructure Services • 2ndͰ͸͜ͷπʔϧ෼ྨ͕ͳ͘ͳΓɺϓϥοτϑΥʔϜΛϨΠϠʔʹΘ͚ͯղઆ͍ͯ͠Δ • Infrastructure Platform • Application Runtime Platform • Applications Infra Study Meetup #1ʮInfrastructure as Codeʯ 55
  56. ݱ୅ͷIaC·ͱΊ • ͔ͭͯ͸ITΠϯϑϥ͕มԽͷ੍໿ʹͳ͍ͬͯͨ • μΠφϛοΫΠϯϑϥετϥΫνϟͷൃలɾීٴʹΑΓΠϯϑϥ ͕มԽͷ੍໿Ͱ͸ͳ͘ͳͬͨ • ੍໿Λલఏͱͨ͠ैདྷతͳΞϓϩʔν͸௨༻͠ͳ͘ͳͬͨ • μΠφϛοΫΠϯϑϥετϥΫνϟ࣌୅ʹରԠ͠ɺมԽʹڧ͍Ξ

    ϯνϑϥδϟΠϧͳΠϯϑϥΛͭ͘ΔͨΊͷΞϓϩʔν͕IaCͰ ͋Δ Infra Study Meetup #1ʮInfrastructure as Codeʯ 56
  57. IaCͷ͜Ε͔Β Infra Study Meetup #1ʮInfrastructure as Codeʯ 57

  58. ݴ༿ͷ໾ׂ͸ऴΘΓͭͭ͋Δ • IaC͸౰ͨΓલͷ΋ͷʹͳ͖ͬͯͨ • Ή͠ΖIaCͳ͠ͰͲ͏΍Δͷɺͱͳ͍͖ͬͯͦ͏ • IaCͱ͍͏ݴ༿Λ͜ͱ͞Β࢖͏ඞཁ͸ͳ͘ͳΓͦ͏ • ݴ༿ͷ໾ׂ͸ऴΘͬͯ΋IaCʹΑͬͯੜΈग़͞Εͨݪଇ΍ϓ ϥΫςΟε͸ੜ͖ଓ͚Δ

    Infra Study Meetup #1ʮInfrastructure as Codeʯ 58
  59. IaC is dead. Long live IaC! Infra Study Meetup #1ʮInfrastructure

    as Codeʯ 59