SlideShare a Scribd company logo
Kubernetes入门培训
扫码关注“云原生技术爱好者社区”获取更多消息
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
目录
• docker和docker-compose回顾
• 什么是Kubernetes
• Kubernetes架构
• Kubernetes核心概念
• Kubernetes小试牛刀
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
docker 和 docker-compose回顾
Docker是基于操作系统的沙盒技术,使得用户更简单和完整
的去打包自己的应用。
Docker-compose是一个单节点编排技术。
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
什么是Kubernetes?
• 工业级容器编排平台,主要提供服务的部署、弹性、管理
• Kubernetes源于希腊语,中文意思“舵手”或者“飞行员”
• k8s,省略中间8个ubernete替换为8,而得来k8s
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
Kubernetes核心功能点
自动化的容器编排平台功能有哪些? • 服务发现和负载均衡
• 服务自动装箱
• 容器存储编排
• 容器故障恢复
• 自动发布和回滚
• 配置和密钥存储
• 服务水平伸缩
• 任务批量执行
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
举例介绍kubernetes能力
• 调度
• 故障排除
• 配置
• 水平扩展
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
Kubernetes - 调度
正在调度
调度完成
等待调度
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
Kubernetes
Kubernetes – 故障恢复
节点控制器
节点不可用
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
Kubernetes – 配置管理
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
Kubernetes – 水平伸缩
Kubernetes
Kubernetes –
业务负载检查
负载过高
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
Kubernetes架构
Master
UI CLI
Node Node Node Node Node Node
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
Kubernetes架构介绍
• master
• Node
• Pod在kubernetes架构执行步骤
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
Kubernetes架构-master
API Server Controller Scheduler
Etcd
命令行 UI
Node
Node
Node
Node
Node
Node
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
Kubernetes架构-node
Node
Kubelet
Container
RunTime
Storage
Plugin
Network
Plugin
Kube-proxy
Pod
Pod
Pod
Pod
Pod
Pod
Pod
Master
ui CLI
Node
Node
Node
Node
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
Pod在Kubernetes架构执行过程
POD API Server
ETCD
Scheduler API Server
ETCD
Kubelet
Container
Runtime
watch watch
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
核心概念介绍
• Pod
• Deployment&ReplicaSet
• Volume
• Service
• NameSpaces
• API
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
Pod
• 最小调度以及资源单位
• 包含一个或者多个容器
• 定义容器运行时方式(命令和环境
变量)
• 提供给容器共享的运行环境(网络
和进程空间)
Pod
容器1
容器2
1 core 1G
1 core 0.5G
volume1
volume2
100G
50G
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
Deployment
• 定义pod副本数量、版本等
• 通过ReplicaSet控制pod数量(自动
重启失败的pod)
• 按照指定策略控制版本 (版本升级、
回滚、重新生成)
Pod
Deployment
Pod
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
Volume
• Pod中一个或者多个容器可以访问的
目录
• 支持多种存储的抽象 本地存储、分
布式存储、云存储
Pod
Volume
存储
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
Service
• 提供访问多个pod的稳定访问方式
(IP、域名、环境变量)
Pod
Pod
Deployment
Service
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
NameSpaces
• 一个集群内部逻辑隔离机制(鉴权
和资源分配);
• 每个资源都属于一个Namespace;
• 同一个Namespace命名唯一,不同
Namespace下允许存在相同的名称.
Pod
Pod
NameSpaces1
Pod
Pod
NameSpaces2
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
API - label
• 一组key:value对;
• 可以被select查询到;
• 资源默认的表达形式(比如Service
选择一组pod对外提供服务)。
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
Nginx演示
1:提交一个nginx Deployment
kubectl apply –f nginx.yaml
2: 升级nginx Deployment
kubectl apply –f nginx-update.yaml
3: 扩容nginx Deployment
Kubectl apply –f nginx-scale.yaml
微信搜索 “云原生技术爱好者社区” 公众号获取更多消息
Ad

More Related Content

What's hot (20)

Introduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageIntroduction to Docker storage, volume and image
Introduction to Docker storage, volume and image
ejlp12
 
Containerization & Docker - Under the Hood
Containerization & Docker - Under the HoodContainerization & Docker - Under the Hood
Containerization & Docker - Under the Hood
Imesha Sudasingha
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Aditya Konarde
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Peng Xiao
 
Docker Container Security - A Network View
Docker Container Security - A Network ViewDocker Container Security - A Network View
Docker Container Security - A Network View
NeuVector
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
Eueung Mulyana
 
Containers: The What, Why, and How
Containers: The What, Why, and HowContainers: The What, Why, and How
Containers: The What, Why, and How
Sneha Inguva
 
Understanding docker networking
Understanding docker networkingUnderstanding docker networking
Understanding docker networking
Lorenzo Fontana
 
