API Server: The Cluster Gateway
What You'll Learn
You'll understand how the kube-apiserver acts as the central gateway for all Kubernetes cluster operations and coordinates communication between components.
The Cluster's Front Door
The kube-apiserver is the only component that directly talks to etcd (the cluster's database) and serves as the entry point for all administrative tasks. Think of it like a hotel reception desk—every request to check in, check out, or get information must go through the front desk. Nothing happens in your cluster without the API server knowing about it.
How It Processes Requests
When you run a command or an application makes a request, here's what happens:
- Authentication: "Who are you?" The API server verifies your identity
- Authorization: "Are you allowed to do this?" It checks your permissions
- Admission Control: "Does this request meet cluster policies?" Additional validation rules apply
- Validation: "Is this request properly formatted?" It ensures the data makes sense
- Persistence: If approved, the request is stored in etcd
- Response: The API server returns the result to you
The Central Coordinator
The API server doesn't do the work itself—it's a coordinator. When you create a pod, the API server doesn't run the containers. Instead, it stores your request in etcd, and the scheduler (which watches the API server) notices the new pod and assigns it to a node. The kubelet on that node (also watching the API server) then creates the actual containers.
Everything communicates through the API server, never directly with each other.
Key Takeaway: The kube-apiserver is the central management gateway that authenticates, authorizes, validates, and coordinates all cluster operations by serving as the single source of truth between all Kubernetes components.