Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RancherOS - for containers, by containers

RancherOS - for containers, by containers

Rancher Meetup Fukuoka(福岡) #1 での発表資料。
RancherOSの概要、利用方法、内部動作(主に起動関連)、最近の開発状況について扱っています。

0ab9bea7e3b879fcf24d5f4c65c1ce9b?s=128

Kazumichi Yamamoto

August 07, 2017
Tweet

More Decks by Kazumichi Yamamoto

Other Decks in Technology

Transcript

  1.  3BODIFS.FFUVQ'6,60," !ZBNBNPUP@GFCD GPSDPOUBJOFST CZDPOUBJOFST

  2. ࢁຊ ࿨ಓ !ZBNBNPUP@GFCD üେ෼ݝࡏॅɺϐΞϊ ҆৺ӃϫΠϯ -PWFS ü͘͞ΒͷΫϥ΢υؔ࿈ͷΦʔϓϯιʔε։ൃ 8IP

  3. 1SPEVDUTGPS͘͞ΒͷΫϥ΢υ ͘͞ΒͷΫϥ΢υ ެೝ$-*ʮVTBDMPVEʯ 5FSSBGPSNGPS ͘͞ΒͷΫϥ΢υ 1BDLFSGPS ͘͞ΒͷΫϥ΢υ %PDLFS.BDIJOF *OGSB,JU 8PSE1SFTT

     ΦϒδΣΫτετϨʔδ 8PSE1SFTT  ΢ΣϒΞΫηϥϨʔλ .BDLFSF౷߹πʔϧ ʮ4BDLFSFMʯ LVCFTBDMPVE $PNJOH4PPO
  4. ࡢ೔  ɺ3BODIFS04ͷ ίϯτϦϏϡʔλʹͳΓ·ͨ͠ʂʂ

  5. 3BODIFS

  6. None
  7. ։ൃݩ

  8. ίϯςφ؅ཧϓϥοτϑΥʔϜ

  9. ίϯςφ޲͚ܰྔ04

  10. ෼ࢄϒϩοΫετϨʔδ

  11. 0WFSWJFX

  12. Α͋͘Δצҧ͍ 3BODIFS04  3BODIFSΛಈ͔ͨ͢Ίͷ04

  13. Α͋͘Δצҧ͍ 3BODIFS04  3BODIFSΛಈ͔ͨ͢Ίͷ04

  14. 0WFSWJFX ü ίϯςφʹΑΔ ü ίϯςφͷͨΊͷ ü γϯϓϧܰྔͳ04

  15. • %PDLFSʹಛԽ͍ͯ͠Δ • αΠζ͕খ͘͞ىಈ͕ૣ͍ • 4ZTUFN6TFSͷͭͷ%PDLFSΠϯελϯε • JOJUγεςϜʹ΋%PDLFSΛར༻ 0WFSWJFX

  16. ෼ྨɿίϯςφϗετ޲͚04

  17. %PDLFSʹಛԽͨ͠04

  18. αΠζ͕খ͍͞  .# ˞ W࣌఺ͰͷWNMJOV[ JOJUSEͷαΠζ

  19. -JOVY,FSOFM 4ZTUFN%PDLFS OUQ OFUXPSL VEFW BDQJE TZTMPH DPOTPMF EPDLFS VTFSEPDLFS

    ͢΂͕ͯ%PDLFS
  20. 4ZTUFNͱ6TFSɺͭͷ%PDLFS

  21. 1*% 1*% JOJUγεςϜ΋%PDLFS

  22. • %PDLFSʹಛԽ͍ͯ͠Δ • αΠζ͕খ͘͞ىಈ͕ૣ͍ • 4ZTUFN6TFSͷͭͷ%PDLFSΠϯελϯε • JOJUγεςϜʹ΋%PDLFSΛར༻ 0WFSWJFX

  23. 0WFSWJFX ü ίϯςφʹΑΔ ü ίϯςφͷͨΊͷ ü γϯϓϧܰྔͳ04

  24. GPSDPOUBJOFST CZDPOUBJOFST

  25. *OTUBMMBUJPO

  26. • *40Πϝʔδ $%30. ͔Βىಈ • σΟεΫʹΠϯετʔϧͯ͠ىಈ • ֤छΫϥ΢υϓϩόΠμ͕ఏڙ͢ΔΠϝʔδΛར༻ ࣮ߦΠϯετʔϧํ๏ ˞0QFO4UBDL΍19&ʹ΋ରԠ͍ͯ͠·͢

  27. ϓϩϏδϣχϯά DMPVEDPOGJHZNM Χʔωϧύϥϝʔλ ϝλσʔλαʔϏε $POGJH %SJWF config-2

  28. "ENJOJTUSBUJPO

  29. ؅ཧίϚϯυ SPT $ sudo ros [global options] command [command options]

    [arguments...] ίϚϯυ આ໌ DPOGJH ઃఆͷมߋ DPOTPMF ίϯιʔϧͷ੾Γସ͑ FOHJOF 6TFS%PDLFSͷόʔδϣϯ੾Γସ͑ TFSWJDF αʔϏε ίϯςφ ͷ؅ཧ PT 3BODIFS04ࣗମͷόʔδϣϯΞοϓ JOTUBMM 3BODIFS04ΛσΟεΫ΁ͷΠϯετʔϧ SPTίϚϯυͷओͳػೳ ίϚϯυ
  30. SPT DPOGJHίϚϯυ $ sudo ros config command [arguments...] ίϚϯυ આ໌

    HFU ࢦఆΩʔͷݱࡏͷઃఆ஋Λऔಘ TFU ࢦఆΩʔͷ஋Λઃఆ FYQPSU ݱࡏͷઃఆΛZBNMܗࣜͰදࣔ WBMJEBUF ࢦఆͷϑΝΠϧͷݕূ SPT DPOGJHίϚϯυ ઃఆؔ࿈ͷૢ࡞
  31. SPT DPOTPMFίϚϯυ $ sudo ros console command [arguments...] ίϚϯυ આ໌

    TXJUDI ίϯιʔϧͷ੾Γସ͑ ଈ੾ସ FOBCMF ίϯιʔϧͷ੾Γସ͑ ࣍ճ࠶ىಈ࣌ʹ੾ସ MJTU ར༻ՄೳͳίϯιʔϧͷҰཡදࣔ SPT DPOTPMFίϚϯυ ίϯιʔϧؔ࿈ͷૢ࡞ • EFGBVMU • BMQJOF • DFOUPT • EFCJBO • GFEPSB • VCVOUV ˞W࣌఺
  32. 3BODIFS04ͰͷDPOTPMF -JOVY,FSOFM 4ZTUFN%PDLFS OUQ OFUXPSL VEFW BDQJE TZTMPH DPOTPMF EPDLFS

    • 3BODIFS04ʹ͓͚ΔγΣϧɺHFUUZ΍TTIEΛఏڙ • σϑΥϧτ͸#VTZ#PYϕʔε • ίϯςφ͔ͩΒ੾ସ͸ΠϝʔδΛࠩ͠ସ͑Δ͚ͩ
  33. SPT FOHJOFίϚϯυ $ sudo ros engine command [arguments...] ίϚϯυ આ໌

    TXJUDI %PDLFSͷ੾Γସ͑ ଈ੾ସ FOBCMF %PDLFSͷ੾Γସ͑ ࣍ճ࠶ىಈ࣌ʹ੾ସ MJTU ར༻Մೳͳ%PDLFSΤϯδϯͷҰཡදࣔ SPT FOHJOFίϚϯυ FOHJOF %PDLFS ؔ࿈ͷૢ࡞
  34. 3BODIFS04ͰͷFOHJOF EPDLFS -JOVY,FSOFM 4ZTUFN%PDLFS OUQ OFUXPSL VEFW BDQJE TZTMPH DPOTPMF

    EPDLFS • VTFSEPDLFS͸TZTUFNEPDLFS্ͷίϯςφ • ίϯςφ͔ͩΒ ҎԼུ
  35. %&.0

  36. 6TBHF

  37. TFSWJDFͱ͸ 㲈 service • EPDLFSDPNQPTFܗࣜͰఆٛ͞Εͨίϯςφ ৗறΞϓϦ 8FCαʔόͳͲ ϘϦϡʔϜͷఏڙ ίϚϯυͷఏڙ command

    TFSWJDFͷ໾ׂ
  38. TFSWJDFͱ͸ -JOVY,FSOFM 4ZTUFN%PDLFS OUQ OFUXPSL VEFW BDQJE TZTMPH DPOTPMF EPDLFS

    • ओཁͳσʔϞϯྨ͸TFSWJDFͱͯ͠ఏڙ͞Ε͍ͯΔ • VTFSEPDLFS্ͰՔಇ͢ΔTFSWJDF΋͋Δ SBODIFSTFSWFSαʔϏεͳͲ
  39. SPT TFSWJDFίϚϯυ $ sudo ros service command [arguments...] SPT TFSWJDFίϚϯυ

    αʔϏεؔ࿈ͷૢ࡞ ίϚϯυ આ໌ MJTU αʔϏε ఆٛ ͷҰཡදࣔ FOBCMFEJTBCMFEFMFUF αʔϏε ఆٛ ͷ༗ޮແޮԽ࡟আ QVMMCVJME αʔϏεͰར༻͢ΔΠϝʔδͷऔಘϏϧυ VQTUBSUSFTUBSUTUPQ αʔϏεͷىಈఀࢭ QT ىಈ͍ͯ͠ΔαʔϏε ίϯςφ ͷҰཡදࣔ MPHT αʔϏεͷϩάදࣔ ˞Ұ෦ͷίϚϯυͷΈൈਮ
  40. αʔϏεͷఆٛ $ sudo ros service enable [docker-compose.yaml] # ϑΝΠϧύεΛࢦఆ $

    sudo ros service enable /var/lib/rancher/conf/example.yml # 63-Λࢦఆ $ sudo ros service enable https://example.com/example.yml ࣮ߦྫ ˞SPTίϚϯυͷ୅ΘΓʹDMPVEDPOGJHZNMΛ༻͍ͯఆٛ͢Δ͜ͱ΋Մೳ
  41. αʔϏεͷར༻ $ sudo ros service up <service name>... αʔϏεͷىಈ $

    sudo ros service logs <service name>... αʔϏεͷϩάදࣔ $ sudo ros service ps ىಈ͍ͯ͠ΔαʔϏεͷҰཡ
  42. %&.0

  43. ಠࣗϦϙδτϦ͔ΒͷαʔϏε௥Ճ 8FC্ͷϦϙδτϦ͔ΒαʔϏεఆٛΛऔಘ͢Δ͜ͱ͕Մೳ ྫɿ 3BODIFS04૊ࠐαʔϏεɿ https://github.com/rancher/os-services ಠࣗϦϙδτϦͷαϯϓϧɿ https://roastlink.github.io

  44. ࢀߟಠࣗϦϙδτϦ͔ΒͷαʔϏε௥Ճ [repo root] ├── index.yml ├── n │ └── nginx.yml

    ├── o │ └── open-vm-tools.yml └── r └── rancher-server.yml ϦϙδτϦͷϑΝΠϧߏ੒ ΠϯσοΫεϑΝΠϧ services: - nginx - open-vm-tools - rancher-server
  45. ࢀߟಠࣗϦϙδτϦ͔ΒͷαʔϏε௥Ճ 8FCϦϙδτϦΛ࢖͏ͨΊͷઃఆ SPTίϚϯυͷ৔߹ $ sudo ros config set rancher.repositories.<name>.url <repo-url>

    DMPVEDPOGJHZNMͰઃఆ͢Δ৔߹ #cloud-config.yml rancher: repositories: <name>: url: <repo-url>
  46. "EWBODFEUPQJD

  47. ىಈͷ࢓૊Έ 2 TZTUFNEPDLFS 1*% ͬͯ Ͳ͏΍ͬͯىಈͯ͠Δͷʁ

  48. ىಈͷ࢓૊Έ " HPͰॻ͔ΕͨಠࣗͷJOJUͰॲཧ

  49. ىಈͷྲྀΕ #*046&'* .#3 ϒʔτϩʔμ TZTMJOVY WNMJOV[ JOJUSE JOJU WNMJOV[ JOJUSE

    ࣮ମ͸SPTόΠφϦ HP੡ͷಠࣗόΠφϦ VTSCJOSPTTZTJOJU FYFD TZTUFNEPDLFS 1*% %JTL 3". 3".%JTL γεςϜίϯςφىಈ ࣮ମ͸SPTόΠφϦ NPVOU DISPPU TUBSU ଈϦλʔϯ TUBUF 3BODIFS04ಠࣗͷ΋ͷ ˞ओͳॲཧͷΈൈਮ
  50. ىಈͷྲྀΕ #*046&'* .#3 ϒʔτϩʔμ TZTMJOVY WNMJOV[ JOJUSE JOJU WNMJOV[ JOJUSE

    VTSCJOSPTTZTJOJU FYFD TZTUFNEPDLFS %JTL 3". 3".%JTL NPVOU DISPPU TUBSU ଈϦλʔϯ TUBUF ˞ओͳॲཧͷΈൈਮ
  51. ىಈͷྲྀΕ #*046&'* .#3 ϒʔτϩʔμ TZTMJOVY WNMJOV[ JOJUSE JOJU WNMJOV[ JOJUSE

    VTSCJOSPTTZTJOJU FYFD TZTUFNEPDLFS %JTL 3". 3".%JTL NPVOU DISPPU TUBSU ଈϦλʔϯ TUBUF ిݯ౤ೖʙϒʔτϩʔμ ˞σϑΥϧτ͸TZTMJOVYɺ17(36#΋બ΂Δ ˞ओͳॲཧͷΈൈਮ
  52. ϒʔτϩʔμ CPPU ˞ಡΈ΍͘͢͢ΔͨΊ*/$-6%&Λల։͍ͯ͠·͢

  53. ىಈͷྲྀΕ #*046&'* .#3 ϒʔτϩʔμ TZTMJOVY WNMJOV[ JOJUSE JOJU WNMJOV[ JOJUSE

    VTSCJOSPTTZTJOJU FYFD TZTUFNEPDLFS %JTL 3". 3".%JTL NPVOU DISPPU TUBSU ଈϦλʔϯ TUBUF -;." DQJP JOJUSBNGT ˞ओͳॲཧͷΈൈਮ
  54. ىಈͷྲྀΕ #*046&'* .#3 ϒʔτϩʔμ TZTMJOVY WNMJOV[ JOJUSE JOJU WNMJOV[ JOJUSE

    VTSCJOSPTTZTJOJU FYFD TZTUFNEPDLFS %JTL 3". 3".%JTL NPVOU DISPPU TUBSU ଈϦλʔϯ TUBUF ΧʔωϧΠϝʔδJOJUSEల։ɺJOJU࣮ߦ -;." DQJP JOJUSBNGT ˞ओͳॲཧͷΈൈਮ
  55. JOJUSEͷ಺༰ SPT  • SPTίϚϯυ͸HPͰॻ͔Εͨ3BODIFS04ͷίΞ • ࣮ߦϑΝΠϧ໊ BSHW<> Ͱಈ࡞Λ੾ସ •

    JOJU΍VTSCJOTZTUFNEPDLFSͷ࣮ମ΋SPTίϚϯυ
  56. ىಈͷྲྀΕ #*046&'* .#3 ϒʔτϩʔμ TZTMJOVY WNMJOV[ JOJUSE JOJU WNMJOV[ JOJUSE

    VTSCJOSPTTZTJOJU FYFD TZTUFNEPDLFS %JTL 3". 3".%JTL NPVOU DISPPU TUBSU ଈϦλʔϯ TUBUF ˞ओͳॲཧͷΈൈਮ
  57. ىಈͷྲྀΕ #*046&'* .#3 ϒʔτϩʔμ TZTMJOVY WNMJOV[ JOJUSE JOJU WNMJOV[ JOJUSE

    VTSCJOSPTTZTJOJU FYFD TZTUFNEPDLFS %JTL 3". 3".%JTL NPVOU DISPPU TUBSU ଈϦλʔϯ TUBUF Ϛ΢ϯτ EFWUNQGT΍QSPDɺTZT ΧʔωϧϞδϡʔϧϩʔυͳͲ ˞ओͳॲཧͷΈൈਮ
  58. ىಈͷྲྀΕ #*046&'* .#3 ϒʔτϩʔμ TZTMJOVY WNMJOV[ JOJUSE JOJU WNMJOV[ JOJUSE

    VTSCJOSPTTZTJOJU FYFD TZTUFNEPDLFS %JTL 3". 3".%JTL NPVOU DISPPU TUBSU ଈϦλʔϯ TUBUF ˞ओͳॲཧͷΈൈਮ
  59. ىಈͷྲྀΕ #*046&'* .#3 ϒʔτϩʔμ TZTMJOVY WNMJOV[ JOJUSE JOJU WNMJOV[ JOJUSE

    VTSCJOSPTTZTJOJU FYFD TZTUFNEPDLFS %JTL 3". 3".%JTL NPVOU DISPPU TUBSU ଈϦλʔϯ TUBUF TUBUFʹσΟεΫΛϚ΢ϯτ DISPPU ˞Χʔωϧύϥϝʔλ SBODIFSTUBUFEFW͕༩͑ΒΕ͍ͯͨ৔߹ ˞ओͳॲཧͷΈൈਮ
  60. ىಈͷྲྀΕ #*046&'* .#3 ϒʔτϩʔμ TZTMJOVY WNMJOV[ JOJUSE JOJU WNMJOV[ JOJUSE

    VTSCJOSPTTZTJOJU FYFD TZTUFNEPDLFS %JTL 3". 3".%JTL NPVOU DISPPU TUBSU ଈϦλʔϯ TUBUF ˞ओͳॲཧͷΈൈਮ
  61. ىಈͷྲྀΕ #*046&'* .#3 ϒʔτϩʔμ TZTMJOVY WNMJOV[ JOJUSE JOJU WNMJOV[ JOJUSE

    VTSCJOSPTTZTJOJU FYFD TZTUFNEPDLFS %JTL 3". 3".%JTL NPVOU DISPPU TUBSU ଈϦλʔϯ TUBUF γεςϜίϯςφͷىಈ ࣮ମ͸SPTίϚϯυ ˞ओͳॲཧͷΈൈਮ
  62. ىಈͷྲྀΕ #*046&'* .#3 ϒʔτϩʔμ TZTMJOVY WNMJOV[ JOJUSE JOJU WNMJOV[ JOJUSE

    VTSCJOSPTTZTJOJU FYFD TZTUFNEPDLFS %JTL 3". 3".%JTL NPVOU DISPPU TUBSU ଈϦλʔϯ TUBUF ˞ओͳॲཧͷΈൈਮ
  63. ىಈͷྲྀΕ #*046&'* .#3 ϒʔτϩʔμ TZTMJOVY WNMJOV[ JOJUSE JOJU WNMJOV[ JOJUSE

    VTSCJOSPTTZTJOJU FYFD TZTUFNEPDLFS %JTL 3". 3".%JTL NPVOU DISPPU TUBSU ଈϦλʔϯ TUBUF TZTUFNEPDLFSΛFYFD 1*% 1*% ˞ओͳॲཧͷΈൈਮ
  64. ىಈͷྲྀΕ #*046&'* .#3 ϒʔτϩʔμ TZTMJOVY WNMJOV[ JOJUSE JOJU WNMJOV[ JOJUSE

    ࣮ମ͸SPTόΠφϦ HP੡ͷಠࣗόΠφϦ VTSCJOSPTTZTJOJU FYFD TZTUFNEPDLFS 1*% %JTL 3". 3".%JTL γεςϜίϯςφىಈ ࣮ମ͸SPTόΠφϦ NPVOU DISPPU TUBSU ଈϦλʔϯ TUBUF 3BODIFS04ಠࣗͷ΋ͷ ˞ओͳॲཧͷΈൈਮ
  65. ىಈͷ࢓૊ΈͷϙΠϯτ • SPTίϚϯυΛJOJUͱ࣮ͯ͠ߦ • JOJUͷ࠷ޙͰTZTUFNEPDLFSΛFYFD SPT  ͷίΞ

  66. ࠷ۙͷঢ়گ

  67. W΁޲͚ͯ 8JUIXFXJMMTIJGUUIFGPDVTGSPN %PDLFSUPDPOUBJOFSE 0$* BOE-JOVY,JU Ҿ༻ݩIUUQTOFXTZDPNCJOBUPSDPNJUFN JE

  68. W΁޲͚ͯ &YQFSJNFOUBM

  69. W΁޲͚ͯ ΄΅ຖ೔ίϛοτɺ ׆ൃʹ։ൃத

  70. &OKPZ IUUQTHJUIVCDPNSBODIFSPT GPSDPOUBJOFST CZDPOUBJOFST