API Request Flow and Authentication
You'll learn: How every request to the Kubernetes API Server travels through authentication, authorization, and admission control before being processed.
The Three-Gate Security Model
When you send a request to the Kubernetes API Server (whether through kubectl, a client library, or directly), it doesn't immediately execute. Instead, it passes through three security checkpoints in strict order:
1. Authentication (Who are you?)
The API Server first verifies your identity. It checks credentials like certificates, bearer tokens, or service account tokens. Multiple authentication plugins can be active simultaneously—the first one to successfully validate your identity wins. If none succeed, the request is rejected with a 401 Unauthorized error.
2. Authorization (What can you do?)
Once authenticated, the system checks what permissions you have. Using RBAC (Role-Based Access Control), the server validates whether your identity has permission to perform the requested action (like create, get, or delete) on the specified resource. Failed authorization returns a 403 Forbidden error.
3. Admission Control (Should this be allowed?)
Even with proper permissions, admission controllers can still intercept requests. These plugins validate or mutate objects—for example, enforcing naming conventions, setting default values, or blocking unsafe configurations. Some are validating (approve/reject), others are mutating (modify before accepting).
Think of It Like Airport Security
Authentication is checking your passport (proving identity), authorization is verifying your boarding pass matches your flight (checking permissions), and admission control is the final gate agent ensuring you meet all airline policies (enforcing cluster-specific rules).
Key Takeaway: Every Kubernetes API request flows through authentication → authorization → admission control in sequence, with each layer acting as a security gate that must be passed before the request reaches etcd and changes cluster state.