Pro Yearly is on sale from $80 to $50! »

Kubernetes とゼットラボの取り組み / Kubernetes and Z Lab's works

9f9df80ab6551776b49c4ad9432ba1b7?s=47 Kazuki Suda
August 01, 2017

Kubernetes とゼットラボの取り組み / Kubernetes and Z Lab's works

ビッグデータ基盤研究会@茗荷谷 17.08.01

9f9df80ab6551776b49c4ad9432ba1b7?s=128

Kazuki Suda

August 01, 2017
Tweet

Transcript

  1. 痥㔐ؽحؚر٦ة㛇湍灇瑔⠓ ,B[VLJ4VEBLTVEB![MBCDPKQ!TVQFSCSPUIFST ,VCFSOFUFTהئحزٓنך《׶穈׫

  2. 갭歊♧鰛,B[VLJ4VEB Ӝ 4PGUXBSF&OHJOFFS!;-BC Ӝ !TVQFSCSPUIFST

  3. ئحزٓن吳䒭⠓爡 Ӝ 䎃剢鏣甧 Ӝ ؎ٝؿٓ㛇湍䪮遭ך锃叨٥灇瑔Ꟛ涪 ,VCFSOFUFT %PDLFS 1SPNFUIFVT (PMBOH 

    Ӝ َؿ٦吳䒭⠓爡㶨⠓爡 Ӝ IUUQT[MBCDPKQ 
  4. ،آؑٝت  ,VCFSOFUFTהכ⡦ַ  ז׈,VCFSOFUFTזךַ  ,VCFSOFUFTכוֲ⹛ֻךַ  ئحزٓنך《׶穈׫ 

  5. ,VCFSOFUFTהכ⡦ַ

  6. ,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
  7. https://twitter.com/brendandburns/status/585479466648018944

  8. ז׈,VCFSOFUFTזךַ

  9. ,VCFSOFUFTכؔ٦فٝד֮׷ Ӝ ؔ٦فٝا٦أاؿزؐؑ، HJUIVCDPNLVCFSOFUFTLVCFSOFUFT "QBDIF-JDFOTF  Ӝ ؔ٦فٝرؠ؎ٝ HJUIVCDPNLVCFSOFUFTDPNNVOJUZ Ӝ

    ؔ٦فٝ؝ىُصذ؍ 4QFDJBM*OUFSFTU(SPVQT 4*(T  4MBDL 4UBDL0WFSPX Ⰻ⚅歲ד⟃♳ךى٦ز،حف Ӝ $MPVE/BUJWF$PNQVUJOH'PVOEBUJPO $/$' 
  10. ,VCFSOFUFTכه٦ةـٕד֮׷ Ӝ DMPVEQSPWJEFS --# ـٗحؙأزٖ٦آזוך乼⡲׾䬄韋⻉ ($1 "84 "[VSF 0QFO4UBDL 

    Ӝ $/* $POUBJOFS/FUXPSL*OUFSGBDF $BMJDP 'MBOOFM 0QFOW4XJUDI 8FBWF  Ӝ $POUBJOFS3VOUJNF %PDLFS SLU DSJP 
  11. ,VCFSOFUFTכ䧭ꞿ׃גְ׷  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
  12. ,VCFSOFUFTכ䧭ꞿ׃גְ׷

  13. ,VCFSOFUFTכוֲ⹛ֻךַ

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

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

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

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

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

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


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


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


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

    1PE app web 1PE app web 3FQMJDB4FU 4FSWJDF VIP: 10.0.0.249 Selector: app=web
  23. ׉ך➭ Ӝ /BNFTQBDFTؙٓأة׾ⴓⶴׅ׷ Ӝ %FQMPZNFOUTٗ٦ؚٔٝ،حفر٦زծٗ٦ٕغحؙ Ӝ $POH.BQT،فٔ؛٦ءّٝה鏣㹀ךⴓꨄ Ӝ 4FDSFUT،فٔ؛٦ءّٝהء٦ؙٖحزךⴓꨄ Ӝ

    1FSTJTUFOU7PMVNFT 1FSTJTUFOU7PMVNF$MBJNT宕竲نُٔ٦ي Ӝ *OHSFTT-頾蚚ⴓ侔ծغ٦ثٍٕمأزծ5-4穄畭 Ӝ +PCTٙٝءّحزآّـ Ӝ $SPO+PCآّـך㹀劍㹋遤 Ӝ 4UBUFGVM4FUTأذ٦زؿٕ،فٔ؛٦ءّٝ Ӝ %BFNPO4FUTⰋגךظ٦سד1PE׾㹋遤 Ӝ )PMJ[POUBM1PE"VUP4DBMFSؔ٦زأ؛٦ٕ 
  24. Demo

  25. ئحزٓنך《׶穈׫

  26. ,VCFSOFUFTBTB4FSWJDF Ꟛ涪罏ָإٕؿ؟٦ؽأד,VCFSOFUFTؙٓأة׾⡲䧭ծ⵴ꤐծ刿 倜ָדֹ׷؟٦ؽأ Ӝ ؙٓأةךؔ٦زؼ٦ؚٔٝ Ӝ ؙٓأةךأ؛٦ٕ،ؐز٥أ؛٦ٕ؎ٝ Ӝ ؙٓأةךؔ٦ز،حفر٦ز /PEPXOUJNF

    ٗ٦ؚٔٝ،حفر٦ز 
  27. ,VCFSOFUFTBTB4FSWJDFPO,VCFSOFUFT ,VCFSOFUFTⰻ鿇ך堣腉׾ⵃ欽ׅ׷ֿהדծؽآطأٗآحؙך㹋 鄲ח㼔䙀דֹ׷ Ӝ "1*ؒٝسه؎ٝزծ$36%ծ8BUDI"1* $VTUPN3FTPVSDF%FOJUJPOT Ӝ أذ٦زך㢌刿׾زٔؖח⹛⡲ׅ׷؝ٝزٗ٦ٓך㹋鄲 HJUIVCDPNLVCFSOFUFTDMJFOUHP 

  28. $VTUPN3FTPVSDF%FOJUJPOT Ӝ ⟣䠐ךٔا٦أ׾鷄⸇ "1*ؒٝسه؎ٝز $36%PQFSBUJPOT 8BUDI"1* Ӝ 513כWד䐖姺  apiVersion:

    apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: kubernetesclusters.kubernetes.zlab.co.jp spec: scope: Namespaced group: kubernetes.zlab.co.jp version: v1alpha1 names: kind: KubernetesCluster plural: kubernetesclusters singular: kubernetescluster
  29. $VTUPN3FTPVSDF%FOJUJPOT Ӝ ⟣䠐ךٔا٦أ׾鷄⸇ "1*ؒٝسه؎ٝز $36%PQFSBUJPOT 8BUDI"1* Ӝ 513כWד䐖姺  $

    cat cluster01.yaml apiVersion: kubernetes.zlab.co.jp/v1alpha1 kind: KubernetesCluster metadata: name: cluster01 spec: version: "1.7.0" masterReplicas: 3 masterFlavor: large workerReplicas: 5 workerFlavor: large $ kubectl create -f ./cluster01.yaml kubernetescluster “cluster01” created
  30. LVCFSOFUFT$MVTUFS WFSTJPONBTUFS3FQMJDBTXPSLFS3FQMJDBT LVCFSOFUFT UZQFNBTUFSWFSTJPOSFQMJDBT LVCFSOFUFT UZQFXPSLFSWFSTJPOSFQMJDBT NBDIJOF%FQMPZNFOU SFQMJDBTUFNQMBUFNBTUFS5FNQMBUF NBDIJOF%FQMPZNFOU SFQMJDBTUFNQMBUFXPSLFS5FNQMBUF

    NBDIJOF4FU SFQMJDBTUFNQMBUFNBTUFS5FNQMBUF NBDIJOF4FU SFQMJDBTUFNQMBUFXPSLFS5FNQMBUF NBDIJOF NBDIJOF NBDIJOF NBDIJOF NBDIJOF
  31. LVCFSOFUFT$MVTUFS WFSTJPONBTUFS3FQMJDBTXPSLFS3FQMJDBT LVCFSOFUFT UZQFNBTUFSWFSTJPOSFQMJDBT LVCFSOFUFT UZQFXPSLFSWFSTJPOSFQMJDBT NBDIJOF%FQMPZNFOU SFQMJDBTUFNQMBUFNBTUFS5FNQMBUF NBDIJOF%FQMPZNFOU SFQMJDBTUFNQMBUFXPSLFS5FNQMBUF

    NBDIJOF4FU SFQMJDBTUFNQMBUFNBTUFS5FNQMBUF NBDIJOF4FU SFQMJDBTUFNQMBUFXPSLFS5FNQMBUF NBDIJOF NBDIJOF NBDIJOF NBDIJOF NBDIJOF XPSLFS3FQMJDBT̔
  32. LVCFSOFUFT$MVTUFS WFSTJPONBTUFS3FQMJDBTXPSLFS3FQMJDBT LVCFSOFUFT UZQFNBTUFSWFSTJPOSFQMJDBT LVCFSOFUFT UZQFXPSLFSWFSTJPOSFQMJDBT NBDIJOF%FQMPZN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