Kubernetes(K8S)集群管理Docker容器(概念篇)

Kubernetes是Google在2014年6月开源的一个容器集群管理系统,使用Go语言开发,Kubernetes也叫K8S。

K8S是Google内部一个叫Borg的容器集群管理系统衍生出来的,Borg已经在Google大规模生产运行十年之久。

K8S主要用于自动化部署、扩展和管理容器应用,提供了资源调度、部署管理、服务发现、扩容缩容、监控等一整套功能。

2015年7月,Kubernetes v1.0正式发布,截止到2017年9月29日最新稳定版本是v1.8。

Kubernetes目标是让部署容器化应用简单高效。

官方网站:www.kubernetes.io

                               Kubernetes主要功能:

数据卷

Pod中容器之间共享数据,可以使用数据卷。

应用程序健康检查

容器内服务可能进程堵塞无法处理请求,可以设置监控检查策略保证应用健壮性。

复制应用程序实例

控制器维护着Pod副本数量,保证一个Pod或一组同类的Pod数量始终可用。

弹性伸缩

根据设定的指标(CPU利用率)自动缩放Pod副本数。

服务发现

使用环境变量或DNS服务插件保证容器中程序发现Pod入口访问地址。

负载均衡

一组Pod副本分配一个私有的集群IP地址,负载均衡转发请求到后端容器。在集群内部其他Pod可通过这个ClusterIP访问应   用。

滚动更新

更新服务不中断,一次更新一个Pod,而不是同时删除整个服务。

服务编排

通过文件描述部署服务,使得应用程序部署变得更高效。

资源监控

Node节点组件集成cAdvisor资源收集工具,可通过Heapster汇总整个集群节点资源数据,然后存储到InfluxDB时序数据库,    再由Grafana展示。

提供认证和授权

支持属性访问控制(ABAC)、角色访问控制(RBAC)认证授权策略。

                                      基本对象概念

基本对象:

Pod

Pod是最小部署单元,一个Pod有一个或多个容器组成,Pod中容器共享存储和网络,在同一台Docker主机上运行。

nService

Service一个应用服务抽象,定义了Pod逻辑集合和访问这个Pod集合的策略。

Service代理Pod集合对外表现是为一个访问入口,分配一个集群IP地址,来自这个IP的请求将负载均衡转发后端Pod中的容器。

Service通过LableSelector选择一组Pod提供服务。

Volume

数据卷,共享Pod中容器使用的数据。

Namespace

命名空间将对象逻辑上分配到不同Namespace,可以是不同的项目、用户等区分管理,并设定控制策略,从而实现多租户。

命名空间也称为虚拟集群。

Lable

标签用于区分对象(比如Pod、Service),键/值对存在;每个对象可以有多个标签,通过标签关联对象。
基于基本对象更高层次抽象:  

ReplicaSet

下一代ReplicationController。确保任何给定时间指定的Pod副本数量,并提供声明式更新等功能。

RC与RS唯一区别就是lableselector支持不同,RS支持新的基于集合的标签,RC仅支持基于等式的标签。

Deployment

Deployment是一个更高层次的API对象,它管理ReplicaSets和Pod,并提供声明式更新等功能。

官方建议使用Deployment管理ReplicaSets,而不是直接使用ReplicaSets,这就意味着可能永远不需要直接操作   ReplicaSet对象。

StatefulSet

StatefulSet适合持久性的应用程序,有唯一的网络标识符(IP),持久存储,有序的部署、扩展、删除和滚动更新。

DaemonSet

DaemonSet确保所有(或一些)节点运行同一个Pod。当节点加入Kubernetes集群中,Pod会被调度到该节点上运行,当节点   从集群中移除时,DaemonSet的Pod会被删除。删除DaemonSet会清理它所有创建的Pod。

Job

一次性任务,运行完成后Pod销毁,不再重新启动新容器。还可以任务定时运行。

我来吐槽

*

*

已有 27 条评论

  1. clourgy

    This limits the amount of kinetic energy that can be utilized to aid the jump. where to buy cialis cheap kamagra gel cheap

  2. clourgy

    cheap cialis from india Cialis Farmaco Equivalente

  3. clourgy

    Venta De Cialis Barcelona buy generic cialis cialis vademecum es

  4. Twirway

    buy stromectol 12mg Vigre In Usa Without Prickription

  5. Twirway

    ivermectin for sale Soit 20mg Du Principe Actif Tadalafil Un Inhibiteur De La Pde

  6. Twirway

    Viagra Achat En Suisse En Asnieres ivermectin tablet online purchase Keflex Generic

  7. Twirway

    Propecia 20 Years Old ivermectin amazon

  8. Keysler

    cialis online ordering Gu Huan asked, Can I wait for my senior to get married My father best over the counter male enhancement and mother had been dead for many years, and the master Chang Yizhen also went to the other side

  9. Derofoory

    That s because chicken parmesan is kind of a pain in the ass to make, and it messes up the kitchen, to boot how to buy cialis

  10. Keysler

    5 cc every 5 pounds 9 lbs of weight you gain best generic cialis

  11. wainnef

    Sanofi s popular erectile dysfunction drug won t begin trials as anticipated due to concerns regarding trial protocol priligy fda approval Even if you are not producing sperm, you could still be fertile and conceive

  12. zeriGauri

    By some estimates, more than half of all ED drugs sold online are fakes buy priligy 60

  13. wainnef

    Viagra, or sildenafil in its generic form, is a PDE5 inhibitor drug primarily used to treat erectile dysfunction whether it s a result of a health condition or a side effect from taking other medications buy priligy online usa

  14. ruinkix

    buy cialis online with a prescription These tablets help many adults when ED has become an issue

  15. ruinkix

    discount cialis Pfizer is engraved on one side of the pill and VGR and a dosage amount are printed on the other side e

  16. Nizscoons

    It may last too long for you buy cialis online in usa Buy Cialis Online

  17. exinody

    best place to buy generic cialis online As a side note, the quality of the online Cialis stores is very high for their price, and they always recommend taking them with meals while you have your break

  18. Nizscoons

    While siblings often follow similar growth patterns, there can even be variations among them that defy expectations best generic cialis

  19. Gearsella

    body building forum clomid As mentioned above, these outcome data only refer to RM women without selected risk factors.

  20. chibina

    My first cycle was 100mg. what is in clomid I am hopeful.

  21. Gearsella

    All other trials had a low risk of bias for this domain. where sells genuine clomid in the uk Beside, san nutrition is the affinity to convert androgens to the free service for a quam mi augue.

  22. GaumbFaib

    clomid and nolvadex There were also, however, serious unacceptable side-effects Caine et al.

  23. furtuby

    tamoxifen nolvadex They have you leave a voice mail and they will return your call.

  24. ziserse

    Similarly, Vlahov and colleagues 2002 reported increases in substance use, including alcohol, in New York City and the surrounding areas in the months after September 11, 2001. buy doxycycline

  25. zibTaible

    He would also make make you feel dumb for asking legitimate questions. doxycycline hyclate uses

  26. ziserse

    doxycycline 500 mg prices She announced that she and Jacob were engaged and planned to be married.