Prometheus による Kubernetes モニタリングの基礎 / Kubernetes monitoring with Prometheus

Prometheus による Kubernetes モニタリングの基礎 / Kubernetes monitoring with Prometheus

Google Cloud Community fes @ Google Cloud Next'17 Tokyo
2017.06.14
https://www.meetup.com/GDG-Cloud-Tokyo/events/240052509/

365dfdeb6858bb8b82baedb582bfe1cf?s=128

Takashi Kusumi

June 12, 2017
Tweet

Transcript

  1. 1SPNFUIFVTח״׷,VCFSOFUFT ٌصةؚٔٝך㛇燉 5BLBTIJ,VTVNJ ;-BC

  2. 1SPNFUIFVTהכ Ӝ 1VMM㘗 )551 ךًزؙٔأ湊鋔ءأذي JOTQJSFECZ(PPHMFT#PSHNPO Ӝ $/$'ך؝ٝه٦طٝزך♧א ,VCFSOFUFTה鋵ㄤ䚍ָ넝ְ Ӝ

    㢳䕙ז4FSWJDF%JTDPWFSZח㼎䘔 ,VCFSOFUFT ($& &$ DPOTVM 湊鋔㼎韋׾荈⹛涸ח鋅אֽגֻ׸׷ 
  3. 1SPNFUIFVT'PSNBU W Ӝ ،فٔ؛٦ءّٝכֿךؿؓ٦وحز׾)551ד鵤⽱ׅ׷ Ӝ ًزؙٔأせծٓكٕծ⦼׾♧遤ה׃ג醱侧遤ד圓䧭ׁ׸׷ Ӝ ♧㹀꟦ꥫד)551ד《䖤ׁ׸儗禸⴨ד⥂㶷ׁ׸׷  node_cpu{cpu="cpu0",mode="guest"}

    0 node_cpu{cpu="cpu0",mode="idle"} 151153.66 node_cpu{cpu="cpu0",mode="iowait"} 21.02 ... ˟5FYUך➭ח1SPUPDPM#VFS׮؟ه٦زׁ׸׷
  4. 1SPNFUIFVTח״׷,VCFSOFUFTך湊鋔 Ӝ "1*4FSWFSַ׵荈⹛涸ח湊鋔㼎韋׾《䖤 4FSWJDF%JTDPWFSZ  Ӝ Ⱅ䒭ָ鏣㹀⢽׾䲿⣘ 1PEה׃גرفٗ؎  Prometheus

    k8s API Server Pod / Node Pod / Node Pod, Node,... 湊鋔㼎韋׾《䖤 㹀劍涸ח湊鋔 )551 ,VCFSOFUFTؙٓأةⰻ
  5. 1SPNFUIFVTך꧊秈٥湊鋔 'FEFSBUJPO  Prometheus k8s API Server Prometheus Pod, Node,...

    Pod, Node,... Pod, Node,... k8s API Server Prometheus Pod, Node,... Pod, Node,... Pod, Node,... 1SPNFUIFVTず㡦ך꧊秈٥湊鋔׮〳腉
  6.  1SPNFUIFVTך5BSHFU♧鋮 荈⹛涸ח湊鋔㼎韋ָ鷄⸇ׁ׸׷

  7. (SBGBOBח״׷تحءُن٦س

  8. 湊鋔ךٖ؎َ٦  Server Kubernetes Application Ӝ /PEF&YQPSUFS娤崞湊鋔 $16 3". Ӝ

    D"EWJTPS؝ٝذش嫣$16 3".FUD Ӝ LVCFTUBUFNFUSJDT1PE侧ծأذ٦ةأFUD Ӝ ،فٔ؛٦ءّٝ㔿剣ך㹋鄲 )551،ؙإأ侧 Ⳣ椚儗꟦FUD ⚥ד׮D"EWJTPSך䞔㜠כؙٓأةךⰋ⡤׾濼׷ךח⤑ⵃ
  9. ،فٔ؛٦ءّٝך湊鋔 Ӝ ،فٔ؛٦ءّٝ⩎ח1SPNFUIFVT䕎䒭ךؒٝسه؎ٝز׾㹋鄲 Ӝ 4FSWJDF⩎ח،ظذ٦ءّٝ׾鷄⸇ׅ׷׌ֽ Ⱅ䒭鏣㹀ך㜥さ  《䖤כTFSWJDF穗歋דכזֻぐ1PEח㼎׃ג遤ֲ  apiVersion:

    v1 kind: Service metadata: name: myapp annotations: prometheus.io/scrape: 'true' prometheus.io/port: '8080' prometheus.io/path: /prometheus
  10. NFUSJDTכぐ1PEַ׵《䖤ׁ׸׷  Prometheus k8s API Server 湊鋔㼎韋׾《䖤 svc / app

    pod / app-XX pod / app-YY ؕؐٝة⦼זוָ֮׷׋׭ծNFUSJDTכぐ1PEַ׵《䖤ׅ׷䗳銲ָ֮׷ NFUSJDT׾《䖤 TFSWJDF׾⯋ח FOEQPJOUT׾《䖤
  11. ,VCFSOFUFTך湊鋔D"EWJTPS Ӝ D"EWJTPS$POUBJOFS"EWJTPS Ӝ ぐ1PE׀הך$16 3". /FUXPSLך⢪欽桦זוָ׻ַ׷ Ӝ LVCFMFUח穈׫鴥ת׸גֶ׶ծQSPNFUIFVTח㼎䘔幥׫ 

    (SBGBOBדך〳鋔⻉
  12. ,VCFSOFUFTך湊鋔LVCFTUBUFNFUSJDT Ӝ 1PEך侧װأذ٦ةأהְ׏׋LTؔـآؙؑزךًزؙٔأ Ӝ LVCFSOFUFTⰕ䒭ד䲿⣘ׁ׸גְ׷BEEPO 1PEה׃גرفٗ؎ׅ׷  (SBGBOBדך〳鋔⻉

  13. ؟٦غ٦ך湊鋔 Ӝ 1SPNFUIFVTⰕ䒭ך/PEF&YQPSUFS׾⢪欽 %BFNPO4FUדぐظ٦سחرفٗ؎ׅ׷ Ӝ $16 3". /FUXPSL -PBEזו㢳䀄ח床׷䞔㜠ָ《׸׷ 

    (SBGBOBדך〳鋔⻉
  14. תה׭ Ӝ 1SPNFUIFVTה,VCFSOFUFTכ鋵ㄤ䚍ָ넝ְ 4FSWJDF%JTDPWFSZ״׏ג湊鋔㼎韋ך鏣㹀ָ荈⹛ ،فٔ؛٦ءַّٝ׵ؙٓأةך朐屣תד䌴䎢ֻ湊鋔דֹ׷ Ӝ /FYU4UFQT ،فٔ؛٦ءّٝך1SPNFUIFVT㼎䘔 تحءُن٦س (SBGBOBFUD

     ،ٓ٦زך鏣㹀 "MFSUNBOBHFS 
  15. 8FBSFIJSJOH CJUMZ[MBCDBSFFST