Book Image

Hands-On Docker for Microservices with Python

By : Jaime Buelta
Book Image

Hands-On Docker for Microservices with Python

By: Jaime Buelta

Overview of this book

Microservices architecture helps create complex systems with multiple, interconnected services that can be maintained by independent teams working in parallel. This book guides you on how to develop these complex systems with the help of containers. You’ll start by learning to design an efficient strategy for migrating a legacy monolithic system to microservices. You’ll build a RESTful microservice with Python and learn how to encapsulate the code for the services into a container using Docker. While developing the services, you’ll understand how to use tools such as GitHub and Travis CI to ensure continuous delivery (CD) and continuous integration (CI). As the systems become complex and grow in size, you’ll be introduced to Kubernetes and explore how to orchestrate a system of containers while managing multiple services. Next, you’ll configure Kubernetes clusters for production-ready environments and secure them for reliable deployments. In the concluding chapters, you’ll learn how to detect and debug critical problems with the help of logs and metrics. Finally, you’ll discover a variety of strategies for working with multiple teams dealing with different microservices for effective collaboration. By the end of this book, you’ll be able to build production-grade microservices as well as orchestrate a complex system of services using containers.
Table of Contents (19 chapters)
Free Chapter
1
Section 1: Introduction to Microservices
3
Section 2: Designing and Operating a Single Service – Creating a Docker Container
7
Section 3:Working with Multiple Services – Operating the System through Kubernetes
13
Section 4: Production-Ready System – Making It Work in Real-Life Environments

What this book covers

Section 1, Introduction to Microservices, introduces the microservice architecture and the concepts to be used throughout the rest of the book. It also introduces an example scenario that is followed throughout the book.

Chapter 1, Making the Move – Design, Plan, Execute, explores the differences between the monolith approach and microservices, and how to design and plan a migration from the former to the latter.

Section 2, Designing and Operating a Single Service – Creating Docker Containers, looks at building and operating a microservice, covering its full life cycle, from design and coding to following good practices to ensure that it's always high quality.

Chapter 2, Creating a REST Service with Python, covers the implementation of a single web RESTful microservice, using Python and high-quality modules for development speed and quality.

Chapter 3, Build, Run, and Test Your Service Using Docker, shows you how you can encapsulate a microservice using Docker to create a standard, immutable container.

Chapter 4, Creating a Pipeline and Workflow, teaches you how to run tests and other operations automatically to ensure that containers are always of high quality and ready to use.

Section 3, Working with Multiple Services: Operating the System through Kubernetes, moves on to the next stage, which is to coordinate each of the individual microservices so they work as a whole in a consistent Kubernetes cluster.

Chapter 5, Using Kubernetes to Coordinate Microservices, introduces Kubernetes concepts and objects, including how to install a local cluster.

Chapter 6, Local Development with Kubernetes, has you deploy and operate your microservices in a local Kubernetes cluster.

Chapter 7, Configuring and Securing the Production System, delves into the setup and operation of a production Kubernetes' cluster deployed in the AWS Cloud.

Chapter 8, Using GitOps Principles, describes in detail how to use Git source control to control Kubernetes infrastructure definition.

Chapter 9, Managing Workflows, explains how to implement a new feature in a microservice, from design and implementation to deployment to an existing Kubernetes cluster system that is open to the world.

Section 4, Production-Ready System: Making It Work in Real-Life Environments, talks about techniques and tools for the successful operation of a real-life cluster.

Chapter 10, Monitoring Logs and Metrics, is about monitoring how a live cluster is behaving to proactively detect problems and improvements.

Chapter 11, Handling Change, Dependencies, and Secrets in the System, is concerned with how to effectively handle configuration that is shared across multiple microservices in a cluster, including the proper management of secret values and dependencies.

Chapter 12, Collaborating and Communicating across Teams, focuses on the challenges of teamwork between independent teams and how to improve collaboration.