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

CloudNative時代におけるKubernetes 〜 情報処理学会 コンピュータシステムシンポジウム 2018 (ComSys 2018)〜 / comsys2018_kubernetes_cloudnative

CloudNative時代におけるKubernetes 〜 情報処理学会 コンピュータシステムシンポジウム 2018 (ComSys 2018)〜 / comsys2018_kubernetes_cloudnative

http://www.ipsj.or.jp/sig/os/index.php?ComSys2018

CloudNative時代におけるKubernetes
〜情報処理学会 コンピュータシステムシンポジウム 2018 (ComSys 2018)〜

招待講演1:「Cloud Native時代におけるKubernetes」 株式会社サイバーエージェント 青山 真也様
今日コンテナ技術は広く普及し、大規模な環境でのコンテナオーケストレーションエンジンとしてはKubernetesがデファクトスタンダードとなっています。本講演ではKubernetesが必要な理由・機能及びコンセプト・解決できる問題について、また分散システムとしてのKubernetesの仕組みについて紹介します。あわせて、コンテナを利用した開発をするにあたり切り離すことのできない「Cloud Native」や「マイクロサービス」の考え方、最近のKubernetesを取り巻く技術動向についても紹介します。
主なトピック:
Kubernetesの歴史的背景と必要な理由
Cloud Nativeとマイクロサービスとは
Kubernetesの機能やコンセプト
今後注目されているKubernetes周辺分野や技術
御略歴
株式会社サイバーエージェント アドテク本部 Strategic Infrastructure Agency 2016年入社。OpenStack?を使ったプライベートクラウドやGKE互換なコンテナプラットフォームをゼロから構築し、国内カンファレンスでのKeynoteに登壇。その後、世界で2番目にCertified Kubernetes Application Developer、138番目にCertified Kubernetes Administratorの認定資格を取得。現在はKubernetesやOpenStack?などOSSへのコントリビュート活動をはじめ、CNCF公式のCloud Native Meetup TokyoのOrganizerやJapan Container Daysの運営などコミュニティ活動にも従事。
2018年9月発刊「Kubernetes完全ガイド」(インプレス)の著者。

Masaya Aoyama (@amsy810)

November 29, 2018
Tweet

More Decks by Masaya Aoyama (@amsy810)

Other Decks in Technology

