Kubernetes (K8s) (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)
Kube-API Server Request Lifecycle: Authentication, Authorization, and Admission Controllers.
senior LevelCode ExampleLifecycleSecurity & AuthSystem Design
In Simple Words:
Every request to kube-apiserver passes through a strict 3-phase pipeline before being committed to etcd:
sql
[ Incoming HTTP Request ]
|
v
+------------------------+
| 1. Authentication | -> X.509 Client Certs, OIDC Bearer Tokens, Webhook Tokens
+------------------------+
| (Authenticated User & Groups)
v
+------------------------+
| 2. Authorization | -> RBAC (Role-Based Access Control), ABAC, Webhook
+------------------------+
| (Authorized?)
v
+------------------------+
| 3. Mutating Webhooks | -> Injects sidecars (Istio), default storageclasses, security contexts
+------------------------+
|
v
+------------------------+
| 4. Schema Validation | -> Validates JSON schema against OpenAPI spec
+------------------------+
|
v
+------------------------+
| 5. Validating Webhooks | -> Enforces OPA / Kyverno security policies (e.g. block root user)
+------------------------+
|
v
[ etcd ] (Committed to persistent storage)