Infrastructure as Code: Managing Servers in the Cloud

Author: Keif Morris
Reviewers: Adit Kumar, Shivaraj Nesaragi

The author of this book understands the hassle that infrastructure engineers face on daily basis from his experience with many teams and aims to provide insight for the readers to comprehend infrastructure issues and free the engineers of their drudgery from such intricacies.

Chapter 1: Challenges and Principles

The first chapter explains about what Infrastructure as Code means to the readers and the goals that Infrastructure as a Code intends to achieve. The author also explains the challenges with dynamic infrastructure with the help of case studies from his own experience as an engineer.The chapter then delves into the principles of Infrastructure as code, introducing us to the principles with examples where they are necessary.

Chapter 2: Dynamic Infrastructure Platforms

In this chapter the author talks about what dynamic infrastructure is and the different types of dynamic infrastructure platforms like Public Iaas, Community Iaas Cloud, private Iaas and bare-metal cloud. Implementing dynamic infrastructure as per the company requirements is the heart of topic and the process you follow to achieve it marks the essence of the topic. The chapter then explains the three important building blocks of Infrastructure platform: Compute, Storage and Networking and how the make up cloud infrastructure. It also provides examples on how the different types of clouds : IaaS,PaaS and SaaS work. The chapter basically prepares the us on the theoretical aspects of the dynamic infrastructure by case studies and examples and leads the path for implementation of it in the next chapter.

Chapter 3: Infrastructure Definition Tools

The chapter describes infrastructure tools(Eg: TerraForm, Cloud Formation etc.) for managing resources following the principles mentioned in the previous chapter. Many automation tools do not follow the principles mentioned here but they get the work done in real world following these principles in one or the other way. The first part of the chapter deals with Command Line Interface(CLI) Tools and how the tools could be configured and written using the scripts and their interdependency. According to the book the scripts should follow the properties of being Idempotent, Pre-checks, Post-checks, Visible failure and parameterized and it discusses how these properties make scripts more reliable. The next half of the chapter deals with using VCS tools to configure resources for a particular infrastructure and handles cases such as configuring files, users etc. Overall it describes how resources could be carefully and successfully allocated so that they work perfectly in the given environment.

Chapter 4: Server Configuration Tools

This chapter explains how different tools such as Puppet, Chef, Ansible and other tools are used to configure the server so that automation works in a new level compared to using scripts. The author delineates the goals for Automated server management. He gives some insight on "Tools for creating servers", "Tools for configuring servers", "Tools for packaging server templates", "Tools for running commands on Servers etc.". The tools such as Docker are being widely used these days and are refereed to as containerization tools. In the last part of the book the author explains the advantages of using containerzation tools vs virtual machines and discusses how to use them securely.

Chapter 5: General Infrastructure Services

Until now, the author has described about configuring, provisioning of infrastructure resources but in real world scenario the infrastructure needs number of other tools to support it and this chapter delineates general set of such tools. The preference of such tools is based on factors such as external configuration, how dynamic the tools are and how easy it to obtain cloud-compatible license. Sharing a service across the team or company is one of the important factors and author substantiates this with an example here. He then discusses about the Monitoring and what goals should it achieve, importance of Logging, deployment and packaging of the software etc.

Chapter 6: Patterns for provisioning servers

In the first part of the book the author described design and configuration of infrastructure tools. This chapter is the beginning of the 2nd part of the book where the author describes how to make servers ready for use. To provision server means allocating resources to server and making it functional so that it can be used by various users. Server has life cycle which includes: 1) Packaging a server template 2) Creating a new server 3)Updating the server and 4) Deleting the server. He substantiates each of the step with an example and explains the lifecycle of a server unambiguously. The patterns for creating the servers such as cloning the existing server,instantiating from a snapshot etc can be accomplished by using AWS Free tier account. We should also know about the anti pattern discussed in the book which is one of the important ways of creating servers. In overall, the author here discusses about patterns of creating servers and gives an overview of server's lifecycle.

Chapter 7: Patterns for Managing Server Templates

This chapter provides an overiew of server templates and how servers can be provisioned from using these templates. The important thing while provisioning the server would be as what packages should the templates include for customer usage and what packages should be used while creating the server. The book discusses 3 steps involved in provisioning the servers using templates in detail. The three steps being:

  • Selecting an image
  • Applying customizations to the image
  • Packaging the image into server template image

The author then discusses about the different kinds of building the templates and explains them with examples. This chapter along with the previous two chapters provide an insight as how to provision the servers.

Chapter 8: Patterns for Updating and changing servers

Changing servers are difficult to maintain and this chapter gives us certain patterns and guidelines as how to manage and keep our running servers up to date. Apart from these the chapter explains how to get into the best practices and the patterns that should be followed for continuous deployment. The author talks about different types of servers and how to manage configuration definitions and explains in details about updating servers by following standard set of rules.

Chapter 9: Patterns for Defining Infrastructure

The chapter discusses about how large Infrastructure should be provisioned and maintained. It discusses about the patterns and antipatterns the software industries follow and gives us insight of Infrastructure stack. Managing parameters in a stack,sharing infrastructure elements could be a challenging task and the author has done a great job in explainig these important things with relevant examples. He also discusses how to maintain application code and infrastructure code abreast. The author also mentions about the pitfalls that occur while maintaining such codes. Thus he has given an overall idea of how larger Infrastructure group works.

Chapter 10: Software Engineering practices for Infrastructure

This is the first of the chapters in the part 3 of the book. The chapter mainly speaks about the quality of the infrastructure system and outlines the principles for achieving this quality that author talks about. The key point mentioned here is how quality of system is proportional to how easily a system can be changed or replaced. The author talks about how build fails and what constitues continuous integration(CI) and what doesn't. He explains the differences between continuous delivery and continuous deployment, thus explaining how to view infrastructure from a Software Engineering principles.

Chapter 11: Testing Infrastructure Changes

Automated testing is the main aspect of this topic. Building test suite that consists of different level of test cases such as High, Medium and Low level cases is important and the suite should be well balanced. The author has taken efforts to explain Unit testing in detail by providing suitable examples.Managing test code can be a hassle and the author explains different intricacies involved in it, he also explains patterns and antipatterns to manage test codes.

References:

The chapter names and the key points if any mentioned are taken from the book "Infrastructure as a code,Managing servers in cloud" by Kief Morris