Introduction to Docker Compose
Introduction to Docker ComposeIntroduction to Docker Compose
Introduction to Docker Compose
Ajeet Singh Raina
 
Introduction to Docker Compose | Docker Intermediate Workshop
Introduction to Docker Compose | Docker Intermediate WorkshopIntroduction to Docker Compose | Docker Intermediate Workshop
Introduction to Docker Compose | Docker Intermediate Workshop
Ajeet Singh Raina
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
Instruqt
 
Kubernetes
KubernetesKubernetes
Kubernetes
Meng-Ze Lee
 
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Simplilearn
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to Kubernetes
Imesh Gunaratne
 
Dockers and containers basics
Dockers and containers basicsDockers and containers basics
Dockers and containers basics
Sourabh Saxena
 
A brief study on Kubernetes and its components
A brief study on Kubernetes and its componentsA brief study on Kubernetes and its components
A brief study on Kubernetes and its components
Ramit Surana
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
Crevise Technologies
 
Containers and Docker
Containers and DockerContainers and Docker
Containers and Docker
Damian T. Gordon
 
Hardening Kubernetes by Securing Pods
Hardening Kubernetes by Securing PodsHardening Kubernetes by Securing Pods
Hardening Kubernetes by Securing Pods
Suraj Deshmukh
 
Introduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageIntroduction to Docker storage, volume and image
Introduction to Docker storage, volume and image
ejlp12
 
Containerization & Docker - Under the Hood
Containerization & Docker - Under the HoodContainerization & Docker - Under the Hood
Containerization & Docker - Under the Hood
Imesha Sudasingha
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Aditya Konarde
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Peng Xiao
 
Docker Container Security - A Network View
Docker Container Security - A Network ViewDocker Container Security - A Network View
Docker Container Security - A Network View
NeuVector
 
Containers: The What, Why, and How
Containers: The What, Why, and HowContainers: The What, Why, and How
Containers: The What, Why, and How
Sneha Inguva
 
Understanding docker networking
Understanding docker networkingUnderstanding docker networking
Understanding docker networking
Lorenzo Fontana
 
Introduction to Docker Compose
Introduction to Docker ComposeIntroduction to Docker Compose
Introduction to Docker Compose
Ajeet Singh Raina
 
Introduction to Docker Compose | Docker Intermediate Workshop
Introduction to Docker Compose | Docker Intermediate WorkshopIntroduction to Docker Compose | Docker Intermediate Workshop
Introduction to Docker Compose | Docker Intermediate Workshop
Ajeet Singh Raina
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
Instruqt
 
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Simplilearn
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to Kubernetes
Imesh Gunaratne
 
Dockers and containers basics
Dockers and containers basicsDockers and containers basics
Dockers and containers basics
Sourabh Saxena
 
A brief study on Kubernetes and its components
A brief study on Kubernetes and its componentsA brief study on Kubernetes and its components
A brief study on Kubernetes and its components
Ramit Surana
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
Hardening Kubernetes by Securing Pods
Hardening Kubernetes by Securing PodsHardening Kubernetes by Securing Pods
Hardening Kubernetes by Securing Pods
Suraj Deshmukh
 

Similar to kubernetes入门培训 (20)

美团点评技术沙龙14美团云-Docker平台
美团点评技术沙龙14美团云-Docker平台美团点评技术沙龙14美团云-Docker平台
美团点评技术沙龙14美团云-Docker平台
美团点评技术团队
 
容器式基礎架構介紹
容器式基礎架構介紹容器式基礎架構介紹
容器式基礎架構介紹
Philip Zheng
 
Kubernetes (K8s) 簡介 | GDSC NYCU
Kubernetes (K8s) 簡介 | GDSC NYCUKubernetes (K8s) 簡介 | GDSC NYCU
Kubernetes (K8s) 簡介 | GDSC NYCU
秀吉(Hsiu-Chi) 蔡(Tsai)
 
3 introduction to kubernetes
3 introduction to kubernetes3 introduction to kubernetes
3 introduction to kubernetes
Jiang Shang
 
桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作
Philip Zheng
 
Docker實務
Docker實務Docker實務
Docker實務
國昭 張
 
Docker open stack
Docker open stackDocker open stack
Docker open stack
Guangya Liu
 
twMVC#30 | 你應該瞭解的 container-on-azure-二三事
twMVC#30 | 你應該瞭解的 container-on-azure-二三事twMVC#30 | 你應該瞭解的 container-on-azure-二三事
twMVC#30 | 你應該瞭解的 container-on-azure-二三事
twMVC
 
Azure Container Service 使用 DC / OS 管理 docker 容器
Azure Container Service 使用 DC / OS 管理 docker 容器Azure Container Service 使用 DC / OS 管理 docker 容器
Azure Container Service 使用 DC / OS 管理 docker 容器
Ch Rick
 
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
ChinaNetCloud
 
