An introduction to Kubernetes

An introduction to Kubernetes

Google Cloud Community fes @ Google Cloud Next'17 Tokyo / 2017.06.17
Kazuki Suda @superbrothers, Takashi Kusumi
https://www.meetup.com/ja-JP/GDG-Cloud-Tokyo/events/240052509/

9f9df80ab6551776b49c4ad9432ba1b7?s=128

Kazuki Suda

June 10, 2017
Tweet

Transcript

  1. (PPHMF$MPVE$PNNVOJUZGFT!(PPHMF$MPVE/FYU5PLZP  ,B[VLJ4VEBLTVEB![MBCDPKQ!TVQFSCSPUIFST 5BLBTIJ,VTVNJULVTVNJ![MBCDPKQ "O*OUSPEVDUJPOUP,VCFSOFUFT

  2. ،آؑٝت  8IBUJT,VCFSOFUFT   8IZ,VCFSOFUFT   )PX,VCFSOFUFTXPSLT 

    %FNP 
  3. What is Kubernetes?

  4. ,VCFSOFUFT Ӝ ؝ٝذشؔ٦؛أزٖ٦ءّٝخ٦ٕ ؝ٝذشךꂁ⪒ծ鏣㹀ծ盖椚׾遤ֲ Ӝ ĜĦĔėģğήĥęςؘٔءٍ铂ד乼菭㡦 Ӝ (PPHMFך爡ⰻءأذيַ׵؎ٝأػ؎،ׁ׸׋  “Kubernetes

    is open source—a contrast to Borg and Omega,
 which were developed as purely Google-internal systems. “ Borg, Omega, and Kubernetes
 https://research.google.com/pubs/pub44843.html
  5. https://twitter.com/brendandburns/status/585479466648018944

  6. Why Kubernetes?

  7. ,VCFSOFUFTJT0QFO Ӝ ؔ٦فٝا٦أاؿزؐؑ، HJUIVCDPNLVCFSOFUFTLVCFSOFUFT "QBDIF-JDFOTF  Ӝ ؔ٦فٝرؠ؎ٝ HJUIVCDPNLVCFSOFUFTDPNNVOJUZ Ӝ

    ؔ٦فٝ؝ىُصذ؍ 4QFDJBM*OUFSFTU(SPVQT 4*(T  4MBDL 4UBDL0WFSPX Ⰻ⚅歲ד⟃♳ךى٦ز،حف Ӝ $MPVE/BUJWF$PNQVUJOH'PVOEBUJPO $/$' 
  8. $VSSFOU1SPKFDUT Kubernetes
 Orchestration Prometheus
 Monitoring OpenTracing
 Tracing flutentd
 Logging Linkerd


    Service Mesh GRPC
 Remote Procedure Call CoreDNS
 Service Discovery Containerd
 Container Runtime rkt
 Container Runtime CNI
 Networking https://www.cncf.io/projects/
  9. https://www.cncf.io/about/members/ 1MBUJOVN.FNCFST

  10. ,VCFSOFUFTJT1PSUBCMF Ӝ DMPVEQSPWJEFS --# ـٗحؙأزٖ٦آזוך乼⡲׾䬄韋⻉ ($1 "84 "[VSF 0QFO4UBDL 

    Ӝ $/* $POUBJOFS/FUXPSL*OUFSGBDF $BMJDP 'MBOOFM 0QFOW4XJUDI 8FBWF  Ӝ $POUBJOFS3VOUJNF %PDLFS SLU DSJP 
  11. )ZCSJE$MPVE,VCFSOFUFT  Internet (4-#

  12. *OUIFGVUVSF  Internet (4-# ,VCFSOFUFT$MVTUFS'FEFSBUJPO

  13. ,VCFSOFUFTJT(SPXJOH ˑ,VCFSOFUFTJTPOFPGUIFUPQQSPKFDUTPO(JU)VC
 JOUIFUPQQFSDFOUJOTUBSTBOE/PJOUFSNTPGBDUJWJUZ˒  www.infoworld.com/article/3118345/cloud-computing/why-kubernetes-is-winning-the-container-war.html

  14. ,VCFSOFUFTJT(SPXJOH  Kubernetes Docker Swarm Apache Mesos All Time Statistics

    Contributors 1,473 201 288 Commits 49,619 3,331 24,308 12 Month Statistics Contributors 756 66 155 Commits 19,223 567 7,946 https://www.openhub.net/p/_compare?project_0=Kubernetes&project_1=docker+swarm&project_2=Apache+Mesos As of 17/06/12
  15. ,VCFSOFUFTJT(SPXJOH

  16. How Kubernetes works

  17. ،٦ؗذؙثٍ $POUSPMMFS
 .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS LVCFMFU $POUBJOFS
 3VOUJNF CLI

    API UI Master Node 1 LVCFMFU $POUBJOFS
 3VOUJNF Node “n”
  18. ،٦ؗذؙثٍ $POUSPMMFS
 .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS LVCFMFU CLI API UI

    Master Node 1 LVCFMFU Node “n”
  19. ،٦ؗذؙثٍ $POUSPMMFS
 .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS LVCFMFU CLI API UI

    Master Node 1 LVCFMFU Node “n”
  20. ،٦ؗذؙثٍ $POUSPMMFS
 .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS LVCFMFU $POUBJOFS
 3VOUJNF CLI

    API UI Master Node 1 LVCFMFU $POUBJOFS
 3VOUJNF Node “n”
  21. FUDEر٦ةأز، $POUSPMMFS
 .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS LVCFMFU $POUBJOFS
 3VOUJNF CLI

    API UI Master Node 1 LVCFMFU $POUBJOFS
 3VOUJNF Node “n”
  22. BQJTFSWFS3&45 $36% 钠鏾钠〳 $POUSPMMFS
 .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS LVCFMFU $POUBJOFS


    3VOUJNF CLI API UI Master Node 1 LVCFMFU $POUBJOFS
 3VOUJNF Node “n”
  23. 4DIFEVMFS1PEךأ؛آُ٦ؚٔٝ $POUSPMMFS
 .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS LVCFMFU $POUBJOFS
 3VOUJNF CLI

    API UI Master Node 1 LVCFMFU $POUBJOFS
 3VOUJNF Node “n”
  24. $POUSPMMFS.BOBHFSؽآطأٗآحؙ $POUSPMMFS
 .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS LVCFMFU $POUBJOFS
 3VOUJNF CLI

    API UI Master Node 1 LVCFMFU $POUBJOFS
 3VOUJNF Node “n”
  25. LVCFMFU1PEך盖椚 ؝ٝذشծأزٖ٦آ $POUSPMMFS
 .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS LVCFMFU $POUBJOFS
 3VOUJNF

    CLI API UI Master Node 1 LVCFMFU $POUBJOFS
 3VOUJNF Node “n”
  26. ؝،؝ٝإفز Ӝ 1PET Ӝ -BCFMT Ӝ 3FQMJDB4FUT Ӝ 4FSWJDFT Ӝ

    1FSTJTUFOU7PMVNFT 
  27. 1PET Ӝ 醱侧ך؝ٝذشה
 醱侧ךنُٔ٦ي Ӝ رفٗ؎ך剑㼭⽃⡘ Ӝ *1QFS1PE  1PE

    Volume Web Server Agent
  28. -BCFMT Ӝ ؗ٦غُٔ٦ךر٦ة Ӝ ㈓♧ךؚٕ٦ؾؚٝ堣腉 Ӝ ٓكٕإؙٖة BQQXFC SFMFBTFDBOBSZ 

    1PE release stable app web 1PE release canary app web
  29. -BCFMT Ӝ ؗ٦غُٔ٦ךر٦ة Ӝ ㈓♧ךؚٕ٦ؾؚٝ堣腉 Ӝ ٓكٕإؙٖة BQQXFC SFMFBTFDBOBSZ 

    1PE release stable app web 1PE release canary app web
  30. 3FQMJDB4FUT Ӝ /⦐ך1PEָ㹋遤ׁ׸גְ׷朐䡾׾⥂א  3FQMJDB4FU Replicas: 2 Selector: app=web Pod


    Template 1PE app web 1PE app web
  31. 3FQMJDB4FUT Ӝ /⦐ך1PEָ㹋遤ׁ׸גְ׷朐䡾׾⥂א  3FQMJDB4FU Replicas: 2 Selector: app=web Pod


    Template 1PE app web
  32. 3FQMJDB4FUT Ӝ /⦐ך1PEָ㹋遤ׁ׸גְ׷朐䡾׾⥂א  3FQMJDB4FU Replicas: 2 Selector: app=web Pod


    Template 1PE app web 1PE app web
  33. 4FSWJDFT Ӝ ⟎䟝*1הه٦ز Ӝ ٓكٕإؙٖةח״׷
 1PEךؚٕ٦ؾؚٝ Ӝ DMVTUFSQSPWJEFSה鸬䵿׃
 &YUFSOBM-#׮ 

    1PE app web 1PE app web 3FQMJDB4FU 4FSWJDF VIP: 10.0.0.249 Selector: app=web
  34. 1FSTJTUFOU7PMVNFT Ӝ 1FSTJTUFOU7PMVNFT أزٖ٦آ׾䩪ְ⳿׃ג Ӝ 1FSTJTUFOU7PMVNF$MBJNT ׉׸׾銲実ׅ׷  1PE Volume

    App 1FSTJTUFOU7PMVNF mode: RWO capacity: 10Gi 1FSTJTUFOU7PMVNF$MBJN mode: RWO request: 10Gi
  35. 1FSTJTUFOU7PMVNFT Ӝ 1FSTJTUFOU7PMVNFT أزٖ٦آ׾䩪ְ⳿׃ג Ӝ 1FSTJTUFOU7PMVNF$MBJNT ׉׸׾銲実ׅ׷  1PE Volume

    App 1FSTJTUFOU7PMVNF mode: RWO capacity: 10Gi 1FSTJTUFOU7PMVNF$MBJN mode: RWO request: 10Gi NFS
  36. 1FSTJTUFOU7PMVNFT Ӝ 1FSTJTUFOU7PMVNFT أزٖ٦آ׾䩪ְ⳿׃ג Ӝ 1FSTJTUFOU7PMVNF$MBJNT ׉׸׾銲実ׅ׷  1PE Volume

    App 1FSTJTUFOU7PMVNF mode: RWO capacity: 10Gi 1FSTJTUFOU7PMVNF$MBJN mode: RWO request: 10Gi
  37. 1FSTJTUFOU7PMVNFT Ӝ 1FSTJTUFOU7PMVNFT أزٖ٦آ׾䩪ְ⳿׃ג Ӝ 1FSTJTUFOU7PMVNF$MBJNT ׉׸׾銲実ׅ׷  1PE Volume

    App 1FSTJTUFOU7PMVNF mode: RWO capacity: 10Gi 1FSTJTUFOU7PMVNF$MBJN mode: RWO request: 10Gi
  38. 1FSTJTUFOU7PMVNFT Ӝ 1FSTJTUFOU7PMVNFT أزٖ٦آ׾䩪ְ⳿׃ג Ӝ 1FSTJTUFOU7PMVNF$MBJNT ׉׸׾銲実ׅ׷  1PE Volume

    App 1FSTJTUFOU7PMVNF mode: RWO capacity: 10Gi 1FSTJTUFOU7PMVNF$MBJN mode: RWO request: 10Gi
  39. ׉ך➭ Ӝ /BNFTQBDFTؙٓأة׾ⴓⶴׅ׷ Ӝ %FQMPZNFOUTٗ٦ؚٔٝ،حفر٦زծٗ٦ٕغحؙ Ӝ $POH.BQT،فٔ؛٦ءّٝה鏣㹀ךⴓꨄ Ӝ 4FDSFUT،فٔ؛٦ءّٝהء٦ؙٖحزךⴓꨄ Ӝ

    *OHSFTT-頾蚚ⴓ侔ծغ٦ثٍٕمأزծ5-4穄畭 Ӝ +PCTٙٝءّحزآّـ Ӝ $SPO+PCآّـך㹀劍㹋遤 Ӝ 4UBUFGVM4FUTأذ٦زؿٕ،فٔ؛٦ءّٝ Ӝ %BFNPO4FUTⰋגךظ٦سד1PE׾㹋遤 Ӝ )PMJ[POUBM1PE"VUP4DBMFSؔ٦زأ؛٦ٕ 
  40. أذحفדⴓַ׷1PEָ㹋遤ׁ׸׷תד  1PE׾⡲䧭  1PEךأ؛آُ٦ؚٔٝ  1PE׾圓䧭ׅ׷؝ٝذش؎ً٦آך《䖤ה㹋遤  1PEךأذ٦ةأ׾刿倜 

  41. 1PE׾⡲䧭 $POUSPMMFS
 .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS LVCFMFU $POUBJOFS
 3VOUJNF CLI

    API UI Master Node 1 LVCFMFU $POUBJOFS
 3VOUJNF Node “n”
  42. 1PEךأ؛آُ٦ؚٔٝ $POUSPMMFS
 .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS LVCFMFU $POUBJOFS
 3VOUJNF CLI

    API UI Master Node 1 LVCFMFU $POUBJOFS
 3VOUJNF Node “n”
  43. 1PE׾圓䧭ׅ׷؝ٝذش؎ً٦آך《䖤ה㹋遤 $POUSPMMFS
 .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS LVCFMFU $POUBJOFS
 3VOUJNF CLI

    API UI Master Node 1 LVCFMFU $POUBJOFS
 3VOUJNF Node “n”
  44. 1PEךأذ٦ةأ׾刿倜 $POUSPMMFS
 .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS LVCFMFU $POUBJOFS
 3VOUJNF CLI

    API UI Master Node 1 LVCFMFU $POUBJOFS
 3VOUJNF Node “n”
  45. Demo

  46. ״׶鑫׃ֻ濼׷חכ Ӝ LVCFSOFUFTJP Ӝ TMBDLLTJPKQVTFST KQFWFOUT Ӝ ,VCFSOFUFT.FFUVQ5PLZPCJUMZLTKQ Ӝ ,VCFSOFUFT6QBOE3VOOJOH03FJMMZ.FEJB

    Ӝ #PSH 0NFHB BOE,VCFSOFUFT 
  47. 5IBOLT Ӝ 4MJEF CJUMZJOUSPLT Ӝ 2VFTUJPOT  ,B[VLJ4VEBLTVEB![MBCDPKQ!TVQFSCSPUIFST 5BLBTIJ,VTVNJULVTVNJ![MBCDPKQ 8FˏSFIJSJOHCJUMZ[MBCDBSFFST