Kubernetes – K8s (ubernetes = 8 characters)
The Kubernetes environment is centered around a few core concepts. These terms are used a lot as we discuss Kubernetes, so it’s a good place to start.
A Kubernetes cluster represents a compute, network, and storage. The networking for a Kubernetes cluster is flat to ensure East-West communication between pods. The clusters can range in size, so your choice on cluster size will be dependent on physical or virtual resources. Clusters can be run directly on bare metal, nested within hypervisors, or also nested within containers.
Pods are a group of applications which are run in a shared context. This means that they are treated much like a group of applications on any single virtual machine, or physical server in the past. Pods are the abstraction of this layer to provide a logical host which is application based rather than host based. Not every pod will contain multiple containers necessarily, but the potential is there to use a microservices architecture within the pod.
What good is a pod if it runs on one host only, right? This is where replication controllers come into play. The replication controllers ensure that a certain number of replicas of the pod are running at any one time. In the event of a replica failing, another will be spun up in its place to keep the pre-defined number of replicas active. There is also restart policies which will dictate the behavior inside the cluster of your pod replicas.
The labels are key value pairs assigned to tag objects such as pods within Kubernetes. This applies to be able to label and select objects using references that will be meaningful to the application environment. Pods have a UID which must, as the acronym would indicate, be unique. Labels allow us to create meaningful names that can be duplicated among the overall environment.
Service discovery is an important part of Kubernetes, and using services to provide names, addresses to pods using labels. Policies also come into play within the services, and we will discuss much more on these concepts here and in future articles.
Inside the Kubelet
The Kubelet is the agent running on each node that handles registering the node, sharing the health status of the node, and watching the Kubernetes API for for scheduled creations and deletions of pods. It runs as a binary and works with a combination of configuration files and the etcd servers to handle clusters on each node.
There are a lot of moving parts involved as we can see, and this is why understanding the basic terminology is helpful. This architecture diagram will give you a good hint as to just how many moving parts we are dealing with:
by Eric Wright