Slide 1

Slide 1 text

Kubernets 技術應⽤用案例例 雲端智慧聯聯網尖端實驗室 Kyle bai R&D @ inwinSTACK www.inwinstack.com © 2017 Kyle Bai Theme. All Rights Reserved. kairen(kyle.b@inwinstack.com) https://kairen.github.io/

Slide 2

Slide 2 text

About Me Kyle Bai Job R&D(TAM) @ inwinSTACK Description 早期在校主要撰寫 java 與 objc 程式語⾔言,並專注於 Mobile 應⽤用程式開發,具備四年年開發經驗。次要研讀 Hadoop 與 Spark 資料運算框架,以及 Linux 相關技術。 ⼯工作期間則專注於 OpenStack、Ceph 與 Container 相關 等 Cloud Native 技術與開源專案,閒暇之餘會參參與相關專 案社區及貢獻,並利利⽤用部落落格、GitHub 與 GitBook 做筆 記。 Drink Coffee Mobile Love Good! #7727 Buttocks

Slide 3

Slide 3 text

Why Kubernetes? Why Choose Kubernetes to Manage Containerized? Use Cases for Kubernetes Kubernetes Architecture Other Use Case Introduction to Kubernetes Architecture. The Case for Kubernetes. Such as OpenStack, TensorFlow. Company use cases. Agenda Today we will talk about

Slide 4

Slide 4 text

Why Kubernetes? Why Choose Kubernetes to Manage Containerized?

Slide 5

Slide 5 text

Kubernetes Kubernetes 是 Google 開源的容器(Container)分散式管理理系 統,是 Google⼗十幾年年以來來⼤大規模應⽤用容器技術的經驗累積和昇 華的⼀一個重要成果,是建於 Container(OCI標準容器)之上的容器 叢集排程服務,簡稱為K8s( )。 ⽬目前為 CNCF 專案之⼀一。 Stars 25,830 Commits 52,905 Contributors 1,331 https://github.com/kubernetes/kubernetes/milestone/36

Slide 6

Slide 6 text

CNCF Landscape

Slide 7

Slide 7 text

CNCF Members

Slide 8

Slide 8 text

Kubernetes Growth

Slide 9

Slide 9 text

RightScale State of the Cloud Report

Slide 10

Slide 10 text

Adoption

Slide 11

Slide 11 text

Kubernetes Pros 資源監控 Monitoring 不中斷升級 Rolling-update ⾼高可靠性 High-availability ⾃自我修復 Self-healing 雲端⽀支援 Cloud Provider 持久性儲存 Persistent Volumes 組態檔案 Configmap 安全性 Secret Kubernetes 管理理跨區域與主機的容器節點,提供基本部署、維運、管 理理,以及執⾏行行各項應⽤用程式,並具備多種特性。

Slide 12

Slide 12 text

Microservices 微服務 (Microservices) 是⼀一種軟 體架構風格,它是以專注於單⼀一責 任與功能的⼩小型功能區塊 (Small Building Blocks) 為基礎,利利⽤用模組 化的⽅方式組合出複雜的⼤大型應⽤用程 式,各功能區塊使⽤用與語⾔言無關 (Language-Independent/Language agnostic) 的 API 集相互通訊。

Slide 13

Slide 13 text

Kubernetes Architecture Introduction to Kubernetes Architecture.

Slide 14

Slide 14 text

Kubernetes Architecture Kubernetes 屬於分散式架構系統,主要由兩兩種節點⾓角⾊色組成: • Masters – 主要⼯工作為提供 API 與管理理⼯工作節點,可視為主節點。 • Nodes(Minions) – 主要執⾏行行容器應⽤用的節點,上⾯面會執⾏行行許多容 器。

Slide 15

Slide 15 text

A Multi-Tier Application

Slide 16

Slide 16 text

Kubernetes Master Kubernetes Master 包含了了四個基本組件: • Etcd: 主要為 Kubernetes 的資訊儲存 與服務發現功能。 • API Server:以 REST APIs 介⾯面⽅方式提 供所有業務邏輯CURD操作。 • Controller Manager Server:所有其他 叢集級功能都是透過控制管理理器 (Controller Manager)來來操作。 • Scheduler:負責整個分散式系統的資源 排程。

Slide 17

Slide 17 text

Kubernetes Node(Minion) Kubernetes Node 包含了了三個基本組件: • Kubelet:負責管理理的映像檔、容器與資 料 Volume等操作。也是連接 Master 的橋樑。 • Proxy: 為了了解決外部網路路能夠群曲跨 機器叢集中容器提供的應⽤用服務⽽而設 計。⽀支援 TCP,UDP stream forwarding 或 round robin TCP,UDP forwarding。 • Container:基於 OCI Container Rutime 來來執⾏行行應⽤用程式容器實例例。

Slide 18

Slide 18 text

Kubernetes Container • CRI • Docker • rkt • frakti • cri-containerd • cri-o • virtlet • Infranetes

Slide 19

Slide 19 text

