12 Deploying your microservices

 

This chapter covers

  • Understanding why DevOps is critical to microservices
  • Configuring the core Amazon infrastructure for O-stock services
  • Manually deploying O-stock services to Amazon
  • Designing a build/deployment pipeline for your services
  • Treating your infrastructure as code
  • Deploying your application to the cloud

We’re almost at the end of the book, but not the end of our microservices journey. While most of this book has focused on designing, building, and putting Spring-based microservices into operation using the Spring Cloud technology, we haven’t touched on how to build and deploy microservices. Creating a build/deployment pipeline might seem like a mundane task, but in reality, it’s one of the most critical pieces of our microservices architecture.

Why? Remember, one of the key advantages of a microservices architecture is that microservices are small units of code that can be quickly built, modified, and deployed to a production environment independently of one another. The small size of the service means that new features (and critical bug fixes) can be delivered with a high degree of velocity. Velocity is the keyword here because velocity implies that little to no friction exists between creating a new feature or fixing a bug and getting our service redeployed. Lead times for deployment should be minutes, not days. To accomplish this, the mechanism that you use to build and deploy your code needs to be

12.1 The architecture of a build/deployment pipeline

12.2 Setting up O-stock’s core infrastructure in the cloud

12.2.1 Creating the PostgreSQL database using Amazon RDS

12.2.2 Creating the Redis cluster in Amazon

12.3 Beyond the infrastructure: Deploying O-stock and ELK

12.3.1 Creating an EC2 with ELK

12.3.2 Deploying the ELK Stack in the EC2 instance

12.3.3 Creating an EKS cluster

12.4 Your build/deployment pipeline in action

12.5 Creating our build/deploy pipeline

12.5.1 Setting up GitHub

12.5.2 Enabling our services to build in Jenkins

12.5.3 Understanding and generating the pipeline script

12.5.4 Creating the Kubernetes pipeline scripts

12.6 Closing thoughts on the build/deployment pipeline