How it works...

We now have a functioning microservice system with a continuous delivery pipeline.

This is depicted in the following figure:

Once a commit is pushed to the master branch, Jenkins will pull the latest version of the code, and run build and test steps before creating a new container image. Once the image is created, it is pushed to DockerHub. Jenkins then triggers a deployment into Kubernetes. Kubernetes pulls the nominated image from DockerHub and creates a new pod. The old pod is then discarded.

We have created independent pipelines for adderservice, auditservice, eventservice, and webapp.

This is a good point to note the ease of transition from run our system in development mode using Fuge (the microservice development toolkit used in several recipes in Chapter 10, Building Microservice Systems) to running our system in Kubernetes. This is down to our code being written from the start to use the same service discovery mechanisms in both environments.