Knative Serving 入門 / kubernetes meetup 13

C84357a21083c81c5ccd5550422abc8d?s=47 Ryo Takaishi
September 28, 2018

Knative Serving 入門 / kubernetes meetup 13

C84357a21083c81c5ccd5550422abc8d?s=128

Ryo Takaishi

September 28, 2018
Tweet

Transcript

  1. 3.

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

    •࠷ۙ͸FluentdͷϓϥάΠϯΛॻ͍͍ͯ·͢ •OpenStackΛ࢖ͬͨϓϥΠϕʔτΫϥ΢υӡ༻ •Kubernetes on OpenStack؀ڥͷߏங •஥ؒืूதʂ
  2. 4.
  3. 8.
  4. 13.
  5. 20.

    • CRD(Custom Resource Definitions)Ͱఆٛ • Revision • Configuration • Route

    • Service !20 ,OBUJWF4FSWJOH͕ఏڙ͢ΔϦιʔε Route Configuration Revision Service Revision Revision NBOBHFT SPVUFUSB⒏DUP SFDPSEIJTUPSZPG
  6. 23.

    • Route • αʔϏε޲͚ΤϯυϙΠϯτΛఏڙ • ΤϯυϙΠϯτͷޙΖʹ͸1ͭҎ্ͷ Revision͕ଘࡏ • ύʔηϯςʔδϕʔεͰτϥϑΟοΫ Λ෼ׂ

    !23 ,OBUJWF4FSWJOH͕ఏڙ͢ΔϦιʔε Route Configuration Revision Service Revision Revision NBOBHFT SPVUFUSB⒏DUP SFDPSEIJTUPSZPG
  7. 24.

    • Service • RouteͱConfigurationΛ࡞੒͢Δ • جຊతʹServiceΛ࢖͏ͱָ • KubernetesͷDeploymentͱ ReplicaSetͷؔ܎ !24

    ,OBUJWF4FSWJOH͕ఏڙ͢ΔϦιʔε Route Configuration Revision Service Revision Revision NBOBHFT SPVUFUSB⒏DUP SFDPSEIJTUPSZPG
  8. 27.

    • Knative Serving͸ϦΫΤετΛτϦΨʔͱͯ͠ΞϓϦέʔγϣϯΛ ىಈɾεέʔϧΞ΢τ͢Δ • Pod1୆͋ͨΓͷෛՙ͕ৗʹҰఆʹͳΔΑ͏ʹPodͷ୆਺Λ૿ݮ͢Δ • Horizontal Auto Scaling

    • ϦΫΤετ͕Ұఆظؒͳ͍৔߹ɺPodͷ୆਺Λ0ʹͯ͠Ϧιʔεޮ ཰Λ্͛Δ͜ͱ΋Ͱ͖Δ !27 ,OBUJWFͷεέʔϦϯάͱ͸Կ͔
  9. 28.

    !28 Φʔτεέʔϧͷ࢓૊Έ Istio Route Route Revision Pods Deployment Autoscaler Activator

    inactive route active route watch first activate metrics resize create/delete
  10. 29.

    !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 ॠؒॠؒͰॲཧ͍ͯ͠ΔϦΫΤετͷ਺
  11. 30.

    !30 1PE͕ىಈ͍ͯ͠ͳ͍৔߹ Istio Route Route Revision Pods Deployment Autoscaler Activator

    inactive route active route watch first activate metrics PodͷىಈΛ؂ࢹ PodΛىಈ͢Δ create/delete resize
  12. 31.

    !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
  13. 32.

    !32 1PEͷෛՙ͕ߴ͗͢Δ௿͗͢Δ৔߹ Istio Route Route Revision Pods Deployment Autoscaler Activator

    inactive route active route watch first activate create/delete metrics resize
  14. 33.

    • Fast Brain • Pod1୆ຖͷಉ࣌ཁٻͷਫ४Λҡ࣋͢Δ • ྫɿPod1୆͕1ඵ͋ͨΓ100ϦΫΤετΛॲཧ͢ΔΑ͏୆਺Λ૿ݮ • Slow Brain

    • Fast BrainͰ࢖͏ਫ४ΛCPU΍ϝϞϦɺϨΠςϯγͳͲͷ౷ܭʹج͍ͮͯ ఏҊ͢Δ • v0.1.1Ͱ͸ະ࣮૷ʢϋʔυίʔυ͞Ε͍ͯΔʣ !33 "VUPTDBMFS͸ͭͷ೴Λ࣋ͭ
  15. 42.
  16. 45.

    • ϓϩΞΫςΟϒੑ • ΞϓϦέʔγϣϯ͕͋Β͔͡Ίىಈ͓ͯ͠Γɺঢ়ଶͷଈ࣌มߋ͸Ͱ͖ͳ͍͕ߴ଎ͳॲཧ͕ Մೳͳੑ࣭ • ىಈͬ͠ͺͳ͠ͳͷͰϦιʔεޮ཰͸ѱ͍ • ࣄલʹαʔόΛىಈͯ͠ΞΫηεʹඋ͑ΔΞϓϩʔν •

    ϦΞΫςΟϒੑ • ϦΫΤετʹԠͯ͡ΞϓϦέʔγϣϯΛىಈ͢Δੑ࣭ͷ͜ͱ • ىಈͱఀࢭͷίετ͕͋Δ͕ɺϦιʔεޮ཰͸Α͍ • ΞϓϦέʔγϣϯ͸ݱ࣮తͳ࣌ؒͰىಈͯ͘͠Δ͜ͱ͕લఏ !45 ϓϩΞΫςΟϒੑͱϦΞΫςΟϒੑ
  17. 46.

    • ϓϩΞΫςΟϒੑ • ΞϓϦέʔγϣϯ͕͋Β͔͡Ίىಈ͓ͯ͠Γɺঢ়ଶͷଈ࣌มߋ͸Ͱ͖ͳ͍͕ߴ଎ͳॲཧ͕ Մೳͳੑ࣭ • ىಈͬ͠ͺͳ͠ͳͷͰϦιʔεޮ཰͸ѱ͍ • ࣄલʹαʔόΛىಈͯ͠ΞΫηεʹඋ͑ΔΞϓϩʔν •

    ϦΞΫςΟϒੑ • ϦΫΤετʹԠͯ͡ΞϓϦέʔγϣϯΛىಈ͢Δੑ࣭ͷ͜ͱ • ΞϓϦέʔγϣϯ͸ݱ࣮తͳ࣌ؒͰىಈͯ͘͠Δ͜ͱ͕લఏ • ىಈͱఀࢭͷίετ͕͋Δ͕ɺϦιʔεޮ཰͸Α͍ !46 ϓϩΞΫςΟϒੑͱϦΞΫςΟϒੑ •CGI΍FastCGIɺFaaS͕֘౰ •FastCGI͸Ϧιʔεޮ཰ͱੑೳͷཱ྆ͷͨΊҰఆظؒىಈ •FaaS΋ϦΞΫςΟϒੑΛ࣋ͭϓϥοτϑΥʔϜͷҰͭ
  18. 49.
  19. 52.
  20. 56.

    • Knative ServingͱKubernetesͷಋೖɾ؅ཧ΍૊৫ϙϦγʔɺηΩϡ ϦςΟύονͷద༻ʹϑΥʔΧε • HobbyistɺCluster administratorɺSecurity EngineerͳͲ • ϢʔβʔετʔϦʔ

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