liveBook · Manning

Kubernetes

As explained in Kubernetes for Developers

Kubernetes is an open-source container orchestration platform that automates deployment, scaling, and management of containerized workloads.

Suppose an application suddenly needs many more instances, or a new requirement calls for a scheduled batch job alongside an existing web service. Running containers directly on individual machines can work at small scale, but configuring each machine and placing each container by hand becomes difficult to manage. Kubernetes provides a shared cluster of machines and handles the placement and monitoring of containerized workloads. You describe what should run; Kubernetes works to keep it running. section 1.0 section 1.2 section 3.0

A cluster contains nodes, which supply compute capacity, and a control plane. The basic unit Kubernetes places on a node is a Pod: one container or a set of containers scheduled together. A Deployment manages Pods for an application and specifies details such as the desired number of replicas and container versions. A Service gives a group of Pods a network endpoint, including one that can expose an application to the internet. These objects let you describe the application without assigning every container to a particular machine. section 1.2.1 section 3.1 section 3.5

A basic release follows a practical sequence:

  • Upload the application’s container image to a container repository. section 3.5
  • Define the workload in configuration, typically YAML: use a Deployment for the Pods and a Service for network access. Apply that configuration through the Kubernetes API, commonly with kubectl. section 3.2 section 3.5
  • To release a new version, change the configured container version and apply the change. Kubernetes compares the configurations and carries out the update. section 1.2 section 3.5

Kubernetes can restart a crashed container and replace missing Deployment replicas after a node fails. Liveness and readiness probes provide the application-specific signals needed to detect other problems, such as a hung process or a service that cannot accept traffic. With suitable configuration, autoscaling can increase replicas in response to metrics such as utilization. A managed Kubernetes provider may additionally provision, repair, and upgrade nodes; Kubernetes itself does not repair node-level problems. section 1.2.2 section 4.1

The flexibility has a cost: Kubernetes introduces work around resource allocation, networking, updates, and keeping services available. A simpler platform as a service may be the better choice when its constraints fit your needs; a fully managed database may be preferable to running your own database in Kubernetes. Kubernetes becomes more useful when you need to combine workload types, run many services, or retain room for changing requirements. A local cluster is useful for iteration and configuration tests, but it does not reproduce a production cloud cluster’s dynamic capacity or public networking. section 1.2.3 section 1.2.4 section 3.4

How Kubernetes for Developers covers it

How deep it goes
Works through cluster building blocks, a release-and-update sequence, and operational behavior, without presenting an exhaustive API reference.
Examples
Uses an internet-facing application release, a three-zone service deployment, and local-versus-cloud development clusters.
What it assumes
Builds from the containerized-application problem and introduces cluster, Pod, Deployment, and Service terminology before deployment.
What you can do after
Apply it via kubectl to deploy and update a containerized application using a Deployment and Service.
How it connects
Links container orchestration to Pods, Deployments, Services, declarative configuration, health checks, and autoscaling.

Also explained in

Compare how 22 books explain Kubernetes →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes for Developers. The section links point to the parts of the book it draws on.