Understanding Kubernetes API Server — A Beginner’s Guide
Unleashing the Powerhouse: Demystifying the Core of Kubernetes

Find Complete mind map of A Beginner’s Guide to Kubernetes
Kubernetes, the popular container orchestration platform, relies on a client/server architecture known as the API Server.
In this blog post, we will take a closer look at the Kubernetes API Server, its key concepts, and how to interact with it effectively.
Check out “Understanding Kubernetes — A Beginner’s Guide” for the comprehensive series🚀
What is the Kubernetes API Server?

The Kubernetes API Server is the component responsible for exposing the Kubernetes control plane’s functionality via a RESTful API over HTTP.
It acts as a bridge between the cluster’s internal components and external clients, allowing them to interact with the Kubernetes cluster and perform operations such as creating, updating, and deleting Kubernetes objects.
One key aspect of the Kubernetes API Server is that it is stateless, meaning it does not store any persistent data.
Instead, all the state information is stored in the cluster store, typically using a distributed key-value store like etcd.
Understanding API Objects
API Objects are Kubernetes objects that represent the overall state of the cluster. They include information about running containerized applications, available resources, and policies that govern their behavior, such as restart policies, upgrades, and fault-tolerance.
API Objects are organized by three main properties:
1. Kind: Represents the type of Kubernetes object, such as Pod, Deployment, Service, and more.
2. Group: Represents the logical group to which the Kubernetes object belongs, such as core, apps, storage, and others. You can find the full list of groups in the official Kubernetes documentation.
3. Version: Represents the version of the Kubernetes API to which the object adheres, such as v1, beta, alpha, and others. You can find the supported API versions using the kubectl api-versions
command.
$ kubectl api-resources | more
$ kubectl api-resources - api-group=apps | more
$ kubectl api-versions | sort | more
Understanding these properties is crucial when interacting with API Objects, as they define the structure and behavior of the objects you work with.
Interacting with API Objects
There are two main modes of operation when interacting with API Objects: Imperative Configuration and Declarative Configuration.
Imperative Configuration
In Imperative Configuration mode, you directly create and manipulate API Objects using command-line commands with kubectl
. This mode is suitable for quick one-off operations or testing.
For example, to create a Pod named “web” with a container running the latest version of the Nginx image, you can use the following command:
$ kubectl run web — image=nginx # Imperative Configuration
Declarative Configuration
In Declarative Configuration mode, you define the desired state of API Objects in YAML or JSON manifests and apply them to the Kubernetes API Server.
This mode is suitable for managing objects in a more declarative and version-controlled manner.
For example, you can create a YAML manifest named “nginx.yml” with the following content:
apiVersion: v1
kind: Pod
metadata:
name: web
spec:
containers:
- name: nginx-container
image: nginx:latest
Then, you can apply the manifest using the kubectl apply command:
$ kubectl apply -f nginx.yml
This approach allows you to define and manage the desired state of your Kubernetes objects in a declarative manner, making it easier to version, manage, and collaborate on your cluster configurations.
Key Takeaways
In this blog post, we learned that the API Server acts as a gateway, providing a RESTful API through which the cluster’s functionality is exposed.
API Objects, which serve as the building blocks of the Kubernetes cluster. These objects encapsulate various resources and their states. We discussed important properties of API Objects such as Kind, Group, and Version, which help identify and categorize different types of objects.
Furthermore, we examined two approaches to interacting with API Objects: Imperative Configuration and Declarative Configuration.
Key takeaways from this post:
- The Kubernetes API Server acts as a bridge between the control plane and external clients, providing access to the cluster’s functionality through a RESTful API.
- API Objects are the building blocks of the cluster, representing various resources and their states.
- Understanding properties like Kind, Group, and Version helps in categorizing and identifying different types of API Objects.
- Imperative Configuration allows direct manipulation of objects using kubectl commands, while Declarative Configuration focuses on defining the desired state through YAML or JSON manifests.
By grasping these concepts, you have gained a solid foundation for working with the Kubernetes API Server and managing API Objects effectively.
Want to go deeper into Architecture of Kubernetes? Check out this!
Stay tuned for more exciting topics in our Understanding Kubernetes — A Beginner’s Guide!
🔔 Stay tuned or subscribe to my series: “Understanding Kubernetes — A Beginner’s Guide” to explore everything about Kubernetes. 🚀
➕Join the Medium Membership Program to support my work and connect with other writers.
📝 Have questions or suggestions? Leave a comment or message me through Medium. Let’s connect!
Thank you for your support! 🌟