Slide 1

Slide 1 text

Infrastructure as Code ͷ͜Ε·Ͱͱ͜Ε͔Β Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 1

Slide 2

Slide 2 text

ࣗݾ঺հ • ٶԼ ߶ี (mizzy@github, gosukenator@twitter) • ߹ಉձࣾServerspec Operations୅ද • גࣜձࣾϦΫϧʔτςΫϊϩδʔζATLٕज़ސ໰ • ઍגࣜձٕࣾज़ސ໰ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 2

Slide 3

Slide 3 text

ࠓ೔͓࿩͢͠Δ͜ͱ • Infrastructure as Code ͱͦͷྺ࢙ • Infrastructure as Code ͷݱঢ় • Infrastructure as Code ͷ͜Ε͔Β Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 3

Slide 4

Slide 4 text

Infrastructure as Code ͱͦͷྺ࢙ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 4

Slide 5

Slide 5 text

Infrastructure as Codeͱ͸ʁ • ΠϯϑϥΛίʔυͰهड़͢Δ͜ͱ • ͦΕʹΑΓιϑτ΢ΣΞ։ൃͰطʹ༗ޮͰ͋Δͱཱূ͞Εͯ ͍ΔϓϥΫςΟεΛΠϯϑϥʹ΋ಉ͡Α͏ʹద༻Ͱ͖ɺͦͷ Ըܙ͕ड͚ΒΕΔ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 5

Slide 6

Slide 6 text

Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 6

Slide 7

Slide 7 text

Infrastructure as Codeͷࡾຊப • ࣗಈԽ • όʔδϣϯ؅ཧ • ςετ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 7

Slide 8

Slide 8 text

Infrastructure as Codeͷ஀ੜ • େݩ͸1993೥ͷCFEngine • 2005೥ͷPuppetొ৔͕௚઀తͳ͖͔͚ͬ • Infrastructure as Codeͱ͍͏ݴ༿͕ग़͖ͯͨͷ͸2008ࠒ • ChefͷϦϦʔε͸2009೥ • ౰࣌͸ࣗಈԽ͕ओ؟ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 8

Slide 9

Slide 9 text

Infrastructure as Codeͷมભ • ʮίʔυԽͯࣗ͠ಈԽʯ͔Βʮιϑτ΢ΣΞ։ൃͷϓϥΫς ΟεΛద༻ʯʹͳΔஹީ͸2008೥͙Β͍͔Β͋ͬͨ • Agile Infrastructure/Agile Operations • DevOpsͷొ৔͸2009೥ࠒ • 2011೥ग़൛ͷTest-Driven Infrastructure with Chef • 2013೥ϦϦʔεͷServerspec Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 9

Slide 10

Slide 10 text

࠷ۙͷ Infrastructure as Code ࣄ৘ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 10

Slide 11

Slide 11 text

Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 11

Slide 12

Slide 12 text

Infrastructure as Code ʹؔ͢Δ πʔϧ΍αʔϏεͷ෼ྨ • Dynamic Infrastructure Platforms • Infrastructure Definition Tools • Server Configuration Tools • Infrastructure Services Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 12

Slide 13

Slide 13 text

Dynamic Infrastructure Platforms • αʔόɺετϨʔδɺωοτϫʔΫͱ͍ͬͨίϯϐϡʔλϦ ιʔεΛϓϩάϥϚϒϧʹఏڙ͢Δ΋ͷ • EC2ͷΑ͏ͳIaaS΍OpenStackͷΑ͏ͳIaaSΛߏ੒͢ΔͨΊ ͷπʔϧ • Cobbler ΍ Foreman ͷΑ͏ͳ෺ཧϚγϯΛϓϩϏδϣχϯ ά͢Δπʔϧ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 13

Slide 14

Slide 14 text

Infrastructure Definition Tools • Infrastructure as Codeతͳख๏ͰDynamic Infrastructure Platforms্ͷϦιʔεΛ੍ޚ • Terraform, CloudFormation, OpenStack Heat • Configuration Registries • Consul, etcd, ZooKeeper Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 14

Slide 15

Slide 15 text

Server Configuration Tools • ͍ΘΏΔ Configuration Management Tools • Puppet, Chef, Ansible, Itamae Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 15

Slide 16

Slide 16 text

Infrastructure Services • ͍ΘΏΔ Orchestration ෦෼ • ϞχλϦϯάʢΞϥʔτɺϝτϦΫεɺϩΪϯάʣ • αʔϏεσΟεΧόϦ • ෼ࢄϓϩηε؅ཧ • ιϑτ΢ΣΞσϓϩΠ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 16

Slide 17

Slide 17 text

෼ྨΠϝʔδ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 17

Slide 18

Slide 18 text

Infrastrtucture as Code͕ର৅ͱ͢ΔྖҬ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 18

Slide 19

Slide 19 text

ྖҬͷมભ • ݩʑ͸ Server Configuration ͕ର৅ྖҬͩͬͨ • Infrastructure Definition ʹ΋޿͕ͬͨ • ʮΠϯϑϥΛίʔυԽʯ͚ͩͰͳ͘ʮΠϯϑϥΛίʔυͰૢ࡞ʯ • CloudFormation, Terraform ͳΜ͔͕ग़͖ͯͨӨڹ • पลπʔϧ΁ͷ֦େ • Test Kitchen, Serverspec, Jenkins, CircleCI Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 19

