This chapter covers:
- Packaging a microservices in a Docker container
- Deploying a microservice container to Kubernetes on localhost
- Creating a basic Kubernetes cluster on Azure’s AKS (Azure Kubernetes Service)
- Deploying a microservice container to a Kubernetes cluster on AKS
In chapter 2 we developed a simple shopping cart microservice, but we only ran it on localhost directly with the dotnet run
command. In this chapter we take that microservice and deploy it to a production-like environment in a public cloud. Our microservices can run in many different environments, but we are going to pick just one as an example. We are going to focus on how to take the shopping cart microservice and run it in a Kubernetes cluster in Microsoft Azure. To reach that goal in this chapter we will:
- Put the shopping cart into a Docker container
- Setup Kubernetes on localhost, so we have a testing ground
- Setup Kubernetes in Azure, so we have a production-like environment
- Run the same shopping cart container in the localhost Kubernetes cluster and the Azure Kubernetes cluster