14 Deploying microservice APIs with Kubernetes

 

This chapter covers

  • Creating a cluster with AWS’s Elastic Kubernetes Service (EKS)
  • Exposing services using the AWS Load Balancer Controller
  • Deploying services to a Kubernetes cluster
  • Managing secrets securely in Kubernetes
  • Deploying an Aurora Serverless database

Kubernetes is an open source container orchestration framework, and it’s fast becoming a standard way for deploying and managing applications across platforms. You can deploy Kubernetes yourself to your own servers, or you can use a managed Kubernetes service. In either case, you’ll get a consistent interface to your services, which means moving across cloud providers becomes less disruptive for your operations. You can also deploy a Kubernetes cluster in your machine and run your tests locally in much the same way you’d do in the cloud.

Run kubernetes locally with minikube

You can run a Kubernetes cluster locally using minikube. Although we won’t cover it in this chapter, minikube is a great tool to get more familiar with Kubernetes. Check out the official documentation for minikube (https://minikube.sigs.k8s.io/docs/start/).

14.1 Setting up the environment for this chapter

14.2 How Kubernetes works: The “CliffsNotes” version

14.3 Creating a Kubernetes cluster with EKS

14.4 Using IAM roles for Kubernetes service accounts

14.5 Deploying a Kubernetes load balancer

14.6 Deploying microservices to the Kubernetes cluster

14.6.1 Creating a deployment object

14.6.2 Creating a service object

14.6.3 Exposing services with ingress objects

14.7 Setting up a serverless database with AWS Aurora

14.7.1 Creating an Aurora Serverless database

14.7.2 Managing secrets in Kubernetes

14.7.3 Running the database migrations and connecting our service to the database