Slide 20

Slide 20 text

Infrastructure as Code ͷ͜Ε͔Β Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 20

Slide 21

Slide 21 text

Infrastructure as Code ʹӨڹΛ༩͑Δཁૉ • Dynamic Infrastructure Platforms • Container • Microservices Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 21

Slide 22

Slide 22 text

Dynamic Infrastructure ʹΑΔӨڹ • AmazonҎ֎ʹ΋ Google ΍ Microsoft ͳͲͷϏοάϓϨΠϠ ʔ͕ग़ݱ • ϚϧνΫϥ΢υରԠ/ϕϯμʔϩοΫΠϯճආ • ෳ਺ͷ Dynamic Infrastructure Platforms ΛଋͶΔଘࡏͱͯ͠ ͷ Infrastructure Definition Tools ΍ Infrastructure Services ͕ ॏཁʹ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 22

Slide 23

Slide 23 text

Container ʹΑΔӨڹ • ϙʔλϏϦςΟͷߴ͞ʹΑΓϓϥοτϗʔϜબ୒ͷ෯͕޿͕Δ • Ұ୆ͷ෺ཧ͋Δ͍͸Ծ૝ϚγϯͰ΍͍ͬͯͨ͜ͱ͕ϗετϚγϯͱίϯ ςφʹ෼཭ • Separation of Concern ʹΑΔϓϩϏδϣχϯάͷ୯७Խ • Server Configuration Tools ͷॏཁੑ௿Լ • Serverspec Έ͍ͨͳπʔϧͰςετ͢Ε͹ྑ͍ • αʔό؅ཧͱ͍͏ΑΓϓϩηε؅ཧ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 23

Slide 24

Slide 24 text

Microservices ʹΑΔӨڹ • ίϯϙʔωϯτ͸୯ػೳԽ/γεςϜ͸ෳࡶԽ • ςετ΍ϞχλϦϯά͕ॏཁʹ • Infrastructure Services ͷॏཁੑ૿େ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 24

Slide 25

Slide 25 text

3ཁૉͷΑΔӨڹͷ·ͱΊ • ϚϧνΫϥ΢υΛଋͶΔɺ͋Δ͍͸ҠߦΛ༰қʹ͢ΔͨΊͷ Infrastructure Definition Tools ͱ Infrastructure Services ͷॏ ཁੑ૿େ • ૬ରతʹ Server Configuration Tools ͷॏཁੑ௿Լ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 25

Slide 26

Slide 26 text

Infrastructure Services ͱ Infrastructure as Code • Infrastructure Services ͸·ͩ Infrastructure as Code ͷԸܙ͕ෆे෼ • Server Configuration Tools ͸੩తͳঢ়ଶΛίʔυͰهड़ • Infrastructure Services Ͱ͸ಈతͳৼ෣͍Λهड़ • ֎ଆ͔Βίϯτϩʔϧ͢Δ͚ͩͰ͸ͳࣗ͘཯੍ޚ΋ॏཁʹ • ྫ: ngx_lua ΍ ngx_mruby ʹΑΔʮઃఆͷίʔυԽʯ • ಈతฏߧ/ϗϝΦελγε Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 26

Slide 27

Slide 27 text

Infrastructure Services ͱ Infrastructure as Code • ιϑτ΢ΣΞ։ൃʹߋʹ͖ۙͮΑΓෳࡶԽ͢Δ • ࠓ·ͰΠϯϑϥͱ͸͋·Γԑ͕ͳ͔ͬͨख๏ͷԠ༻ • ྫ: ܗࣜख๏ʹΑΔઃܭ • ྫ: Consumer-Driven Contract Testing • ιϑτ΢ΣΞ։ൃͱͷڥք͕ΑΓᐆດʹ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 27

Slide 28

Slide 28 text

Infrastructure as Code ͷ͜Ε͔Β • ର৅ྖҬ͕޿͕ΓɺΑΓෳࡶԽ͢Δ • ͱ͸͍͑ɺجຊݪଇ͸ಉ͡ • ࣗಈԽ • όʔδϣϯ؅ཧ • ςετ • ͜ΕΛͰ͖ΔݶΓγϯϓϧʹ࣮ݱ͢Δ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 28

Slide 29

Slide 29 text

Infrastructure as Code ͷ͜Ε͔Β • ֶज़తΞϓϩʔν΋ॏཁ • ྫ: ܗࣜख๏ɺάϥϑཧ࿦ɺσΟʔϓϥʔχϯά • ςετ෼໺͸·ͩະ੒ख़ • ະ੒ख़͔ͩΒͦ͜վળͷ༨஍͕େ͍ʹ͋Δ • ϞχλϦϯάͱͷ༥߹ • ςετʹຊ൪σϓϩΠલɺϞχλϦϯάʹຊ൪σϓϩΠޙ • ࣗ཯੍ޚ/ಈతฏߧ Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 29

Slide 30

Slide 30 text

͓·͚ • ʮͷ΅Γʔ͞ΜͷΫϥ΢υΠϯϑϥPodcastʯͰ͜ͷΠϕϯ τͷޙ೔ஊతͳ࿩Λ͠·͢ • https://cloudinfra.audio/ • #nobolycloud Recruit Technologies Open Lab #03: Infrastructure as Code 2016/07/07 30