We achieved a lot in this recipe, and there are a lot of concepts to understand if we are new to Kubernetes. While a full description of Kubernetes is outside the scope of this book, the following diagram illustrates what our single service deployment looks like:
![](assets/3c7aac87-3235-430e-9c63-b9d3df1ad67c.png)
The structure is as follows:
- We have a Docker engine instance running on our host machine. We used this to build and tag our images.
- We pushed our Docker image to a public repository on DockerHub.
- Kubernetes (minikube) is running inside a VM on our local machine.
- Kubernetes pulled our adderservice image from our Docker repository.
- Kubernetes created a pod (for more information, visit https://kubernetes.io/docs/concepts/workloads/pods/pod/) in which to run our container. Pods are managed by a replication controller, which is associated with a namespace. In this case, it is the micro namespace.
- We also created a Kubernetes service (for more information, visit https://kubernetes.io/docs/concepts/services-networking/service/) to expose our adderservice container to the outside world. The service exists within our micro namespace.
A full introductory tutorial on Kubernetes can be found on the official Kubernetes site, https://kubernetes.io/docs/tutorials/. This tutorial provides a great explanation of the basic concepts that we need in order to work with Kubernetes. If the intricacies of our deployment thus far are still a little unclear, we recommend working through the Kubernetes tutorial and revisiting the preceding diagram before proceeding to the next recipe.
There are, of course, alternatives to Kubernetes. Some alternatives are listed here:
- Docker Swarm: https://docs.docker.com/engine/swarm/
- Apache Mesos: http://mesos.apache.org/
- Amazon Elastic Container Services: https://aws.amazon.com/ecs
At the time of writing, Kubernetes is the leading container orchestration platform.