掌握Docker集群编排:Swarm、Kubernetes与Mesosphere

需积分: 9 6 下载量 37 浏览量 更新于2024-07-19 收藏 5.03MB PDF 举报
"Docker Orchestration 是关于管理和协调Docker容器的技术,特别是当容器数量增加并分布到多个主机上时。本书旨在介绍如何通过编排来解决这一管理难题,探讨了Docker Swarm、Kubernetes、Mesosphere等主流编排工具,以及Fleet和Cattle这两个相对简单但功能强大的工具。此外,还涵盖了监控集群性能、持续集成以确保Docker镜像一致、可靠地构建、测试和部署,以及将这些原则应用到运行Docker的主机上。" 在深入讨论之前,让我们先理解什么是Docker编排。Docker编排是指对一组Docker容器进行自动化管理的过程,包括部署、扩展、更新和故障恢复。随着微服务架构的普及,单个应用可能由多个相互协作的容器组成,编排就变得至关重要。 在本书中,首先会引导读者了解Docker的基础,如安装Docker Engine,并通过Docker Machine在不同的云平台(AWS、GCE、Microsoft Azure)以及现有的Linux主机上启动Docker。接着,介绍了一些专为Docker设计的操作系统,如CoreOS、RancherOS和Project Atomic/RHEL Atomic,这些系统简化了Docker的部署和管理。 第二章则聚焦于使用Docker Compose构建多容器应用。Docker Compose允许通过一个YAML文件定义和运行多个关联的容器,简化了多容器应用的构建。通过编写Dockerfile来构建自定义镜像,然后使用Docker Compose定义服务间的依赖关系、网络配置和环境变量。此外,书中还讲解了如何使用环境文件、扩展Compose文件以及控制容器的启动和停止。 接下来,重点介绍了三大主流的Docker编排工具:Docker Swarm、Kubernetes(K8s)和Mesosphere。Docker Swarm是Docker原生的编排解决方案,易于上手,适合小规模到中等规模的集群。Kubernetes作为Google开源的编排工具,提供了更高级的功能和弹性,适用于大规模分布式系统。Mesosphere(包含DC/OS)则提供了一个全面的数据中心操作系统,支持多种容器化和非容器化工作负载。 此外,书中还涵盖了监控工具,帮助识别性能瓶颈,并利用持续集成/持续部署(CI/CD)流程来自动化Docker镜像的构建、测试和发布,确保软件开发的高效和稳定。最后,作者将讨论如何将这些编排理念应用到Docker主机的管理上,实现对整个基础设施的统一控制。 这本书是Docker管理员和开发者的重要参考资料,它提供了全面的知识和实践指导,帮助读者理解和掌握容器编排的关键技术和最佳实践。通过学习,读者能够有效地管理和扩展Docker环境,提高服务的可用性和可靠性。
2017-02-07 上传
Key Features Explore the new features added to the core Docker Engine to make multi-container orchestration easy Leverage tools such as Docker Machine, Swarm, Compose, and third-party tools such as Kubernetes, Mesosphere, and CoreOS to orchestrate containers Use Docker Compose with Swarm and apply rolling updates for zero downtime deployments Book Description Docker orchestration is what you need when transitioning from deploying containers individually on a single host to deploying complex multi-container apps on many machines. This book covers the new orchestration features of Docker 1.12 and helps you efficiently build, test, and deploy your application using Docker. You will be shown how to build multi-container applications using Docker Compose. You will also be introduced to the building blocks for multi-host Docker clusters such as registry, overlay networks, and shared storage using practical examples. This book gives an overview of core tools such as Docker Machine, Swarm, and Compose which will enhance your orchestration skills. You'll learn how to set up a swarm using the decentralized building block. Next, you'll be shown how to make the most out of the in-built orchestration feature of Docker engine and you'll use third-party tools such as Kubernetes, Mesosphere, and CoreOS to orchestrate your existing process. Finally, you will learn to deploy cluster hosts on cloud services and automate your infrastructure. What you will learn Build scalable, reliable services with Docker See how to manage a service in Docker using Docker Swarm, Kubernetes, and Mesosphere Discover simpler orchestration tools such as CoreOS/Fleet and Rancher Cattle Understand cluster-wide logging, system monitoring, and troubleshooting Build, test, and deploy containers using Continuous Integration Deploy cluster hosts on cloud services and automate your infrastructure Table of Contents Chapter 1. Getting Started with Docker Orchestration Chapter 2. Building Multi-Container Applications with Docker Compose Chapter 3. Cluster Building Blocks – Registry, Overlay Networks, and Shared Storage Chapter 4. Orchestration with Docker Swarm Chapter 5. Deploying and Managing Services with Kubernetes Chapter 6. Working with Mesosphere Chapter 7. Using Simpler Orchestration Tools – Fleet and Cattle Chapter 8. Monitoring Your Cluster Chapter 9. Using Continuous Integration to Build, Test, and Deploy Containers Chapter 10. Why Stop at Containers? Automating Your Infrastructure