liveBook · Manning

Kubernetes resource

As explained in Google Anthos in Action

A Kubernetes resource, also called a Kubernetes object, is an API-managed representation of a desired or observed cluster entity and its state.

A Kubernetes resource, also called a Kubernetes object, is an API-managed representation of a cluster entity and its state. Resources let developers deploy workloads and help administrators understand and troubleshoot cluster behavior. section 3.0 section 3.2.5

A cluster includes more than 60 built-in resource types, with additional types available through custom resource definitions (CRDs). Resource knowledge supports architectural decisions, application deployment, and diagnosis of failures such as an Ingress rule that does not work. section 3.1 section 3.2.5

Common resources divide responsibilities across workloads, configuration, networking, storage, identity, and cluster administration:

  • Pods run one or more containers, while Nodes provide the cluster’s compute power. section 3.2.5
  • ConfigMaps hold Pod configuration; Secrets hold typed secret data. section 3.2.5
  • Namespaces divide clusters between developers or applications, and ResourceQuotas enforce per-namespace limits. section 3.2.5
  • PersistentVolumeClaims let applications claim storage supplied by PersistentVolumes. section 3.2.5

Discovering resources and fields

Run `kubectl api-resources` to list resource names, short names, API versions, namespace scope, and kinds. Run `kubectl explain <resource name>` for a resource description and manifest-field guidance; for example, `kubectl explain pod` documents fields such as `apiVersion`, `kind`, and `metadata`. section 3.2.5

Tracing an Ingress

When an Ingress rule behaves unexpectedly, inspect the Ingress, its Service, and its Endpoints or EndpointSlices. These resources together reveal the routing rule, service abstraction, and Pod targets involved. section 3.2.5

kubectl api-resources
NAME               SHORTNAMES   APIVERSION   NAMESPACED     KIND
bindings                            v1          true        Binding
componentstatuses       cs          v1          false       ComponentStatus
configmaps              cm          v1          true        ConfigMap
endpoints               ep          v1          true        Endpoints
events                  ev          v1          true        Event
limitranges         limits          v1          true        LimitRange
namespaces              ns          v1          false       Namespace
nodes                   no          v1          false       Node
persistentvolumeclaims  pvc         v1          true    PersistentVolumeClaim
persistentvolumes       pv          v1          false       PersistentVolume
pods                    po          v1          true        Pod
podtemplates                        v1          true        PodTemplate
replicationcontrollers  rc          v1          true    ReplicationController
resourcequotas       quota          v1          true        ResourceQuota
secrets                             v1          true        Secret
serviceaccounts         sa          v1          true        ServiceAccount
services               svc          v1          true        Service

Browse the API-resource listing to compare names, short names, API versions, namespace scope, and kinds. section 3.2.5

How Google Anthos in Action covers it

How deep it goes
Defines common resources and discovery commands, but stops short of comprehensive coverage of all built-in and custom types.
Examples
Uses kubectl api-resources, kubectl explain, resource descriptions, and an Ingress–Service–EndpointSlice troubleshooting path.
What it assumes
Assumes basic Kubernetes context while introducing common resources and their functions for developers and cluster administrators.
What you can do after
Operate/configure clusters by discovering resources, reading manifest fields, selecting resource types, and investigating deployment problems.
How it connects
Connects Pods, Nodes, Services, Ingress, EndpointSlices, Namespaces, CRDs, selectors, and affinity or anti-affinity rules.

Also explained in

Compare how 5 books explain Kubernetes resource →

Related concepts

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