K8s removes dockershime
K8s removes dockershimeK8s removes dockershime
K8s removes dockershime
Philip Zheng
 
Azure Container Registry(preview)x Web App On Linux(preview)
Azure Container Registry(preview)x Web App On Linux(preview)Azure Container Registry(preview)x Web App On Linux(preview)
Azure Container Registry(preview)x Web App On Linux(preview)
Ch Rick
 
OpenStack and Docke Integration V6
OpenStack and Docke Integration V6OpenStack and Docke Integration V6
OpenStack and Docke Integration V6
Guangya Liu
 
企業導入容器經驗分享與開源技能培養
企業導入容器經驗分享與開源技能培養企業導入容器經驗分享與開源技能培養
企業導入容器經驗分享與開源技能培養
Philip Zheng
 
Docker 淺入淺出
Docker 淺入淺出Docker 淺入淺出
Docker 淺入淺出
Miles Chou
 
Docker - 30秒生出100台伺服器
Docker - 30秒生出100台伺服器Docker - 30秒生出100台伺服器
Docker - 30秒生出100台伺服器
升煌 黃
 
Windows Container 101: dotNET, Container, Kubernetes
Windows Container 101: dotNET, Container, KubernetesWindows Container 101: dotNET, Container, Kubernetes
Windows Container 101: dotNET, Container, Kubernetes
Will Huang
 
Docker 最佳实践
Docker 最佳实践Docker 最佳实践
Docker 最佳实践
YuLing Liu
 
Docker集群管理 工具篇
Docker集群管理 工具篇Docker集群管理 工具篇
Docker集群管理 工具篇
Guangya Liu
 
20220224台中演講k8s
20220224台中演講k8s20220224台中演講k8s
20220224台中演講k8s
chabateryuhlin
 
美团点评技术沙龙14美团云-Docker平台
美团点评技术沙龙14美团云-Docker平台美团点评技术沙龙14美团云-Docker平台
美团点评技术沙龙14美团云-Docker平台
美团点评技术团队
 
容器式基礎架構介紹
容器式基礎架構介紹容器式基礎架構介紹
容器式基礎架構介紹
Philip Zheng
 
3 introduction to kubernetes
3 introduction to kubernetes3 introduction to kubernetes
3 introduction to kubernetes
Jiang Shang
 
桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作
Philip Zheng
 
Docker open stack
Docker open stackDocker open stack
Docker open stack
Guangya Liu
 
twMVC#30 | 你應該瞭解的 container-on-azure-二三事
twMVC#30 | 你應該瞭解的 container-on-azure-二三事twMVC#30 | 你應該瞭解的 container-on-azure-二三事
twMVC#30 | 你應該瞭解的 container-on-azure-二三事
twMVC
 
Azure Container Service 使用 DC / OS 管理 docker 容器
Azure Container Service 使用 DC / OS 管理 docker 容器Azure Container Service 使用 DC / OS 管理 docker 容器
Azure Container Service 使用 DC / OS 管理 docker 容器
Ch Rick
 
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
ChinaNetCloud
 
K8s removes dockershime
K8s removes dockershimeK8s removes dockershime
K8s removes dockershime
Philip Zheng
 
Azure Container Registry(preview)x Web App On Linux(preview)
Azure Container Registry(preview)x Web App On Linux(preview)Azure Container Registry(preview)x Web App On Linux(preview)
Azure Container Registry(preview)x Web App On Linux(preview)
Ch Rick
 
OpenStack and Docke Integration V6
OpenStack and Docke Integration V6OpenStack and Docke Integration V6
OpenStack and Docke Integration V6
Guangya Liu
 
企業導入容器經驗分享與開源技能培養
企業導入容器經驗分享與開源技能培養企業導入容器經驗分享與開源技能培養
企業導入容器經驗分享與開源技能培養
Philip Zheng
 
Docker 淺入淺出
Docker 淺入淺出Docker 淺入淺出
Docker 淺入淺出
Miles Chou
 
Docker - 30秒生出100台伺服器
Docker - 30秒生出100台伺服器Docker - 30秒生出100台伺服器
Docker - 30秒生出100台伺服器
升煌 黃
 
Windows Container 101: dotNET, Container, Kubernetes
Windows Container 101: dotNET, Container, KubernetesWindows Container 101: dotNET, Container, Kubernetes
Windows Container 101: dotNET, Container, Kubernetes
Will Huang
 
Docker 最佳实践
Docker 最佳实践Docker 最佳实践
Docker 最佳实践
YuLing Liu
 
Docker集群管理 工具篇
Docker集群管理 工具篇Docker集群管理 工具篇
Docker集群管理 工具篇
Guangya Liu
 
20220224台中演講k8s
20220224台中演講k8s20220224台中演講k8s
20220224台中演講k8s
chabateryuhlin
 
Ad

kubernetes入门培训