摘 要
容器集群的web应用是指使用软件引擎如Docker在服务器集群的操作系统上部署软件容器,再在其中部署web应用程序的开发方案,它最初是由Docker公司在2013年设计开发的。由于Docker引擎提供了一个额外的软件抽象层,以及操作系统层虚拟化的自动管理机制,使得web应用的部署兼备灵活性和便携性,于是使用Docker容器集群的web应用逐渐成为业界的热门方案。为了使容器集群的web应用能够承载海量的数据和服务并发量,达到较高的可用性和可靠性,开发设计人员必须尽可能地使容器中的应用充分利用服务器资源。但是在实际操作中,开发设计人员由于需要通过繁琐的操作进行手动管理,往往难以观察到容器集群的实时性能,进而影响了负载不均问题的解决。所以,解决以上问题的最好办法是实现一个基于容器集群的web应用性能的自动化分布式测试工具来处理容器集群的性能问题。
本文研究内容包括:容器集群应用的部署和测试工具、web应用性能的检测、性能数据的可视化表示。Docker容器集群的应用有其独特的体系架构,课题需要研究Kubernetes集群配置的过程和原理,比如包括部署Ectd集群、Kucectl命令行工具、Flannel 网络等,并优化部署分配模块,优化测试页面结构,使用户可以通过简易操作实现自动化分布式部署和测试。最后,实现集群部署和测试工具的用户交互界面,性能数据导出后生成可视化界面,提供直观形象的集群性能反馈。
关键字:容器;集群;Web;分布式;Kubernetes
Abstract
Container cluster web applications refer to the deployment of software containers on server cluster operating systems using software engines such as Docker, which was originally designed and developed by Docker in 2013.Because the Docker engine provides an additional software abstraction layer, as well as an automated management mechanism for operating system layer virtualization, web applications are deployed with both flexibility and portability.Therefore, the web application using Docker container cluster has gradually become a hot solution in the industry.To enable container cluster web applications to carry the sea Since the amount of data and service concurrency can achieve high availability and reliability, developers and designers must make full use of server resources in the container as far as possible.However, in practice, developers and designers often find it difficult to observe the real-time performance of container clusters because of the need for manual management through cumbersome operations, thus affecting the solution of the problem of uneven load.Therefore, the best way to solve the above problem is to implement an automated distributed testing tool for web application performance based on container cluster to deal with the performance problems of container cluster.
The research contents of this paper include: the deployment and testing tool of container cluster application, the visual representation of performance data, the application of Docker container cluster has its unique architecture.We need to study the process and principle of Kubernetes cluster configuration, such as deploying ECTD cluster Kucectl command-line tool and Flannel network, optimizing deployment allocation module, optimizing test page structure, etc.Enables users to automate distributed deployment and testing through simple operations.Finally, the user interface for cluster deployment and testing tools is implemented, After the output of the performance data, the visual interface is generated to provide visual and visual cluster performance feedback.
Keywords: Container;cluster;Web;distributed;Kubernetes
目 录
摘 要 I
Abstract II
第1章 绪论 1
1.1课题研究的背景及意义 1
1.1.1 提高资源利用率 1
1.1.2 服务的动态扩容和持续集成 1
1.2国内外研究现状 2
1.2.1CasS平台 2
1.2.2容器VS虚拟机——商用为主 2
1.2.3微服务化 3
1.3主要研究内容 4
1.4论文组织结构 4
第2章 总体设计 6
2.1功能设计 6
2.1.1Minion节点组件 6
2.1.2 Master节点组件 7
2.2基本概念 8
2.2.1 Pod 8
2.2.2 Service 10
2.2.3 Replication Controller 10
2.2.4 Label 11
第3章 详细设计 12
3.1 Master节点 12
3.2 Kubectl 12
3.3 API Server 12
3.3.1 Minion Registry 14
3.3.2 Pod Registry 14
3.3.3 Service Registry 14
3.3.4 Controller Registry 15
3.3.5 Endpoints Registry 15
3.3.6 Binding Registry 16
3.4 Scheduler 16
第4章 设计实现 18
4.1 Pod 18
4.1.1 Volume 20
4.1.2 容器通信 21
4.2 Replication Controller 21
4.2.1 RestartPolicy和Replication Controller 22
4.2.2 Replication Controller的工作机制 24
4.2.3 Replication Controller的应用场景 25
4.3 Service 27
4.3.1 工作机制 27
4.3.2 数据结构定义 28
4.3.3 服务发现 29
4.3.4 Headless Service 30
4.3.5 入口地址和外部可路由性 31
4.3.6 避免端口冲突 31
4.3.7 Service入口 32
4.3.8 存在的的不足 33
4.4 API Server 33
4.4.1设计目的 34
4.4.2资源对象的RESTful接口 34
4.4.3 API操作的原子性 35
4.4.4 API Server流程 36
第5章 调度和网络 39
5.1 网络 39
5.1.1 网络模型 39
5.1.2 具体实现 39
5.1.3 其他工作 39
5.2 Minion管理 41
5.2.1 Minion发现 41
5.2.2 Minion管控流程 42
5.3 调度器 42
5.3.1 调度策略 43
5.3.2 例1:Predicates.PodFitsPorts 43
5.3.3 例2:Priorities.LeastRequestedPriority 45
5.3.4 缓存模型 45
第6章 实战部署 47
6.1 环境准备 47
6.1.1 下载软件包 47
6.1.2 下载源码包进行编译 47
6.2 upstart脚本 47
6.3安装kubernetes客户端程序 48
总结与展望 49
参考文献 50
致 谢 51
附 录 52