Kubernetes API
A Kubernetes API is a platform API that enables cluster management operations and resource state manipulation for kubernetes clusters.
- AKA: K8s API, Kubernetes REST API, Kubernetes HTTP API.
- Context:
- It is the primary interface used to manage, query, and manipulate the state of objects and components in a kubernetes cluster.
- It is fundamental to the control plane of kubernetes and is central to all communication within the system.
- It can typically facilitate operations on kubernetes resources like pods, configmaps, services, and namespaces via rest api calls.
- It can often be accessed through command-line tools like kubectl, which internally translates user commands into api requests, or directly through rest calls.
- It can provide Resource Management through kubernetes api endpoints.
- It can enable Cluster Operation through kubernetes api objects.
- It can support Pod Lifecycle through pod api operations.
- It can handle Service Discovery through service api operations.
- It can manage Configuration State through configuration api operations.
- It can be organized into two main specifications: the Discovery API and the OpenAPI document for api documentation.
- It can support various http verbs such as GET, POST, PUT, PATCH, and DELETE for resource manipulation.
- It can enable multiple api versions and groups concurrently for api evolution.
- It can range from being a Core API Group to being an Extended API Group, depending on its api extension type.
- It can range from being a Stable API Version to being an Alpha API Version, depending on its api maturity level.
- ...
- Examples:
- Kubernetes API Versions, such as:
- Kubernetes API Operations, such as:
- API Access Methods, such as:
- Using kubectl commands like `kubectl get nodes` for resource query.
- Using client library for automated cluster management.
- ...
- Counter-Examples:
- Docker Engine API, which focuses on single container management rather than cluster management.
- Container Runtime Interface, which handles container lifecycle rather than cluster orchestration.
- Cloud Provider API, which manages cloud resource rather than kubernetes resource.
- Docker API, which provides container engine interface rather than cluster management interface.
- Virtual Machine Management, which handles vm lifecycle rather than container orchestration.
- Network Configuration Protocol, which manages network setting rather than cluster resource.
- See: Kubernetes Resource Object, Kubernetes Control Plane, Container Orchestration System, Cluster Management System, API Gateway, kubectl, REST API.
References
2024
- (ChatGPT-OpenAI, 2024) ⇒ Prompt: Summarize the concept Kubernetes API in 1- 2 paragraphs. ChatGPT (model:gpt-4-turbo-preview). Retrieved: 2024-05-05.
- QUOTE: The Kubernetes API is a foundational element of the Kubernetes container orchestration platform, serving as the interface through which users, cluster services, and external components communicate and manage the cluster's lifecycle and operations. It is structured around REST principles, allowing for operations like creating, reading, updating, and deleting (often abbreviated as CRUD) Kubernetes resources such as pods, services, and deployments. These resources and their state are stored in the Kubernetes cluster's etcd database, making the API the gatekeeper to this centralized source of truth.
Through the Kubernetes API, users can interact with the cluster using various tools, including the command-line interface (CLI) tool kubectl, Kubernetes client libraries available in multiple programming languages, or direct HTTP requests. The API serves as an abstraction layer that decouples operations and management from the underlying infrastructure, facilitating a consistent and extensible framework for deployment, scaling, and management of containerized applications. Moreover, the API's extensibility supports custom resources and controllers, enabling users to extend Kubernetes in a declarative manner for custom usage scenarios. This extensibility is key to Kubernetes' adaptability and widespread adoption, allowing it to serve as a robust platform for complex, highly available, and scalable applications.
- QUOTE: The Kubernetes API is a foundational element of the Kubernetes container orchestration platform, serving as the interface through which users, cluster services, and external components communicate and manage the cluster's lifecycle and operations. It is structured around REST principles, allowing for operations like creating, reading, updating, and deleting (often abbreviated as CRUD) Kubernetes resources such as pods, services, and deployments. These resources and their state are stored in the Kubernetes cluster's etcd database, making the API the gatekeeper to this centralized source of truth.
2020a
- (Kubernetes.io, 2020) ⇒ https://kubernetes.io/docs/concepts/overview/kubernetes-api/
- QUOTE: ... The Kubernetes API lets you query and manipulate the state of objects in Kubernetes. The core of Kubernetes' control plane is the API server and the HTTP API that it exposes. Users, the different parts of your cluster, and external components all communicate with one another through the API server.
The core of Kubernetes' control plane is the API server . The API server exposes an HTTP API that lets end users, different parts of your cluster, and external components communicate with one another.
The Kubernetes API lets you query and manipulate the state of objects in the Kubernetes API (for example: Pods, Namespaces, ConfigMaps, and Events).
API endpoints, resource types and samples are described in the API Reference.
- QUOTE: ... The Kubernetes API lets you query and manipulate the state of objects in Kubernetes. The core of Kubernetes' control plane is the API server and the HTTP API that it exposes. Users, the different parts of your cluster, and external components all communicate with one another through the API server.
2020b
- (Kubernetes.io, 2020) ⇒ https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/
- QUOTE: ... You can use the Kubernetes API to read and write Kubernetes resource objects via a Kubernetes API endpoint. …