liveBook · Manning

Resource

As explained in Kubernetes in Action, Second Edition

An API resource is an addressable Kubernetes API endpoint and representation associated with an object type.

A resource is an addressable part of the Kubernetes REST API. It exposes cluster configuration through a URI and supports operations such as create, read, update, and delete using standard HTTP methods. section 4.1.1

Kubernetes uses “resource” and “object” almost interchangeably, but they describe different views: an object is represented through one or more resources, while each resource has its own address and representation. section 4.1.1

Deployment resources

The collection of deployments is exposed at /api/v1/deployments. A GET request returns the deployment instances. Each individual deployment also has a unique URI, which can be read with GET or modified with PUT. section 4.1.1

Resources participate in the Kubernetes object lifecycle:

  • YAML or JSON manifests describe API objects and can be posted to create them. section 4.4
  • GET requests retrieve an object and its current status; controllers update that status while managing the desired state in its spec. section 4.4
  • Events are also API objects and provide clues about recent actions or failures affecting an object. section 4.4
Figure 4.2 A single object can be exposed by two or more resources.
figure

Use the figure to visualize how one Kubernetes object can be exposed through multiple resources or representations. section 4.1.1

How Kubernetes in Action, Second Edition covers it

How deep it goes
Explains URIs, collections, instances, CRUD methods, and object relationships, then connects resources to manifests, status, and controllers.
Examples
Uses deployment collection and instance URIs, YAML or JSON manifests, GET and PUT requests, and API events.
What it assumes
Assumes no Kubernetes API background and introduces REST, resources, objects, URIs, and standard HTTP operations.
What you can do after
Operate/configure Kubernetes objects by addressing resources, posting manifests, retrieving status, and interpreting events.
How it connects
Connects REST APIs, Kubernetes objects, CRUD operations, manifests, controllers, status, and events.

Also explained in

Compare how 3 books explain resource →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes in Action, Second Edition. The section links point to the parts of the book it draws on.