Skip to main content

Kubernetes API

Kubernetes works like a system where you store objects, and it also has the tools (code) to manage those objects. Each object you create has three parts:

  1. Metadata: Information about the object, like its name and labels.
  2. Specification (spec): What you want Kubernetes to do—your "desired state." For example, "run 3 replicas of my app."
  3. Status: What's actually happening right now—Kubernetes updates this as it works to match the current state to the desired state.

You, as the user, tell Kubernetes what you want by defining the metadata and specification. Kubernetes takes it from there, working to make your instructions happen and keeping you updated on its progress in the status.

This interaction with objects happens through the Kubernetes API, which is the core interface of Kubernetes. The Kubernetes API provides a universal way for users, automation tools, and Kubernetes itself to interact with the objects stored in the system. It allows you to create, update, delete, and retrieve information about the various object resources (like Pods, Deployments, Services, etc.) within a Kubernetes cluster.