Hands-On Kubernetes on Windows
上QQ阅读APP看书,第一时间看更新

What is Kubernetes?

In general, Kubernetes can be seen as the following:

  • A container (microservices) orchestration system
  • A cluster management system for running distributed applications

As a container orchestrator, Kubernetes solves common challenges that arise when deploying containerized, cloud-native applications at scale. This includes the following:

  • Provisioning and deploying containers on multiple container hosts (nodes)
  • Service discovery and load balancing network traffic
  • Automatically scaling container instances up and down
  • Automated rollouts and rollbacks of new container image versions
  • Automatic, optimal bin-packing of containers with regard to resources such as CPU or memory
  • Application monitoring, telemetry gathering, and health checks
  • Orchestrating and abstracting storage (local, on-premises, or the cloud)

At the same time, Kubernetes can also be described as a cluster management system – the master (or multiple masters, in highly available deployments) is responsible for effectively coordinating multiple worker nodes that handle the actual container workloads. These workloads are not limited to Docker containers only  Kubernetes uses the Container Runtime Interface (CRI) on worker nodes to abstract container runtimes. Eventually, cluster clients (for example, DevOps engineers) can manage the cluster using the RESTful API that's been exposed by the master. Cluster management is performed using a declarative model, which makes Kubernetes very powerful  you describe the desired state and Kubernetes does all the heavy lifting in order to transform the current state of the cluster into the desired state.

Imperative cluster management by using ad hoc commands is also possible but it is generally discouraged for production environments. The operations are performed directly on a live cluster and there is no history of previous configurations. In this book, we will use the declarative object configuration technique whenever possible. For a more detailed discussion regarding Kubernetes cluster management techniques, please refer to the official documentation:  https://kubernetes.io/docs/concepts/overview/working-with-objects/object-management/.

The high-level architecture for Kubernetes can be seen in the following diagram. We'll go through each component in the next few paragraphs:

Let's begin by focusing on the role of Kubernetes master, also known as the control plane.