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

Knative Serving 入門 / kubernetes meetup 13

Ryo Takaishi
September 28, 2018

Knative Serving 入門 / kubernetes meetup 13

Ryo Takaishi

September 28, 2018
Tweet

More Decks by Ryo Takaishi

Other Decks in Technology

Transcript

  1. ∁ੴ ྒ / @r_takaishi TAKAISHI Ryo •ιϑτ΢ΣΞΤϯδχΞ @ GMOϖύϘ •΢ΣϒαʔϏεͷج൫ߏஙɾӡ༻

    •࠷ۙ͸FluentdͷϓϥάΠϯΛॻ͍͍ͯ·͢ •OpenStackΛ࢖ͬͨϓϥΠϕʔτΫϥ΢υӡ༻ •Kubernetes on OpenStack؀ڥͷߏங •஥ؒืूதʂ
  2. • CRD(Custom Resource Definitions)Ͱఆٛ • Revision • Configuration • Route

    • Service !20 ,OBUJWF4FSWJOH͕ఏڙ͢ΔϦιʔε Route Configuration Revision Service Revision Revision NBOBHFT SPVUFUSB⒏DUP SFDPSEIJTUPSZPG
  3. • Route • αʔϏε޲͚ΤϯυϙΠϯτΛఏڙ • ΤϯυϙΠϯτͷޙΖʹ͸1ͭҎ্ͷ Revision͕ଘࡏ • ύʔηϯςʔδϕʔεͰτϥϑΟοΫ Λ෼ׂ

    !23 ,OBUJWF4FSWJOH͕ఏڙ͢ΔϦιʔε Route Configuration Revision Service Revision Revision NBOBHFT SPVUFUSB⒏DUP SFDPSEIJTUPSZPG
  4. • Service • RouteͱConfigurationΛ࡞੒͢Δ • جຊతʹServiceΛ࢖͏ͱָ • KubernetesͷDeploymentͱ ReplicaSetͷؔ܎ !24

    ,OBUJWF4FSWJOH͕ఏڙ͢ΔϦιʔε Route Configuration Revision Service Revision Revision NBOBHFT SPVUFUSB⒏DUP SFDPSEIJTUPSZPG
  5. • Knative Serving͸ϦΫΤετΛτϦΨʔͱͯ͠ΞϓϦέʔγϣϯΛ ىಈɾεέʔϧΞ΢τ͢Δ • Pod1୆͋ͨΓͷෛՙ͕ৗʹҰఆʹͳΔΑ͏ʹPodͷ୆਺Λ૿ݮ͢Δ • Horizontal Auto Scaling

    • ϦΫΤετ͕Ұఆظؒͳ͍৔߹ɺPodͷ୆਺Λ0ʹͯ͠Ϧιʔεޮ ཰Λ্͛Δ͜ͱ΋Ͱ͖Δ !27 ,OBUJWFͷεέʔϦϯάͱ͸Կ͔
  6. !28 Φʔτεέʔϧͷ࢓૊Έ Istio Route Route Revision Pods Deployment Autoscaler Activator

    inactive route active route watch first activate metrics resize create/delete
  7. !29 ༻ޠ Knative Serving Revision ϢʔβʔͷίʔυͱઃఆͷεφοϓγϣοτΛѻ͏ΧελϜϦιʔε Knative Serving Route RevisionͷIstioͷΠϯάϨεϧʔϧΛ௨ͯ͠ΫϥΠΞϯτʹެ։͢ΔΧελϜϦιʔε

    Kubernetes Deployment Podͱͯ͠ಈ͘ίϯςφͷϥΠϑαΠΫϧΛ؅ཧ͢ΔKubernetesͷϦιʔε Knative Serving Autoscaler Ϣʔβʔͷίʔυ͕ಈ͘PodͷෛՙΛ؂ࢹ͢ΔͨΊͷDeploymentɻ PodͷෛՙΛҰఆʹอͭΑ͏ʹϢʔβʔίʔυ༻ͷDeploymentͷαΠζΛ૿ݮ͢Δ Knative Serving Activator KnativeͰ͸ϦΫΤετ͕ಧ͍ͨ࣌ɺͦΕΛड͚औΔPod͕ͳ͍Մೳੑ͕͋Δɻ ͦ͏͍͏࣌ʹϦΫΤετΛड͚औΔDeploymentɻPodΛىಈ͠ɺϦΫΤετΛϑΥϫʔυ͢Δ Concurrency ॠؒॠؒͰॲཧ͍ͯ͠ΔϦΫΤετͷ਺
  8. !30 1PE͕ىಈ͍ͯ͠ͳ͍৔߹ Istio Route Route Revision Pods Deployment Autoscaler Activator

    inactive route active route watch first activate metrics PodͷىಈΛ؂ࢹ PodΛىಈ͢Δ create/delete resize
  9. !31 1PE͕ىಈ͍ͯ͠Δ৔߹ Istio Route Route Revision Pods Deployment Autoscaler Activator

    inactive route active route watch first activate metrics Pod͕ىಈ͍ͯ͠Δ৔߹ɺ ϦΫΤετ͸Pod΁ Autoscaler͸Podͷ ϝτϦοΫΛ؂ࢹ create/delete resize
  10. !32 1PEͷෛՙ͕ߴ͗͢Δ௿͗͢Δ৔߹ Istio Route Route Revision Pods Deployment Autoscaler Activator

    inactive route active route watch first activate create/delete metrics resize
  11. • Fast Brain • Pod1୆ຖͷಉ࣌ཁٻͷਫ४Λҡ࣋͢Δ • ྫɿPod1୆͕1ඵ͋ͨΓ100ϦΫΤετΛॲཧ͢ΔΑ͏୆਺Λ૿ݮ • Slow Brain

    • Fast BrainͰ࢖͏ਫ४ΛCPU΍ϝϞϦɺϨΠςϯγͳͲͷ౷ܭʹج͍ͮͯ ఏҊ͢Δ • v0.1.1Ͱ͸ະ࣮૷ʢϋʔυίʔυ͞Ε͍ͯΔʣ !33 "VUPTDBMFS͸ͭͷ೴Λ࣋ͭ
  12. • ϓϩΞΫςΟϒੑ • ΞϓϦέʔγϣϯ͕͋Β͔͡Ίىಈ͓ͯ͠Γɺঢ়ଶͷଈ࣌มߋ͸Ͱ͖ͳ͍͕ߴ଎ͳॲཧ͕ Մೳͳੑ࣭ • ىಈͬ͠ͺͳ͠ͳͷͰϦιʔεޮ཰͸ѱ͍ • ࣄલʹαʔόΛىಈͯ͠ΞΫηεʹඋ͑ΔΞϓϩʔν •

    ϦΞΫςΟϒੑ • ϦΫΤετʹԠͯ͡ΞϓϦέʔγϣϯΛىಈ͢Δੑ࣭ͷ͜ͱ • ىಈͱఀࢭͷίετ͕͋Δ͕ɺϦιʔεޮ཰͸Α͍ • ΞϓϦέʔγϣϯ͸ݱ࣮తͳ࣌ؒͰىಈͯ͘͠Δ͜ͱ͕લఏ !45 ϓϩΞΫςΟϒੑͱϦΞΫςΟϒੑ
  13. • ϓϩΞΫςΟϒੑ • ΞϓϦέʔγϣϯ͕͋Β͔͡Ίىಈ͓ͯ͠Γɺঢ়ଶͷଈ࣌มߋ͸Ͱ͖ͳ͍͕ߴ଎ͳॲཧ͕ Մೳͳੑ࣭ • ىಈͬ͠ͺͳ͠ͳͷͰϦιʔεޮ཰͸ѱ͍ • ࣄલʹαʔόΛىಈͯ͠ΞΫηεʹඋ͑ΔΞϓϩʔν •

    ϦΞΫςΟϒੑ • ϦΫΤετʹԠͯ͡ΞϓϦέʔγϣϯΛىಈ͢Δੑ࣭ͷ͜ͱ • ΞϓϦέʔγϣϯ͸ݱ࣮తͳ࣌ؒͰىಈͯ͘͠Δ͜ͱ͕લఏ • ىಈͱఀࢭͷίετ͕͋Δ͕ɺϦιʔεޮ཰͸Α͍ !46 ϓϩΞΫςΟϒੑͱϦΞΫςΟϒੑ •CGI΍FastCGIɺFaaS͕֘౰ •FastCGI͸Ϧιʔεޮ཰ͱੑೳͷཱ྆ͷͨΊҰఆظؒىಈ •FaaS΋ϦΞΫςΟϒੑΛ࣋ͭϓϥοτϑΥʔϜͷҰͭ
  14. • Knative ServingͱKubernetesͷಋೖɾ؅ཧ΍૊৫ϙϦγʔɺηΩϡ ϦςΟύονͷద༻ʹϑΥʔΧε • HobbyistɺCluster administratorɺSecurity EngineerͳͲ • ϢʔβʔετʔϦʔ

    • Knative ServingΫϥελʔΛ࡞੒͢Δ • Ϧιʔεར༻ʹ੍͍ͭͯޚͨ͠Γ՝ۚ͢Δ • ΞϓϦέʔγϣϯͷ؂ࠪ΍ύονద༻ !56 0QFSBUPS