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

OpenFaaSとは

kenev
October 18, 2017

 OpenFaaSとは

Serverless FrameworkなOpenFaaS
その概要について説明します。

※Serverless Meetup Osaka #4 のLTにて講演した内容です

kenev

October 18, 2017
Tweet

More Decks by kenev

Other Decks in Technology

Transcript

  1. 4FSWFSMFTT'SBNFXPSL 0QFO'BB4ͱ͸        

       4 F S W F S M F T T  . F F U V Q  0 T B L B   
  2. ࣗ ݾ ঺ հ  ෱ ࢁ  ݈ Fukuyama

    Ken !LFOGEFW ˔ ϑϩϯτΤϯυɺόοΫΤϯυɺΠϯϑϥ ˔ "84ιϦϡʔγϣϯΞʔΩςΫτΞιγΤΠτ ˔ 6EFNZߨࢣ ˔ ʲੈքͰສਓ͕डߨʳ࣮ફʂ"OHVMBS+4ߨ࠲ ˔ 0QFO'BB4ίϯτϦϏϡʔλʔ ˔ 3BODIFS.FFUVQ0TBLBӡӦ 3BODIFS+1
  3. ձ ࣾ ঺ հ  ˔ ೥ઃཱͷιϑτ΢ΣΞ։ൃձࣾ ˔ ڌ఺ɿେࡕ ຊࣾ

    ɺ౦ژɺ޿ౡɺ෱Ԭ ˔ ૊ΈࠐΈ͔ΒεϚϗΞϓϦɺ"*·Ͱ৭ʑ΍͍ͬͯ·͢ ϚωʔδυΫϥ΢υαʔϏεɿ$BQTVMF$MPVE I U U Q T    D B Q T V M F D M P V E  J P ג ࣜ ձ ࣾ ε ʔ ύ ʔ ι ϑ τ ΢ Τ Ξ 4 V Q F S 4 P G U X B S F  $ P  - U E ΦϦδφϧΞχϝɿϖʔύʔͷதʹ͋ΔΧϛΛ৯΂Δ I U U Q T    Z P V U V  C F  %  4 + [ N 1 J W  : εϚϗΞϓϦ ɿອըΧϝϥ
  4.  ͷ ঺ հ Λ ͠ · ͢ 4 F

    S W F S M F T T  ' S B N F X P S L
  5.  0 Q F O ' B B 4 ͱ

    ͸ %PDLFS্Ͱಈ͘4FSWFSMFTTͳ'SBNFXPSL ίϯςφʹೖ͍ͬͯΕ͹ԿͰ΋'VODUJPOʹͳΓಘΔ ʜ %PDLFS4XBSNͱ,VCFSOFUFTͰͷಈ࡞͕αϙʔτ͞Ε͍ͯΔ
  6.  0 Q F O ' B B 4 ͱ

    ͸ ਓؾٸ্ঢதʂ
  7. 4FSWFSMFTTͳ࣮ྫʢ"84ʣ "MFYB )PX`T
 UIFXFBUIFS  - B N C E

    B 
 ' V O D U J P O T \lJOUFOUz l'JOE8FBUIFSz^ \lTQFFDIz l*U`TEFHSFFTz^
  8.  4 F S W F S M F T

    T ͱ ͸ “there are still servers required to run a serverless platform. The provider will need to manage servers (or virtual machines or containers), and will have some cost for running the platform, even when idle. A self-hosted system can still be considered serverless: typically one team acts as the provider and another developer team.” Š$/$'8(4FSWFSMFTT1BQFSΑΓ IUUQTHPPHMVE%'Y
  9. େ ࣄ ͳ ͷ ͸ Ξ ʔ Ω ς Ϋ

    ν ϟ  architecture ͖ͬͱ
  10. 0 Q F O ' B B 4 ͷ ࢓

    ૊ Έ  gateway L V C F S O F U F T 4 X B S N / /F U D  'O" Deploy Deploy Orchestrator API 'VODUJPO4UBDL 'O# Invoke Metrics/Scale جຊߏ੒
  11. 0 Q F O ' B B 4 ͷ ࢓

    ૊ Έ  gateway L V C F S O F U F T 4 X B S N / /F U D  'O" Deploy Deploy Orchestrator API 'VODUJPO4UBDL 'O# Invoke Metrics/Scale 'O" 'O" Scale ΍͹͘ͳͬͨΒࣗಈతʹεέʔϧʂ
  12. ' V O D U J P O ͷ ࢓

    ૊ Έ ͸ ʁ  watchdog
  13. ' V O D U J P O  8

    B U D I E P H  HTTP )FBEFST #PEZ )FBEFST #PEZ /usr/bin/node handler.js SFRVFTU ඪ४ೖྗ TUEJO TUEPVU ඪ४ग़ྗ SFTQPOTF
  14. ' V O D U J P O ͷ ࡞

    ੒ ϑ ϩ ʔ  QBDLBHFKTPO IBOEMFSKT faas-cli new Template Docker Image faas-cli build $POUBJOFS3FHJTUSZ faas-cli push جຊతʹ࣮૷͢Δͷ͸͚ͩ͜͜ʂ
  15. ' V O D U J P O ͷ σ

    ϓ ϩ Π  $POUBJOFS3FHJTUSZ faas-cli deploy gateway L V C F S O F U F T 4 X B S N / /F U D  'VODUJPO 'VODUJPO 'VODUJPO Pull Pull Deploy Deploy Orchestrator API
  16. ಉ ظ ݺ ͼ ग़ ͠  Gateway Func: resizer

    marshal request HTTP 200 ը૾ॖখ ґཔ
  17. ඇ ಉ ظ ݺ ͼ ग़ ͠  Gateway Func:

    resizer X-Callback-Url Queue http://x.y.z X-Callback-Url: http://x.y.z NATS ը૾ॖখ ґཔ
  18.  faas-netes L V C F S O F U

    F T 'VODUJPO 'VODUJPO 'VODUJPO Deploy Deploy Orchestrator API L  T  ࿈ ܞ gateway Invoke 3FWFSTF 1SPYZ https://github.com/openfaas/faas-netes
  19.  faas-<x> Orchestrator X 'VODUJPO 'VODUJPO 'VODUJPO Deploy Deploy Orchestrator

    API ଞ 1 S P W J E F S  ࿈ ܞ gateway Invoke 3FWFSTF 1SPYZ
  20.  faas-rancher 'VODUJPO 'VODUJPO 'VODUJPO Deploy Deploy Orchestrator API 3

    B O D I F S  ࿈ ܞ gateway Invoke 3FWFSTF 1SPYZ https://github.com/kenfdev/faas-rancher
  21. H P  U F N Q M B U

    F  https://blog.alexellis.io/serverless-golang-with-openfaas/ (PݴޠͷUFNQMBUF΋༻ҙ͞Ε͍ͯ·͢ʂ faas-cli new --lang go
  22. % F C V H H J O H ʂ

     ίϯςφʹΞλον͢Ε͹σόοά΋Մೳ
  23. $ *  $ %  1 J Q F

    M J O F  https://github.com/kenfdev/faas-echo
  24. ࢀߟ  ˔ IUUQTHJUIVCDPNPQFOGBBTGBBT ˔ 0QFO'BB4ͷίΞϓϩδΣΫτ ˔ IUUQTHJUIVCDPNPQFOGBBTGBBTDMJ ˔ 0QFO'BB4Λศརʹ࢖͏ͨΊͷ$-*

    ˔ IUUQTHJUIVCDPNPQFOGBBTGBBTOFUFT ˔ LVCFSOFUFT্Ͱ0QFO'BB4Λಈ͔ͨ͢Ίͷ֦ுػೳ ˔ IUUQTHJUIVCDPNGBBTBOEGVSJPVT ˔ 0QFO'BB4ͷ044ͳ'VODUJPO͕ू·͍ͬͯΔ৔ॴ
  25. ͝ ਗ਼ ௌ ͋ Γ ͕ ͱ ͏ ͝ ͟

    ͍ · ͠ ͨ ʂ  @ k e n f d e v