liveBook · Manning

Kubernetes API

As explained in Developer Experience on Kubernetes

The Kubernetes API is the programmatic interface through which clients create, inspect, modify, and delete Kubernetes objects and resources.

The Kubernetes API is the interface for creating and managing resources on a cluster. It gives developers a way to run containerized applications without needing to understand the cluster’s computer topology or networking details, while giving development and operations teams a shared language for application design and operation. section 3.1.1 section 3.3.3

In a Kubernetes-based inner loop, the API turns application deployment into an explicit workflow. After packaging code as a container image, developers load that image into the cluster, define or update resource manifests, and apply those manifests to create or update resources. These repeated steps can slow feedback compared with running directly on an application runtime. section 3.3.2 section 3.5

Use the API through YAML manifests and kubectl to describe the resources an application needs:

  • Deployment manages the lifecycle of a stateless replicated application; each replica contains a Pod representing the application container. section 3.3.3
  • Service makes a Deployment available for network calls, usually from within the cluster. section 3.3.3
  • Ingress makes a Service available for network calls from outside the cluster. section 3.3.3
  • ConfigMap and Secret can supply application properties or credentials; Base64 encoding alone does not make Secret data encrypted. section 3.3.3

Deploying an appointments service

An appointments service can be deployed by first provisioning PostgreSQL, building a local image, loading it into a kind cluster, and applying a configuration directory with kubectl. Its Deployment manifest identifies the image and reads PostgreSQL connection values from a Secret; kubectl can then list resources by the application label and later delete the applied configuration. section 3.3.3 section 3.5

Figure 3.11 The “Run” activity in the inner loop on Kubernetes involves a series of additional tasks.

This workflow view shows why a Kubernetes inner loop requires image packaging, cluster loading, manifest updates, and manifest application for each code change. section 3.3.2

The practical choice is to keep API interaction aligned with the development loop: use manifests to express the desired application resources, and use tools that reduce image-building and deployment friction. Kubernetes supplies the resource API; tools such as kubectl, kind, Buildpacks, and ko support different parts of the local workflow. section 3.3.3 section 3.5

How Developer Experience on Kubernetes covers it

How deep it goes
Works through manifests, resource roles, and kubectl commands rather than API internals.
Examples
Uses an appointments service with PostgreSQL, a Deployment manifest, a kind cluster, and kubectl apply, get, and delete commands.
What it assumes
Assumes a container image before Kubernetes inner-loop work and introduces manifest-based resource deployment from there.
What you can do after
Apply it via kubectl to create, inspect, update, and remove application resources from YAML manifests.
How it connects
Connects container images, manifests, kubectl, Deployments, Pods, Services, Ingresses, ConfigMaps, Secrets, and kind.

Also explained in

Compare how 7 books explain Kubernetes API →

Related concepts

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