Clusters are the set of compute, storage, and network resources where pods are deployed, managed, and scaled. Clusters are made of nodes connected via a “flat” network, in which each node and pod can communicate with each other. A typical Kubernetes cluster size ranges from 1 – 200 nodes, and it’s common to have more than one Kubernetes cluster in a given data center based on node count and service SLAs.
Pods are a colocated group of application containers that share volumes and a networking stack. Pods are the smallest units that can be deployed within a Kubernetes cluster. They are used for run once jobs, can be deployed individually, but long running applications, such as web services, should be deployed and managed by a replication controller.
Replication Controllers ensure a specific number of pods, based on a template, are running at any given time. Replication Controllers manage pods based on labels and status updates.
Services deliver cluster wide service discovery and basic load balancing by providing a persistent name, address, or port for pods with a common set of labels.
Labels are used to organize and select groups of objects, such as pods, based on key/value pairs.
The Kubernetes node runs all the components necessary for running application containers and load balancing service end-points. Nodes are also responsible for reporting resource utilization and status information to the API server.
Docker, the container runtime engine, runs on every node and handles downloading and running containers. Docker is controlled locally via its API by the Kubelet.
Each node runs the Kubelet, which is responsible for node registration, and management of pods. The Kubelet watches the Kubernetes API server for pods to create as scheduled by the Scheduler, and pods to delete based on cluster events. The Kubelet also handles reporting resource utilization, and health status information for a specific node and the pods it’s running.
Each node also runs a simple network proxy with support for TCP and UDP stream forwarding across a set of pods as defined in the Kubernetes API.
Kubernetes is constructed using several components, as follows:
- Kubernetes master
- Kubernetes nodes
- Overlay network (flannel)
The preceding image can be summarized as follows:
- Kubernetes master connects to etcd via HTTP or HTTPS to store the data. It also connects flannel to access the container application.
- Kubernetes nodes connect to the Kubernetes master via HTTP or HTTPS to get a command and report the status.
- Kubernetes nodes use an overlay network (for example, flannel) to make a connection of their container applications.
- Authorization and authentication
- RESTful API entry point
- Container deployment scheduler to the Kubernetes nodes
- Scaling and replicating the controller
- Read and store the configuration
- Command Line Interface