How kubernetes/apiserver works
apiserver is a generic Kubernetes API-server library. A client request enters the server, passes authentication, authorization, admission and request handling, then reaches resource registries backed by encoded persistent storage; the result is returned as an API response. Parallel capabilities provide discovery, auditing, API Priority and Fairness, webhooks, policy admission, caching and storage-version coordination. The graph reflects README capabilities and sampled implementations; several server-level connections are inferred from the documented delegated architecture.
Main entry points: genericapiserver.go Generic API Server · rest.go API Handlers · store.go Resource Registry · storage_factory.go Storage Factory
Components 21
Request Processing
- Generic API Server
pkg/server/genericapiserver.go - Version Filter
pkg/endpoints/filters/storageversion.go
Security Controls
- Authentication Factory
pkg/authentication/authenticatorfactory/delegating.go - Authorization Factory
pkg/authorization/authorizerfactory/delegating.go - Audit Evaluation
pkg/audit/evaluator.go - Priority Fairness
pkg/util/flowcontrol/apf_controller.go
API Surface
- API Handlers
pkg/endpoints/handlers/rest.go - API Discovery
pkg/endpoints/discovery/root.go - Resource Registry
pkg/registry/generic/registry/store.go
Persistence Layer
- Storage Factory
pkg/server/storage/storage_factory.go - Storage Codec
pkg/server/storage/storage_codec.go - Watch Cache
pkg/registry/generic/registry/storage_factory.go - Storage Errors
pkg/storage/errors/storage.go - Storage Versions
pkg/storageversion/manager.go
Extensibility
- Admission Chain
pkg/admission/chain.go - Policy Admission
pkg/admission/plugin/policy/generic/policy_dispatcher.go - Webhook Dispatchers
pkg/admission/plugin/webhook/generic/webhook.go
Other components
- Kubernetes Client
- Webhook Services
- etcd Storage
- API Response
Connections 21
- Kubernetes Client → Generic API Server: sends request
- Generic API Server → Authentication Factory: authenticates
- Generic API Server → Authorization Factory: authorizes
- Generic API Server → Admission Chain: admits request
- Generic API Server → API Handlers: dispatches request
- Generic API Server → Audit Evaluation: records audit
- Generic API Server → Priority Fairness: queues request
- API Handlers → Resource Registry: uses storage
- API Handlers → API Response: writes result
- Generic API Server → API Discovery: serves discovery
- Admission Chain → Policy Admission: dispatches policy
- Admission Chain → Webhook Dispatchers: dispatches webhooks
- Webhook Dispatchers → Webhook Services: calls webhook
- Resource Registry → Storage Factory: creates storage
- Storage Factory → Storage Codec: configures codec
- Storage Factory → etcd Storage: opens backend
- Resource Registry → Watch Cache: wraps storage
- Watch Cache → etcd Storage: reads and watches
- API Handlers → Storage Errors: maps failures
- Storage Versions → Version Filter: gates writes
- Generic API Server → Version Filter: filters requests