Transcript

  1. Masaya Aoyama
    CyberAgent adtech studio
    CloudNative࣌୅ʹ͓͚ΔKubernetes
    ৘ใॲཧֶձ ίϯϐϡʔλγεςϜγϯϙδ΢Ϝ 2018
    MasayaAoyama @amsy810

    View full-size slide

  2. Japan Container Days v18.04 Keynote
    Cloud Native Meetup Tokyo Organizer (+ KubeCon + JKD)

    for Kubernetes
    CKA #138CKAD #2
    OpenStack / Kubernetes Contributor
    Masaya Aoyama (@amsy810)
    Infrastructure Engineer

    View full-size slide

  3. Hobby == Kubernetes

    View full-size slide

  4. Supervisor == Hirotsu Toshio

    View full-size slide

  5. Agenda
    page
    05
    • Cloud Native and Kubernetes
    • Container and Docker
    • Microservice and Service Mesh
    • Kubernetes
    • Kubernetes & Workloads
    • Kubernetes & Networking
    • Kubernetes is Distributed system
    • Extends Kubernetes
    • Other topics for Kubernetes

    View full-size slide

  6. Agenda
    page
    06
    • Cloud Native and Kubernetes
    • Container and Docker
    • Microservice and Service Mesh
    • Kubernetes
    • Kubernetes & Workloads
    • Kubernetes & Networking
    • Kubernetes is Distributed system
    • Extends Kubernetes
    • Other topics for Kubernetes

    View full-size slide

  7. Cloud Native and Kubernetes
    What is Kubernetes? What is Cloud Naitve?

    View full-size slide

  8. CNCF and
    The Linux Foundation
    • KubernetesThe Linux Foundation

    CNCF




    View full-size slide

  9. page
    09
    CNCF

    CNCF Community Presentation, CNCF, 2018
    (https://github.com/cncf/presentations)

    View full-size slide

  10. Graduated projects
    Graduated and Incubating Projects, CNCF, 2018-11-28 (https://www.cncf.io/projects/)

    View full-size slide

  11. Incubating projects
    Graduated and Incubating Projects, CNCF, 2018-11-28 (https://www.cncf.io/projects/)

    View full-size slide

  12. Sandbox projects
    Sandbox Projects, CNCF, 2018-11-28 (https://www.cncf.io/sandbox-projects/)

    View full-size slide

  13. Cloud Native
    page
    014
    Cloud native technologies empower organizations to build and run scalable
    applications in modern, dynamic environments such as public, private, and hybrid
    clouds. Containers, service meshes, microservices, immutable infrastructure, and
    declarative APIs exemplify this approach.
    These techniques enable loosely coupled systems that are resilient, manageable,
    and observable. Combined with robust automation, they allow engineers to make
    high-impact changes frequently and predictably with minimal toil.
    The Cloud Native Computing Foundation seeks to drive adoption of this paradigm by
    fostering and sustaining an ecosystem of open source, vendor-neutral projects. We
    democratize state-of-the-art patterns to make these innovations accessible for
    everyone.
    CNCF Cloud Native Defenition v1.0, CNCF, 2018-11-28
    (https://github.com/cncf/toc/blob/master/DEFINITION.md)

    View full-size slide

  14. Cloud Native &
    page
    015
    Cloud native technologies empower organizations to build and run scalable
    applications in modern, dynamic environments such as public, private, and hybrid
    clouds. Containers, service meshes, microservices, immutable infrastructure, and
    declarative APIs exemplify this approach.
    !#Scalable
    "
    $%
    CNCF Cloud Native Defenition v1.0, CNCF, 2018-11-28
    (https://github.com/cncf/toc/blob/master/DEFINITION.md)
    • Container
    • Immutable Infrastructure
    • Service Mesh
    • Microservice
    • Declarative API

    View full-size slide

  15. Cloud Native5
    page
    016
    These techniques enable loosely coupled systems that are resilient, manageable,
    and observable. Combined with robust automation, they allow engineers to make
    high-impact changes frequently and predictably with minimal toil.
    CNCF Cloud Native Defenition v1.0, CNCF, 2018-11-28
    (https://github.com/cncf/toc/blob/master/DEFINITION.md)
    • +-
    • $
    • ,*
    • 1(

    • )0 4. '#2
    &"3
    ! %/ note. SRE

    View full-size slide

  16. Cloud Native-
    page
    017
    The Cloud Native Computing Foundation seeks to drive adoption of this paradigm by
    fostering and sustaining an ecosystem of open source, vendor-neutral projects. We
    democratize state-of-the-art patterns to make these innovations accessible for
    everyone.
    CNCF Cloud Native Defenition v1.0, CNCF, 2018-11-28
    (https://github.com/cncf/toc/blob/master/DEFINITION.md)
    • ! #'
    • ! !

    • ! ,%*
    ($+
    !
    )"&

    View full-size slide

  17. Cloud Native8
    page
    018
    Cloud native technologies empower organizations to build and run scalable
    applications in modern, dynamic environments such as public, private, and hybrid
    clouds. Containers, service meshes, microservices, immutable infrastructure, and
    declarative APIs exemplify this approach.
    These techniques enable loosely coupled systems that are resilient, manageable,
    and observable. Combined with robust automation, they allow engineers to make
    high-impact changes frequently and predictably with minimal toil.
    The Cloud Native Computing Foundation seeks to drive adoption of this paradigm by
    fostering and sustaining an ecosystem of open source, vendor-neutral projects. We
    democratize state-of-the-art patterns to make these innovations accessible for
    everyone.
    CNCF Cloud Native Defenition v1.0, CNCF, 2018-11-28
    (https://github.com/cncf/toc/blob/master/DEFINITION.md)
    • .0
    • &
    • /-
    • 4*

    • +3 71 )%5
    ($6
    "!'2
    Open Scalable#,

    View full-size slide

  18. Docker Swarm mode
    Container Orchestration Engine

    View full-size slide

  19. Container Orchestration
    Engine (4/0
    • 3*Docker2/
    • #
    $ #

    $ # / $
    $ #
    • "$ # $
    • #-.15
    • 6&+!$ #
    • $
    • "$# #
    • $,')%2/

    View full-size slide

  20. Container Orchestration
    Engine CYOP
    • XE Docker*" SO
    • 1 $ ,2.1
    • 2.1 / 2"2.1
    • 02.1)!2"
    • 1 $ KLRZ
    • ^>F /(&2.1
    • 2'!%.
    • 02#%-11
    • !2J?D; SO
    Container Orchestration
    Engine CYOP
    • QT9 +
    • B34
    • SO
    • 8[M

    • :NW67_U IA
    \H@] 54
    =8V

    View full-size slide

  21. Kubernetes
    06 2014
    Borg
    OSS
    Kubernetes timeline
    page
    022
    Google Borg"
    ~2015
    Google !
    $#OrchestratorBorg

    View full-size slide

  22. page
    023
    CNCF v1.0
    07 2015
    Cloud Native Computing Foundation
    11 2014
    GCP GKE
    Google Cloud Platform
    Google Kubernetes Engine
    Kubernetes timeline

    View full-size slide

  23. page
    024
    Amazon EKS
    11 2017
    Amazon Web Service
    Amazon Elastic Container Service for Kubernetes
    02 2017
    Azure AKS
    Microsoft Azure
    Azure Container Service
    Kubernetes timeline

    View full-size slide

  24. future is promising
    32 Certified Kubernetes
    Platform/Distribution
    11 2017
    Kubernetes CNCF

    Platform
    Distribution
    page
    025
    09 2017
    Certified Kubernetes
    Administrator
    Kubernetes !
    Kubernetes timeline

    View full-size slide

  25. page
    026
    KubeCon + CloudNativeCon
    KubeCon + CloudNativeCon Barcelona 2019 Call for Proposals (CFP) Is Open, CNCF, 2018-11-28
    (https://www.cncf.io/blog/2018/11/16/kubecon-barcelona-2019-call-for-proposals-cfp-is-open/)

    View full-size slide

  26. CNCF Community Presentation, CNCF, 2018 (https://github.com/cncf/presentations)

    View full-size slide

  27. page
    028
    Enterprise

    Monzo Bank
    • Kubernetes + Linkerd (Service Mesh)
    Ref: https://monzo.com/blog/2016/09/19/building-a-modern-bank-backend/

    View full-size slide

  28. Agenda
    page
    029
    • Cloud Native and Kubernetes
    • Container and Docker
    • Microservice and Service Mesh
    • Kubernetes
    • Kubernetes & Workloads
    • Kubernetes & Networking
    • Kubernetes is Distributed system
    • Extends Kubernetes
    • Other topics for Kubernetes

    View full-size slide

  29. Container / Docker
    Benefit of Container / Docker




    View full-size slide

  30. Container
    System Container
    • KVMXen

    • init
    Application Container




    page
    04

    View full-size slide

  31. Docker
    • Docker4%Application Container
    .71-+8$!
    • #DevOps/# 2: /3
    6)*5
    • 0, Moby"

    &9 # containerd

    ('
    page
    032

    View full-size slide

  32. page
    033
    Ref: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
    Ref: https://12factor.net/
    Part of Docker Container Best Practice
    • >(1
    • "2; $0@Immutable InfrastructureA
    • ?:7+ / 397+*"
    !'8
    • #/< !&
    • 48)=-%7+,1 . 6
    • 5
    • etc

    View full-size slide

  33. DockerfileDocker Image
    page
    034
    FROM centos:7
    RUN yum -y install epel-release
    RUN yum -y install nginx
    COPY nginx.conf /etc/nginx/
    ENTRYPOINT ["nginx", "-g", "daemon off;"]
    Build Once, Run Anywhere

    Docker Image

    View full-size slide

  34. Docker Image
    page
    035
    5: ENTRYPOINT ["nginx", "-g", "daemon off;"]
    4: COPY nginx.conf /etc/nginx/
    3: RUN yum -y install nginx
    2: RUN yum -y install epel-release
    1: FROM centos:7


    Docker Image

    View full-size slide

  35. page
    036
    $ docker build . -t sample-image
    Sending build context to Docker daemon 252.9kB
    Step 1/5 : FROM centos:7
    ---> 75835a67d134
    Step 2/5 : RUN yum -y install epel-release
    ---> Running in 9db248fc7b9a
    ...
    Removing intermediate container 9db248fc7b9a
    ---> 2fe5a7f8c007
    Step 3/5 : RUN yum -y install nginx
    ---> Running in 0547bd920b0a
    ...
    Removing intermediate container 0547bd920b0a
    ---> 843b47a96c5e
    Step 4/5 : COPY nginx.conf /etc/nginx/
    ---> fe63b2d4c95d
    Step 5/5 : ENTRYPOINT ["nginx", "-g", "daemon off;"]
    ---> Running in 876ee4d29339
    Removing intermediate container 876ee4d29339
    ---> b5068171c053
    Successfully built b5068171c053
    Successfully tagged sample-image:latest
    75835a67d134
    2fe5a7f8c007
    843b47a96c5e
    fe63b2d4c95d
    b5068171c053
    sample-image

    View full-size slide


  36. page
    037
    $ docker history sample-image
    IMAGE CREATED BY SIZE
    b5068171c053 #(nop) ENTRYPOINT ["nginx" "-g" … 0B
    fe63b2d4c95d #(nop) COPY file:6edadf5af999cacd… 3.51kB
    843b47a96c5e yum -y install nginx 214MB
    2fe5a7f8c007 yum -y install epel-release 99.5MB
    75835a67d134 #(nop) CMD ["/bin/bash"] 0B
    #(nop) LABEL org.label-schema.sc… 0B
    #(nop) ADD file:fbe9badfd2790f074… 200MB
    75835a67d134
    2fe5a7f8c007
    843b47a96c5e
    fe63b2d4c95d
    b5068171c053
    sample-image

    View full-size slide

  37. Docker
    page
    038


    • Read Write
    • Read Only

    View full-size slide



  38. page
    039
    5: ENTRYPOINT [”/usr/sbin/nginx", "-g",
    "daemon off;"]
    4: COPY nginx.conf /etc/nginx/
    3: RUN yum -y install nginx
    2: RUN yum -y install epel-release
    1: FROM centos:7

    View full-size slide



  39. page
    040
    5: ENTRYPOINT [”/usr/sbin/nginx",
    "-g", "daemon off;"]
    5: ENTRYPOINT [”nginx",
    "-g", "daemon off;"]



    View full-size slide

  40. moby/buildkit – =+/ “docker build”
    page
    041
    • DAG;I1-KDGLLB?,37B
    • "') '4?9,37B
    • (&
    $%4?.A
    • JFE!'624?.A
    • root• :53007BH8
    • NTT SIC M@>5#(
    • Nmoby/moby, containerd/containerd#(O
    Ref: https://www.slideshare.net/AkihiroSuda/buildkit

    View full-size slide

  41. DockerfileDocker Image
    page
    042
    FROM sample-image:latest
    RUN yum –y install telnet

    !"
    • )(#' &%!!$

    View full-size slide

  42. Container

    page
    043
    • . #
    740 %/.
    • . #+/&-"8 B35@
    • 7/$/(" DC B35@
    • 12 factor app)!',
    =:A
    • 6 *
    • 912
    • >;

    View full-size slide

  43. Agenda
    page
    044
    • Cloud Native and Kubernetes
    • Container and Docker
    • Microservice and Service Mesh
    • Kubernetes
    • Kubernetes & Workloads
    • Kubernetes & Networking
    • Kubernetes is Distributed system
    • Extends Kubernetes
    • Other topics for Kubernetes

    View full-size slide

  44. Microservice and Service Mesh
    Benefit of Microservice and Service Mesh






    View full-size slide

  45. Microservice Architecture
    page
    046


    ProductPage Reviews
    Details
    Ratings
    HTTP/gRPC
    HTTP/gRPC
    HTTP/gRPC

    View full-size slide

  46. page
    047
    500+ microservices
    The Case of Chaos, Bruce Wong, 2014-12-19, (https://www.slideshare.net/BruceWong3/the-case-for-chaos)
    The History of the Service Mesh, The New Stack, 2018-2-13, (https://thenewstack.io/history-service-mesh/)

    View full-size slide

  47. %' )#!D@X_71T
    gRPC, REST N%' )#!cS
    2 )#!@X_7UJ<f
    "$'9A
    : CT/*"$'1T
    f^=eO4;
    6YBbK-^
    2`aG7%' )#!bK,+?M
    CT\-E[L

    !)&(9A
    G7CT!)&( .IV
    d8,+F0

    G7CTd8Z 53
    R]
    H> )#!PQW
    Benefit of
    Microservice
    Golang
    Java
    Scala
    gRPC
    REST

    View full-size slide

  48. %' )#!D@X_71T
    gRPC, REST N%' )#!cS
    2 )#!@X_7UJ<f
    "$'9A
    : CT/*"$'1T
    f^=eO4;
    6YBbK-^
    2`aG7%' )#!bK,+?M
    CT\-E[L

    !)&(9A
    G7CT!)&( .IV
    d8,+F0

    G7CTd8Z 53
    R]
    H> )#!PQW
    Developer
    Benefit of
    Microservice

    View full-size slide

  49. %' )#!D@X_71T
    gRPC, REST N%' )#!cS
    2 )#!@X_7UJ<f
    "$'9A
    : CT/*"$'1T
    f^=eO4;
    6YBbK-^
    2`aG7%' )#!bK,+?M
    CT\-E[L

    !)&(9A
    G7CT!)&( .IV
    d8,+F0

    G7CTd8Z 53
    R]
    H> )#!PQW
    Benefit of
    Microservice

    View full-size slide

  50. %' )#!D@X_71T
    gRPC, REST N%' )#!cS
    2 )#!@X_7UJ<f
    "$'9A
    : CT/*"$'1T
    f^=eO4;
    6YBbK-^
    2`aG7%' )#!bK,+?M
    CT\-E[L

    !)&(9A
    G7CT!)&( .IV
    d8,+F0

    G7CTd8Z 53
    R]
    H> )#!PQW
    Benefit of
    Microservice

    View full-size slide

  51. %' )#!D@X_71T
    gRPC, REST N%' )#!cS
    2 )#!@X_7UJ<f
    "$'9A
    : CT/*"$'1T
    f^=eO4;
    6YBbK-^
    2`aG7%' )#!bK,+?M
    CT\-E[L

    !)&(9A
    G7CT!)&( .IV
    d8,+F0

    G7CTd8Z 53
    R]
    H> )#!PQW
    Benefit of
    Microservice

    View full-size slide

  52. page
    053
    Can we get Observability?
    The Case of Chaos, Bruce Wong, 2014-12-19, (https://www.slideshare.net/BruceWong3/the-case-for-chaos)
    The History of the Service Mesh, The New Stack, 2018-2-13, (https://thenewstack.io/history-service-mesh/)

    View full-size slide

  53. Service Mesh Architecture (generally)
    page
    054
    • Microservice
    • Microservice with Service Mesh (for Observability)

    View full-size slide

  54. Service Mesh
    page
    055
    • Microservice

    • Traffic Shifting (ex, Canary release)
    • Circuit Break
    • Fault Injection
    • Rate Limit
    • Retry
    • mTLS

    View full-size slide

  55. Canary Release
    page
    056

    View full-size slide

  56. Microservice / Service Mesh

    page
    057
    • Microservice
    2J=:OC*@0$
    • 5R49,-HS#!"Q3T
    • MicroserviceP-K>8D%
    • MicroserviceP• mTLS
    N&FL;.,
    • BG/
    • 7')
    • EA
    • -K>
    • 1? I+,

    View full-size slide

  57. Agenda
    page
    058
    • Cloud Native and Kubernetes
    • Container and Docker
    • Microservice and Service Mesh
    • Kubernetes
    • Kubernetes & Workloads
    • Kubernetes & Networking
    • Kubernetes is Distributed system
    • Extends Kubernetes
    • Other topics for Kubernetes

    View full-size slide

  58. Kubernetes Overview
    Promote Cloud Native






    View full-size slide

  59. Kubernetes


    page
    060
    Design Principles, Kubernetes Community, 2017-11-04
    (https://github.com/kubernetes/community/blob/master/contributors/design-proposals/architecture/principles.md)
    01 Declarative Code & API
    Manifests API
    Infrastructure as Code

    View full-size slide

  60. Declarative Code & API
    page
    061
    Master
    Worker Worker Worker
    Register
    Declarative Manifest
    to API Server
    client

    View full-size slide

  61. Kubernetes
    page
    062
    Design Principles, Kubernetes Community, 2017-11-04
    (https://github.com/kubernetes/community/blob/master/contributors/design-proposals/architecture/principles.md)
    02
    03
    01
    Self Healing

    ) #"

    Automation & Immutable Infrastructure
    Immutable Infrastructure& #
    Declarative Code & API
    Manifests$"
    %'API
    !(
    Infrastructure as Code

    View full-size slide

  62. Agenda
    page
    063
    • Cloud Native and Kubernetes
    • Container and Docker
    • Microservice and Service Mesh
    • Kubernetes
    • Kubernetes & Workloads
    • Kubernetes & Networking
    • Kubernetes is Distributed system
    • Extends Kubernetes
    • Other topics for Kubernetes

    View full-size slide

  63. Kubernetes & Workloads
    Running Container

    View full-size slide

  64. Workloads
    page
    065

    Workloads
    Deployment
    ReplicaSet ReplicaSet
    Pod Pod Pod Pod Pod
    Deployment
    ReplicaSet
    Pod

    View full-size slide

  65. Pod
    page
    066
    • Kubernetes "
    • 1 #! $ Node
    Scheduling%
    • PodIP Address $PortBind%
    Deployment
    ReplicaSet
    Pod

    View full-size slide

  66. Pod Linux Namespace
    page
    067
    • PodLinux Namespace Container
    • PID
    K8s 1.12

    net
    user
    ipc
    pid
    mnt
    uts

    View full-size slide

  67. Container Design Pattern
    page
    068
    Design patterns for container-based distributed systems
    Brendan Burns, David Oppenheimer (Google)
    8th USENIX Workshop on Hot Topics in Cloud Computing (HotCloud '16)
    (https://www.usenix.org/system/files/conference/hotcloud16/hotcloud16_burns.pdf)
    • Pod

    • Sidecar pattern
    • Ambassador pattern
    • Adaptor pattern

    View full-size slide

  68. Sidecar pattern
    page
    069



    View full-size slide

  69. Ambassador Pattern
    page
    070
    • "
    #
    !

    View full-size slide

  70. Adaptor pattern
    page
    071
    • !$
    "
    #

    View full-size slide

  71. ReplicaSet
    page
    072
    • Pod
    Pod
    Deployment
    ReplicaSet
    Pod

    View full-size slide

  72. PodReplicaSet

    • Pod

    View full-size slide

  73. ReplicaSet Self-Healing
    page
    075
    • ReplicaSet PodReplica

    • = NodePod Node

    View full-size slide

  74. SchedulingPod

    page
    076

    1. Node Affinity / Node Anti-affinity
    2. Pod Affinity / Pod Anti-affinity
    3. Taints / Tolerations

    View full-size slide

  75. Node Affinnity / Node Anti-affinity
    page
    077
    • Node

    View full-size slide

  76. Inter-pod Affinity / Inter-pod Anti-Affinity
    page
    078
    • Pod Pod

    View full-size slide

  77. Taints / Tolerations
    page
    079
    • PodNode
    Node PodReject

    View full-size slide

  78. Deployment
    • ReplicaSet

    page
    080
    Deployment
    ReplicaSet
    Pod

    View full-size slide

  79. Deployment Rolling Update
    page
    081

    View full-size slide

  80. Deployment Rollback
    page
    082

    View full-size slide

  81. ReplicaSet
    page
    083

    View full-size slide


  82. Workloads"(
    page
    084
    DaemonSet:
    StatefulSet:
    Job:
    CronJob:
    Node
    1Pod'
    !%* Pod'
    #$&Pod'
    )Pod'

    View full-size slide

  83. Cloud Native
    '
    %

    page
    085
    !$()Persistent Volume*
    / &#")Secret / ConfigMap*

    #"

    View full-size slide

  84. Agenda
    page
    086
    • Cloud Native and Kubernetes
    • Container and Docker
    • Microservice and Service Mesh
    • Kubernetes
    • Kubernetes & Workloads
    • Kubernetes & Networking
    • Kubernetes is Distributed system
    • Extends Kubernetes
    • Other topics for Kubernetes

    View full-size slide

  85. Kubernetes & Networking
    Connect to container

    View full-size slide

  86. Kubernetes Network
    page
    088
    • External Network Pod

    • Internal Network
    NodePod CNI

    View full-size slide

  87. Service
    page
    089
    Service



    Load Balancing
    Service Discovery

    View full-size slide

  88. Load Balancingtype: ClusterIP
    page
    090

    View full-size slide

  89. Load Balancingtype: LoadBalancer
    page
    091

    View full-size slide

  90. Load Balancing
    page
    092

    View full-size slide

  91. Balancingkube-proxyproxy-mode
    page
    093
    1. userspace
    • Userspace kube-proxy

    2. iptables
    • iptables

    • kube-proxyiptables
    3. ipvs
    • ipvs

    • kube-proxyipvs

    View full-size slide

  92. page
    094
    Service Discovery
    • Service Discovery
    IP

    View full-size slide

  93. page
    095
    Service Discovery
    • Kubernetes DNS
    Service Object DNS "
    resolv.conf#search$
    !
    SERVICE.NAMESPACE.svc.cluster.local

    View full-size slide

  94. Ingress
    page
    096

    Service L4 LoadBalancing
    • Ingress L7 LoadBalancing

    View full-size slide

  95. Pod Native Network
    page
    097
    • 2LoadBalancing

    View full-size slide

  96. Pod Network Policy
    page
    098

    Pod

    • Network Policy Node iptables

    View full-size slide

  97. Kubernetes Network )96%&
    page
    099
    *14#/!Kubernetes 3 -5
    ".2+(
    • Rolling Update0NodeLB,1'Rolling Update
    7

    • 8$0LB8$

    View full-size slide

  98. Agenda
    page
    0101
    • Cloud Native and Kubernetes
    • Container and Docker
    • Microservice and Service Mesh
    • Kubernetes
    • Kubernetes & Workloads
    • Kubernetes & Networking
    • Kubernetes is Distributed system
    • Extends Kubernetes
    • Other topics for Kubernetes

    View full-size slide

  99. Kubernetes is Distributed System
    Kubernetes architecture deep dive

    View full-size slide

  100. Manifest (Declarative Code)
    • '$(*YAML

    • KubernetesAPI Object%"#
    • ! &
    nginx 3)

    View full-size slide

  101. Overview of Kubernetes Architecture
    page
    0104
    kube-apiserver
    kubelet kubelet kubelet
    etcd
    client
    Manifest API Object
    Register API Object
    via REST API
    Store API Object
    kube-scheduler
    kube-controller-
    manager
    kube-proxy kube-proxy kube-proxy

    View full-size slide

  102. API Object (also Declarative)
    page
    0105
    curl https://kubernetes/apis/extensions/v1beta1/namespaces/default
    /replicasets/sample-rs
    --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)”
    {
    "kind": ”RepicaSets",
    "apiVersion": "extensions/v1beta1",
    "metadata": {
    "name": "sample-rs",
    "namespace": "default",
    "selfLink": "/apis/extensions/v1beta1/namespaces/default/replicasets/sample-rs",
    "uid": "f10cdd9e-f249-11e8-9dde-42010a92013a",
    "resourceVersion": "5004593",
    ...

    View full-size slide

  103. Flow of ReplicaSet
    page
    0106
    kube-apiserver
    apiVersion: apps/v1
    kind: ReplicaSet
    metadata:
    name: sample-rs
    spec:
    replicas: 3

    etcd
    apiVersion: apps/v1
    kind: ReplicaSet
    metadata:
    name: sample-rs
    spec:
    replicas: 3

    client
    Manifest
    Register
    ReplicaSet Object

    View full-size slide

  104. Flow of ReplicaSet
    page
    0107
    kube-apiserver
    kube-controller-
    manager
    Detect
    ReplicaSet Object
    Observe
    Diff
    Act
    control
    loop
    apiVersion: apps/v1
    kind: ReplicaSet
    metadata:
    name: sample-rs
    spec:
    replicas: 3

    etcd

    View full-size slide

  105. Flow of ReplicaSet
    page
    0108
    kube-apiserver
    kube-controller-
    manager
    Register
    3 Pod Object
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx

    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx

    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx

    Observe
    Diff
    Act
    control
    loop
    apiVersion: apps/v1
    kind: ReplicaSet
    metadata:
    name: sample-rs
    spec:
    replicas: 3

    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “nodeA”

    status:
    phase: “Pending”
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “nodeA”

    status:
    phase: “Pending”
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “”

    status:
    phase: “Pending”
    etcd

    View full-size slide

  106. Flow of ReplicaSet
    page
    0109
    kube-apiserver
    apiVersion: apps/v1
    kind: ReplicaSet
    metadata:
    name: sample-rs
    spec:
    replicas: 3

    Detect
    Pod Object
    kube-scheduler
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “nodeA”

    status:
    phase: “Pending”
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “nodeA”

    status:
    phase: “Pending”
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “”

    status:
    phase: “Pending”
    etcd

    View full-size slide

  107. Flow of ReplicaSet
    page
    0110
    kube-apiserver
    apiVersion: apps/v1
    kind: ReplicaSet
    metadata:
    name: sample-rs
    spec:
    replicas: 3

    Scheduling Pod
    to some Node
    kube-scheduler
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “nodeA”

    status:
    phase: “Pending”
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “nodeA”

    status:
    phase: “Pending”
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “nodeA”

    status:
    phase: “Pending”
    etcd

    View full-size slide

  108. Flow of ReplicaSet
    page
    0111
    kube-apiserver
    apiVersion: apps/v1
    kind: ReplicaSet
    metadata:
    name: sample-rs
    spec:
    replicas: 3

    Detect
    Not running Pod
    kubelet
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “nodeA”

    status:
    phase: “Pending”
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “nodeA”

    status:
    phase: “Pending”
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “nodeA”

    status:
    phase: “Pending”
    etcd

    View full-size slide

  109. Flow of ReplicaSet
    page
    0112
    kube-apiserver
    apiVersion: apps/v1
    kind: ReplicaSet
    metadata:
    name: sample-rs
    spec:
    replicas: 3

    kubelet
    Container
    Runtime
    (Docker)
    Create pod
    (container)
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “nodeA”

    status:
    phase: “Pending”
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “nodeA”

    status:
    phase: “Pending”
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “nodeA”

    status:
    phase: “Pending”
    etcd

    View full-size slide

  110. Flow of ReplicaSet
    page
    0113
    kube-apiserver
    apiVersion: apps/v1
    kind: ReplicaSet
    metadata:
    name: sample-rs
    spec:
    replicas: 3

    Update
    status.phase
    Pending > Running
    kubelet
    Container
    Runtime
    (Docker)
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “nodeA”

    status:
    phase: “Pending”
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “nodeA”

    status:
    phase: “Pending”
    apiVersion: apps/v1
    kind: Pod
    metadata:
    name: sample-rs-xxxxx
    spec:
    nodeName: “nodeA”

    status:
    phase: “Running”
    etcd

    View full-size slide

  111. Agenda
    page
    0114
    • Cloud Native and Kubernetes
    • Container and Docker
    • Microservice and Service Mesh
    • Kubernetes
    • Kubernetes & Workloads
    • Kubernetes & Networking
    • Kubernetes is Distributed system
    • Extends Kubernetes
    • Other topics for Kubernetes

    View full-size slide

  112. Extends Kubernetes
    Kubernetes is becoming the framework

    View full-size slide

  113. XaaS on Kubernetes
    page
    0116
    (Ceph) as a Service
    Rook
    MySQL as a Service
    Vitess
    Queue as a Service
    NATS
    ML as a Service
    Kubeflow
    • NTT SIC

    kubeflow/katib
    • docker/infrakit

    View full-size slide

  114. Queue as a Service
    Developer
    Kubernetes
    Register
    NatsCluster Object
    NATS
    Operator
    Detect Object
    Deploy Queue cluster
    Change
    Management
    Watch objects
    Kubernetes

    Kubernetes
    Observe
    Diff
    Act
    control
    loop

    View full-size slide

  115. CustomResourceDefinition Operator
    page
    0118
    CustomResourceDefinition
    '+$
    "!! "#*
    Operator
    " "!
    )(
    ! "
    apiVersion: db.io/v1
    kind: MyDB
    metadata:
    name: sample-db
    spec:
    size: 10G
    type: mysql
    version: 5.6

    DB%&)(
    Observe
    Diff
    Act
    control
    loop

    View full-size slide

  116. Service Catalog
    page
    0119
    Service Broker
    Open Service Broker API
    Create Managed
    Service Instance

    View full-size slide


  117. page
    0120
    Model and Operate Datacenter by Kubernetes at eBay - Xiaogang Xin
    & Tommy Mei, eBay, 2018-11-15, (https://sched.co/FuKD)
    • Datacenter Kubernetes Kubernetes

    View full-size slide

  118. Agenda
    page
    0121
    • Cloud Native and Kubernetes
    • Container and Docker
    • Microservice and Service Mesh
    • Kubernetes
    • Kubernetes & Workloads
    • Kubernetes & Networking
    • Kubernetes is Distributed system
    • Extends Kubernetes
    • Other topics for Kubernetes

    View full-size slide

  119. Other topics for Kubernetes
    Kubernetes is widespread in the world

    View full-size slide

  120. page
    0123
    CNCFStandardization
    01.





    " (!)
    OCI v1.0 02.


    #

    CRI 03.

    #

    CSI 04.

    #

    CNI

    View full-size slide

  121. Serverless Cloud Native Landscape by CNCF
    page
    0124

    View full-size slide

  122. Conclusion
    page
    0122
    Cloud Native
    Container / Microservice / Service Mesh'1Cloud Native
    4+2
    &(
    Kubernetes-$0Cloud Native4+


    Kubernetes Google 3# /.4+ )
    !*, Platform 5"%

    View full-size slide

  123. 3 I H uNs P
    /D 6 IBK c a io sy P
    0 C 1 DD 3 I H
    W3 I HS M
    3 I H
    & 72 uNs C ID
    9 CD H uNs
    0BH K L 4 uNs
    / B 8I uNs
    /D HI uNs 5 I I uNs
    uNs N snN
    s h l o y f fl
    y s N
    snr N
    tk ye
    & hs c N uNsu ghd
    v
    o y
    /2 /0
    fl N s 8 KB 5 HA
    3 I H dNkyl
    3 I H b

    View full-size slide

  124. Thank you for your attention
    follow me: @amsy810

    View full-size slide