chapter six

6 Creating your production environment

 

This chapter covers:

  • Building production infrastructure for your application
  • Working with Terraform to script the creation of infrastructure
  • Creating a Kubernetes cluster to host microservices
  • Interacting with your Kubernetes cluster

Finally, we arrive at the most exciting chapters of the book! The next two chapters are also probably the hardest so far, but please do follow along with the examples. That’s how you’ll learn the most and gain real experience bringing your own application to production.

In this chapter and the next, we will create a Kubernetes cluster and deploy multiple containers to it. We’ll deploy a MongoDB database server and a RabbitMQ server. Then we’ll learn how to deploy our video streaming microservice. In the next chapter, we’ll also build a continuous delivery pipeline that will automatically push our code updates to production.

The examples in these two chapters are designed for you to follow along with step by step to and build our infrastructure and application. This closely emulates the real process of prototyping new infrastructure and is very close to what I really do in my own development.

6.1       New tools

6.2       Getting the code

6.3       Getting to production

6.4       Infrastructure as code

6.5       Hosting microservices on Kubernetes

6.5.1   Why Kubernetes?

6.5.2   How does Kubernetes work?

6.6       Working with the Azure CLI

6.6.1   Installing the Azure CLI

6.6.2   Authenticating with Azure

6.6.3   Which version of Kubernetes?

6.6.4   What have we achieved?

6.7   Creating infrastructure with Terraform

6.7.1   Why Terraform?

6.7.2   Installing Terraform

6.7.3   Terraform project setup

6.8       Creating an Azure resource group for your application

6.8.1   Evolutionary architecture with Terraform