Docker & Kubernetes Intro

What is Docker

Docker is the world’s leading software containerization platform

Container VS VMs

Containers and virtual machines have similar resource isolation and allocation benefits – but a different architectural approach allows containers to be more portable and efficient.

docker

Orchestration Tools

Why Need Orchestration

Orchestration : 本意是是指管弦乐中的配器法。

管弦乐

一场大型的交响乐的表演,需要众多乐手,比如小提琴手,鼓手,小号等等,但是更重要的是需要有一名出色的指挥。

一个大型的互联网应用,需要各式各样的服务器,比如缓存服务器,应用服务器,数据库服务器,负载均衡服务器等等,协同工作。当这里的‘服务器’精简成一个个的container, 为了更高效,更优雅的协同工作,同样需要有一名出色的指挥。Orchestration Tool就是这个Container乐团的指挥。

网站架构图

Why Kubernetes

Three Popular Orchestration

候选 优点 缺点
Swarm Docker Native Support. 设计比较简单,作为编排工具还不够产品级,还需要一段时间的发展
Mesos 已经成熟,文档齐全 无明显缺点,如果非要挑一个,那就是设计理念不如k8s优秀,社区支撑不如k8s强大。
Kubernetes 基于borg(被验证的大规模集群管理技术,google出品),社区强大,设计理念优秀,与容器技术结合紧密,为业界所看好,被认为是未来的容器编排技术的主流。 学习曲线比较陡峭,文档质量偏低

结合米喜的实际情况,我们选择了Kubernetes作为编排工具。详细的技术选型过程参加:内网资料:部署环境改造技术选型

另外,说Kubernetes文档质量低不是随便讲讲的:

论k8s文档写的有多烂

Kubernetes Concept Guide

  • Cluster : A cluster is a set of physical or virtual machines and other infrastructure resources used by Kubernetes to run your applications.
  • Node : A node is a physical or virtual machine running Kubernetes, onto which pods can be scheduled.

  • Kubectl : command-line interface to interact with Kubernetes.

  • Pod : the smallest deployable units of computing that can be created and managed in Kubernetes.A group of one or more containers is called a pod.
  • Volume : just a directory, possibly with some data in it, which is accessible to the containers in a pod.
  • Labels : key-value pairs.
  • Deployments : A Deployment object defines a Pod creation template and desired replica count.
  • Service : A service defines a set of pods and a means by which to access them, such as single stable IP address and corresponding DNS name.
  • More

TODO For Medishare

  • 基于k8s的部署

基于k8s米喜架构

  • CI & CD

趋势科技持续部署方案

Reference

SlideShare

https://drive.google.com/file/d/0Bx57XsAahdV4NWdDRHdvcC1SdTQ/view