Kubernetes Network • Overlay / Underlay Network • CNI/CNM • Flannel • Calico • Weave • Kuryr • OpenContrail • OVN • Linen

Slide 20

Slide 20 text

Kubernetes Storage • CSI • Volumes • Persistent Volumes • Many Volume Plugin • Storage Class • External-storage • Dynamic Provisioning

Slide 21

Slide 21 text

Kubernetes - Pod Pod 是 K8s 中最⼩小的部署單位,可以將⼀一個或多個容器組成⼀一個 Pod,Pod 所包含的容器只會運⾏行行在同⼀一個 Host 上,並共享 network namespaces、IP port,每個 Pod的 network mapping 都是由 container pause 所封裝處理理的。

Slide 22

Slide 22 text

Kubernetes - Deployments Deployments(Replication C o n t r o l l e r s ) 是 部 署 群 組 Pods,其會確保 K8s 系統中 指定數量量副本的 Pod 存活, 也可以利利⽤用 Label 及 Rolling update 來來進⾏行行副本的擴展或 更更新。

Slide 23

Slide 23 text

Kubernetes - Service Service 是 pod 服務的抽象層, 具有簡單負載平衡的功能,由於 pod 的數量量與IP 不會固定,可將 ⼀一群 pod指派成 service 並給予 ⼀一個固定IP (cluster IP),service 會將請求⾄至 cluster IP 的流量量導 入其對應 pod。

Slide 24

Slide 24 text

Kubernetes - Resources

Slide 25

Slide 25 text

Use Cases for Kubernetes The Case for Kubernetes. Such as OpenStack, TensorFlow.

Slide 26

Slide 26 text

TF integrated with K8s Step1: Package Workers & Parameters general code into Docker images. Step2: Create the clusters according to TensorFlow’s cluster spec into ConfigMap. Step3: Define the cluster Deployment and Service,…, etc to run. https://github.com/tensorflow/ecosystem

Slide 27

Slide 27 text

Example cluster spec

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

Distributed TensorFlow workflow We need shell script..? Or Ansible…?

Slide 31

Slide 31 text

K8s is a good choice

Slide 32

Slide 32 text

TensorFlow Serving on K8s

Slide 33

Slide 33 text

Full Distributed on K8s

Slide 34

Slide 34 text

K8s and the DCOS - friends or foes?

Slide 35

Slide 35 text

Spark + Mesos integrated with K8s

Slide 36

Slide 36 text

Spark on K8s https://github.com/kubernetes/examples/tree/master/staging/spark

Slide 37

Slide 37 text

Ethereum on K8s https://github.com/kairen/kubereum

Slide 38

Slide 38 text

Kubernetes Underlay of OpenStack Open Hybrid Kubernetes + OpenStack Helm Deployment using Community Automation

Slide 39

Slide 39 text

Sample OpenStack Nova service

Slide 40

Slide 40 text

K8s Node as OpenStack Controller

Slide 41

Slide 41 text

K8s Node as OpenStack Compute

Slide 42

Slide 42 text

The Infrastructure Sandwich

Slide 43

Slide 43 text

The Infrastructure Sandwich • Bare metal、Virtual machine and Container. • Auto-scale the Kubernetes Cluster. • Helm-based Application deployment on Kubernetes. • Multi-tenant environment. • Manage multi Kubernetes cluster. Manage application Kubernetes Manage infrastructure Kubernetes Provide service OpenStack,…,etc

Slide 44

Slide 44 text

HA Surveillance on K8s

Slide 45

Slide 45 text

IoT Cloud Platform Architecture

Slide 46

Slide 46 text

Other Use Case Company use cases.

Slide 47

Slide 47 text

How JD.com Moved to Kubernetes from OpenStack

Slide 48

Slide 48 text

How We Architected and Run Kubernetes on OpenStack at Scale at Yahoo! JAPAN

Slide 49

Slide 49 text

Distribution Centers With OneOps, Jenkins, Nexus and Kubernetes

Slide 50

Slide 50 text

TCP Cloud - Smart Conference at OpenStack Summit Austin

Slide 51

Slide 51 text

TCP Cloud - Smart Conference at OpenStack Summit Austin

Slide 52

Slide 52 text

Call to Action • 輕量量化⽅方式有助於促進更更多的貢獻。 • 需要更更多的核⼼心多樣性 (Across the community)。 • 結合 OpenStack 與 Kubernetes 社區⼀一起進⾏行行。 • Roadmap that can be publicly shared!!! • Community IRC Meetings: [Every Tuesday @ 3PM UTC], #openstack- meeting-5 on freenode. • OpenStack Helm Doc,https://docs.openstack.org/developer/openstack-helm • Project URL in GitHub,https://github.com/openstack/openstack-helm/ • OpenStack-helm Slack,http://slack.k8s.io/,#openstack-helm • OpenStack-helm launchpad,https://launchpad.net/openstack-helm • Community Meeting Agenda,https://etherpad.openstack.org/p/openstack- helm-meeting-agenda

Slide 53

Slide 53 text

53 有任何問題與想法,可以⼀一起討論唷。 Thank You!!