Google Cloud Platform for Architects
上QQ阅读APP看书,第一时间看更新

Docker containers and Kubernetes – complements, not substitutes

A common question that people have is - what exactly is the relationship between Docker and Kubernetes? Well, technically Docker is a container hosting and container runtime platform while kubernetes is a container orchestration platform. In other terms, containers run on Docker while they can be managed by kubernetes. There are other orchestrators as well, but they would go way out of the scope and relevance of this book. Kubernetes was earlier developed by Google to manage their own containers; that is, for internal use at Google. Many of the kubernetes orchestration techniques are derived from the results of Google's own struggle with handling containers on large scale. Some of these features include StatefulSets, Configmaps and most importantly High availability cluster configuration.

Going forward, Docker users can choose between Kubernetes and Swarm for scheduling, and Docker’s enterprise edition will ship with Kubernetes. This will allow users to deploy containers directly to a Kubernetes cluster using a Docker stack file.

At the technology level though, the relationship between Docker containers and the Kubernetes orchestration system is complementary. If you decide to go down the container path in the GCP, you'll most likely run a Kubernetes container cluster (although there are two other options as well—App Engine Flex and containers on a VM. More details will follow). Schematically, here is what a container cluster would look like.

These containers run in a container cluster, which is managed using software known as Kubernetes. Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications that was originally designed by Google and donated to the Cloud Native Computing Foundation (CNCF):

Notice how in the cluster, we have one supervising machine, which is the block at the bottom running Kubernetes, known as the master endpoint. This master endpoint is in touch with a number of inpidual container machines, each running containers and each talking or communicating with the master using a piece of software known as a Kubelet. In the world of the GKE, that coordinating machine is known as the master node, running Kubernetes. Each of the other VMs in the cluster is known as a node instance. Each node instance has its own Kubelet talking to the master and atop, which runs a pod. A Pod is the atomic unit of kubernetes cluster orchestration. Inside each pod there can be one or multiple containers. This is important, as the master talks to node instances, which in turn contain pods and those pods contain the containers.